diff --git a/.gitattributes b/.gitattributes index a43d489d3f0..1f09755b9f7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -31,4 +31,3 @@ src/e2e/resources/data/* linguist-vendored src/test/resources/data/* linguist-vendored src/test/resources/emails/* linguist-vendored -src/test/resources/pages/* linguist-vendored diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 7693a038274..8fd238382dd 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -6,7 +6,7 @@ about: Report a bug or defect in the application -- **Environment**: +- **Environment**: **Steps to reproduce** diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 10e9dd28773..dd46e8ae9c3 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -6,7 +6,7 @@ about: Request a new or a change to existing user-facing feature -- **Environment**: +- **Environment**: **Description of feature/enhancement** diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index 5107568b7f5..bb6bc22ccd2 100755 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -3,8 +3,8 @@ If you are looking for support for TEAMMATES, check out: * User Documentation - * [For students](http://teammatesv4.appspot.com/studentHelp.jsp) - * [For instructors](http://teammatesv4.appspot.com/instructorHelp.jsp) + * [For students](https://teammatesv4.appspot.com/web/front/help/student) + * [For instructors](https://teammatesv4.appspot.com/web/front/help/instructor) * [Developer Documentation](../docs/README.md) * [FAQs by external contributors](https://github.com/TEAMMATES/teammates/issues?utf8=✓&q=is:issue+label:a-DevHelp). Note that many of the questions asked and/or answers provided may have been outdated now. diff --git a/.gitignore b/.gitignore index 67f4aef4e0f..fcd9a967354 100644 --- a/.gitignore +++ b/.gitignore @@ -57,5 +57,6 @@ src/main/webapp/* src/client/java/teammates/client/scripts/statistics/data/ src/client/java/teammates/client/scripts/log/ src/e2e/resources/gmail-api/ +src/e2e/resources/downloads/ !.gitkeep diff --git a/.travis.yml b/.travis.yml index 96c096e9647..24084fe41ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -77,7 +77,7 @@ jobs: - mv src/e2e/resources/test.travis.properties src/e2e/resources/test.properties - ./gradlew createConfigs testClasses generateTypes - npm ci - - npm run build -- --progress=false + - npm run build -- --progress=false --serviceWorker=false - ./gradlew appengineStart script: - ./gradlew e2eTests @@ -95,7 +95,7 @@ jobs: - mv src/e2e/resources/test.travis-chrome.properties src/e2e/resources/test.properties - ./gradlew createConfigs testClasses generateTypes - npm ci - - npm run build -- --progress=false + - npm run build -- --progress=false --serviceWorker=false - ./gradlew appengineStart script: - ./gradlew e2eTests diff --git a/README.md b/README.md index 62886bae9a7..7817eca79cd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # TEAMMATES Developer Web Site [![Travis Build Status](https://travis-ci.org/TEAMMATES/teammates.svg?branch=master)](https://travis-ci.org/TEAMMATES/teammates) -[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/dvr6t33lqg6hsmxw/branch/master?svg=true)](https://ci.appveyor.com/project/damithc/teammates/branch/master) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/dvr6t33lqg6hsmxw/branch/master?svg=true)](https://ci.appveyor.com/project/nus-oss/teammates/branch/master) [![Codecov Coverage Status](https://codecov.io/gh/TEAMMATES/teammates/branch/master/graph/badge.svg)](https://codecov.io/gh/TEAMMATES/teammates) [![License](https://img.shields.io/badge/license-GPLv2-blue.svg)](LICENSE) diff --git a/angular.json b/angular.json index e55ea703239..44cee21c72a 100644 --- a/angular.json +++ b/angular.json @@ -22,50 +22,12 @@ "main": "src/web/main.ts", "polyfills": "src/web/polyfills.ts", "tsConfig": "tsconfig.app.json", - "aot": false, + "aot": true, "assets": [ - "src/web/assets/", - { - "glob": "**/*", - "input": "node_modules/tinymce/skins", - "output": "tinymce/skins" - }, - { - "glob": "**/*", - "input": "node_modules/tinymce/plugins/emoticons/js", - "output": "plugins/emoticons/js" - } + "src/web/assets/" ], "styles": [ "src/web/styles.scss" - ], - "scripts": [ - "node_modules/tinymce/tinymce.min.js", - "node_modules/tinymce/themes/silver/theme.js", - "src/web/tinymce/placeholder-plugin.js", - "node_modules/tinymce/plugins/advlist/plugin.js", - "node_modules/tinymce/plugins/autolink/plugin.js", - "node_modules/tinymce/plugins/lists/plugin.js", - "node_modules/tinymce/plugins/link/plugin.js", - "node_modules/tinymce/plugins/image/plugin.js", - "node_modules/tinymce/plugins/charmap/plugin.js", - "node_modules/tinymce/plugins/print/plugin.js", - "node_modules/tinymce/plugins/hr/plugin.js", - "node_modules/tinymce/plugins/anchor/plugin.js", - "node_modules/tinymce/plugins/searchreplace/plugin.js", - "node_modules/tinymce/plugins/wordcount/plugin.js", - "node_modules/tinymce/plugins/visualblocks/plugin.js", - "node_modules/tinymce/plugins/visualchars/plugin.js", - "node_modules/tinymce/plugins/code/plugin.js", - "node_modules/tinymce/plugins/fullscreen/plugin.js", - "node_modules/tinymce/plugins/insertdatetime/plugin.js", - "node_modules/tinymce/plugins/nonbreaking/plugin.js", - "node_modules/tinymce/plugins/save/plugin.js", - "node_modules/tinymce/plugins/table/plugin.js", - "node_modules/tinymce/plugins/directionality/plugin.js", - "node_modules/tinymce/plugins/emoticons/plugin.js", - "node_modules/tinymce/plugins/paste/plugin.js", - "node_modules/tinymce/plugins/textpattern/plugin.js" ] }, "configurations": { @@ -78,20 +40,10 @@ ], "index": { "input": "src/web/index.prod.html", - "output": "index.html", + "output": "index.html" }, "assets": [ "src/web/assets/", - { - "glob": "**/*", - "input": "node_modules/tinymce/skins", - "output": "tinymce/skins" - }, - { - "glob": "**/*", - "input": "node_modules/tinymce/plugins/emoticons/js", - "output": "plugins/emoticons/js" - }, "src/web/BingSiteAuth.xml", "src/web/google8c7ef1e995031e09.html", "src/web/pulse.html", diff --git a/build.gradle b/build.gradle index bd042c6f573..91e35a13e9d 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ apply plugin: "com.github.spotbugs" apply plugin: "jacoco" apply plugin: "cz.habarta.typescript-generator" -def appengineVersion = "1.9.+" +def appengineVersion = "1.9.81" def checkstyleVersion = "8.33" def pmdVersion = "6.24.0" def spotbugsVersion = "4.0.6" @@ -151,29 +151,30 @@ tasks.withType(cz.habarta.typescript.generator.gradle.GenerateTask) { task generateApiOutputFormat(type: cz.habarta.typescript.generator.gradle.GenerateTask) { classPatterns = [ - "teammates.ui.webapi.output.**", + "teammates.ui.output.**", "teammates.common.datatransfer.questions.**" ] removeTypeNameSuffix = "Data" outputFile = "src/web/types/api-output.ts" excludeClassPatterns = [ - "teammates.ui.webapi.output.**Builder" + "teammates.ui.output.**Builder" ] excludeClasses = [ - "teammates.ui.webapi.output.SessionResultsData\$NameInfo" + "teammates.ui.output.SessionResultsData\$NameInfo" ] } task generateApiRequestFormat(type: cz.habarta.typescript.generator.gradle.GenerateTask) { classPatterns = [ - "teammates.ui.webapi.request.**" + "teammates.ui.request.**", + "teammates.common.util.EmailType" ] outputFile = "src/web/types/api-request.ts" } task generateApiEndpoints(type: cz.habarta.typescript.generator.gradle.GenerateTask) { classPatterns = [ - "teammates.ui.webapi.endpoints.**" + "teammates.ui.endpoints.**" ] jsonLibrary = 'jackson2' jackson2Configuration = [ @@ -372,6 +373,9 @@ def checkTestNgFailureClosure = { descriptor, result -> } } +def isTravis = System.getenv("TRAVIS") != null +def isAppVeyor = System.getenv("APPVEYOR") != null + // Displays full exception; to be run after the test fails after the last retry def afterTestClosure = { descriptor, result -> if (result.resultType == TestResult.ResultType.FAILURE && result.exception != null && result.exception.getMessage() != null) { @@ -435,24 +439,7 @@ task lint { // TEST TASKS -def numOfTestRetries = 3 -def isTravis = System.getenv("TRAVIS") != null -def isAppVeyor = System.getenv("APPVEYOR") != null - -test { - useTestNG() - options.useDefaultListeners = true - ignoreFailures false - maxHeapSize = "1g" - reports.html.enabled = false - reports.junitXml.enabled = false - jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8" - afterTest afterTestClosure - afterSuite checkTestNgFailureClosure - testLogging { - events "passed" - } -} +def numOfTestRetries = 4 task lnpTests(type: Test) { systemProperty "random.testing.seed", new Random().nextInt() // re-run tests even if they are up-to-date @@ -484,16 +471,21 @@ task lnpTests(type: Test) { } } -task failedTests(type: Test) { +task componentTests(type: Test) { + description "Runs the full unit and integration test suite." + group "Test" useTestNG() - options.suites "test-output/testng-failed.xml" - options.outputDirectory = file("build/reports/test-failed") + options.suites "src/test/resources/testng-component.xml" options.useDefaultListeners = true ignoreFailures false maxHeapSize = "1g" reports.html.enabled = false reports.junitXml.enabled = false - jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8" + if (isTravis) { + jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8", "-Djava.io.tmpdir=" + System.getenv("TRAVIS_BUILD_DIR") + } else { + jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8" + } afterTest afterTestClosure afterSuite checkTestNgFailureClosure testLogging { @@ -501,11 +493,6 @@ task failedTests(type: Test) { } } -task componentTests { - description "Runs the full unit test suite and retries failed test up to ${numOfTestRetries} times." - group "Test" -} - task e2eTests { description "Runs the full E2E test suite and retries failed test up to ${numOfTestRetries} times." group "Test" @@ -514,33 +501,6 @@ task e2eTests { (1..numOfTestRetries + 1).each { id -> def isFirstTry = id == 1 def isLastRetry = id == numOfTestRetries + 1 - task "componentTestTry${id}"(type: Test) { - useTestNG() - options.suites isFirstTry ? "src/test/resources/testng-component.xml" : file("${buildDir}/reports/component-test-try-${id - 1}/testng-failed.xml") - options.outputDirectory = file("${buildDir}/reports/component-test-try-${id}") - options.useDefaultListeners = true - ignoreFailures = !isLastRetry - maxHeapSize = "1g" - reports.html.enabled = false - reports.junitXml.enabled = false - if (isTravis) { - jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8", "-Djava.io.tmpdir=" + System.getenv("TRAVIS_BUILD_DIR") - } else { - jvmArgs "-Xss2m", "-Dfile.encoding=UTF-8" - } - testLogging { - events "passed" - } - if (isLastRetry) { - afterTest afterTestClosure - } else if (isFirstTry) { - afterSuite checkTestNgFailureClosure - } - onlyIf { - isFirstTry || file("${buildDir}/reports/component-test-try-${id - 1}/testng-failed.xml").exists() - } - } - componentTests.dependsOn "componentTestTry${id}" task "e2eTestTry${id}"(type: Test) { useTestNG() @@ -559,9 +519,8 @@ task e2eTests { testLogging { events "passed" } - if (isLastRetry) { - afterTest afterTestClosure - } else if (isFirstTry) { + afterTest afterTestClosure + if (isFirstTry) { afterSuite checkTestNgFailureClosure } finalizedBy "killFirefox${id}", "killChromedriver${id}" @@ -575,8 +534,10 @@ task e2eTests { doFirst { if (isWindows) { commandLine "taskkill", "/f", "/im", "firefox.exe" + commandLine "taskkill", "/f", "/im", "geckodriver.exe" } else { commandLine "pkill", "firefox" + commandLine "pkill", "geckodriver" } // Silence output for this task standardOutput = new ByteArrayOutputStream() @@ -608,17 +569,12 @@ jacoco { toolVersion = jacocoVersion } -task jacocoMerge(type: JacocoMerge) { - destinationFile = file("${buildDir}/jacocoMerge/jacocoMerge.exec") - executionData fileTree("${buildDir}/jacoco").files -} - task jacocoReport(type: JacocoReport) { description "Runs coverage session from available test run data." group "Test" sourceDirectories.from files(sourceSets.main.java.srcDirs) classDirectories.from files(sourceSets.main.output) - executionData jacocoMerge.destinationFile + executionData fileTree("${buildDir}/jacoco").files reports { xml.enabled true html.enabled true @@ -628,7 +584,6 @@ task jacocoReport(type: JacocoReport) { fileTree(dir: it, exclude: ["**/*.jar"]) }) } - dependsOn jacocoMerge } // Helper methods diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index dab1dfc8c11..60dfbeeb2f2 100755 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -2,7 +2,7 @@ Thanks for taking your time to contribute to TEAMMATES! -We welcome contributions from anyone, in particular, students (see [here](https://teammatesv4.appspot.com/about.jsp) for the list of our contributors). One of the main objectives of TEAMMATES is to help students get experience in a OSS production environment. Here are some information that might be useful to would-be contributors. +We welcome contributions from anyone, in particular, students (see [here](https://teammatesv4.appspot.com/web/front/about) for the list of our contributors). One of the main objectives of TEAMMATES is to help students get experience in an OSS production environment. Here are some information that might be useful to would-be contributors. * [Getting started](#getting-started) * [Know the product/project](#know-the-productproject) @@ -23,7 +23,7 @@ We welcome contributions from anyone, in particular, students (see [here](https: Understand what TEAMMATES is about, both as a product (users' point of view) and a project (developers' point of view). * [Product intro page](https://teammatesv4.appspot.com) shown to potential users -* [Features overview](https://teammatesv4.appspot.com/features.jsp) +* [Features overview](https://teammatesv4.appspot.com/web/front/features) * [Project vision, challenges, and principles](overview.md) ### Code of Conduct @@ -43,7 +43,7 @@ If you are certain that you are reporting a new issue, [open a new issue](https: We welcome anyone manually testing our product and reporting bugs or suggestions for enhancements in the issue tracker. -If you want to undertake such a role without actually contributing code, [get an instructor account from TEAMMATES](https://teammatesv4.appspot.com/request.jsp). +If you want to undertake such a role without actually contributing code, [get an instructor account from TEAMMATES](https://teammatesv4.appspot.com/web/front/request). Remember to mention the purpose of your request under "Any other comments/queries". ### Submitting a pull request @@ -86,7 +86,8 @@ Roles: 1. [Set up TEAMMATES development environment on your computer.](setting-up.md)
**Important: Follow instructions to the letter. Install the specified versions of the tool stack, not the latest versions.** -1. Get *dev green* (more info in [_Development Guidelines_ document](development.md)). +1. Get all component tests to pass (more info in [_Development Guidelines_ document](development.md)). +1. (Optional) Get all E2E tests to pass. It is OK to proceed to the next phase if you have fewer than 5 failing test cases. #### Phase B: Learn @@ -96,11 +97,10 @@ Try your best to be familiar with at least building and testing the application #### Phase C: Start contributing -When you are ready for a real contribution, you are advised to start with an issue labelled [d.FirstTimers](https://github.com/TEAMMATES/teammates/issues?q=is:issue+is:open+label:d.FirstTimers) (but do not do more than one of those), then move on to other issues labelled [d.Contributors](https://github.com/TEAMMATES/teammates/issues?q=is:issue+is:open+label:d.Contributors). +When you are ready for a real contribution, you are advised to start with an issue labelled [good first issue](https://github.com/TEAMMATES/teammates/issues?q=is:issue+is:open+label:"good+first+issue") (but do not do more than one of those), then move on to other issues labelled [help wanted](https://github.com/TEAMMATES/teammates/issues?q=is:issue+is:open+label:"help+wanted"). Steps for fixing an issue are lined out in the [process document](process.md). -> In the event that you cannot find a `d.FirstTimers`-labelled issue, you can start with a `d.Contributors`-labelled issue. -> You can consult the `e.*` label, if it is present, to estimate the difficulty. Lower number generally means less amount of work required. +> In the event that you cannot find a `good first issue`-labelled issue, you can start with a `help wanted`-labelled issue. #### Important diff --git a/docs/design.md b/docs/design.md index d89a66b1c4f..403f28880f7 100644 --- a/docs/design.md +++ b/docs/design.md @@ -17,10 +17,9 @@ TEAMMATES is a Web application that runs on Google App Engine (GAE). Given above - **UI (Browser)**: The UI seen by users consists of Web pages containing HTML, CSS (for styling) and JavaScript (for client-side interactions such as sorting, input validation, etc.). This UI is a single HTML page generated by Angular framework. The initial page request is sent to the server over HTTP, and requests for data are sent asynchronously with AJAX. - **UI (Server)**: The entry point for the application back end logic is designed as a REST-ful controller. - **Logic**: The main logic of the application is in POJOs (Plain Old Java Objects). -- **Storage**: The storage layer of the application uses the persistence framework provided by **GAE Datastore**, a NoSQL database. +- **Storage**: The storage layer of the application uses the persistence framework provided by **Google Cloud Datastore**, a NoSQL database. - **Test Driver**: TEAMMATES makes heavy use of automated regression testing. Test data is transmitted using JSON format. - `TestNG` is used for Java testing (all levels) and `Jest` for JavaScript unit-testing. - - `HttpUnit` is used to set up a simulated web server in servlet-level tests, where an actual web server is not required. - **E2E**: The E2E (end-to-end) component is used to interact with the application as a whole with Web browsers. Its primary function is for E2E tests. - `Selenium (Java)` is used to automate E2E testing with actual Web browsers. - **Client**: The Client component can connect to the back end directly without using a Web browser. It is used for administrative purposes, e.g. migrating data to a new schema. @@ -31,7 +30,7 @@ The diagram below shows how the code in each component is organized into package ![Package Diagram](images/packageDiagram.png) Notes: -- `[logic] - [ui::website] - [ui::controller]` represent an application of `Model-View-Controller` pattern. +- `[logic] - [ui::website] - [ui::webapi]` represent an application of `Model-View-Controller` pattern. - `ui::website` is not a real package; it is a conceptual package representing the front-end of the application. ## UI Component @@ -68,10 +67,10 @@ The initial request for the web page will be processed as follows: Subsequent AJAX requests sent to the server will be processed as follows: 1. Request forwarded to the `WebApiServlet`. -1. `WebApiServlet` uses the `ActionFactory` to generate the matching `Action` object, e.g. `InstructorHomePageAction`. +1. `WebApiServlet` uses the `ActionFactory` to generate the matching `Action` object, e.g. `GetFeedbackSessionsAction`. 1. `WebApiServlet` executes the action. 1. The `Action` object checks the access rights of the user. If the action is allowed, it will be performed, interacting with the `Logic` component as necessary. - 1. The `Action` packages and processes the result into an `ActionResult` object. The most common format is `JsonResult` (requests for obtaining data or processing existing data), and other formats are defined as necessary, e.g. `FileDownloadResult` (e.g. downloading feedback session report) and `ImageResult` (e.g. profile pictures). + 1. The `Action` packages and processes the result into an `ActionResult` object. The most common format is `JsonResult` (requests for obtaining data or processing existing data) and other formats are defined as necessary, e.g. `ImageResult` (e.g. profile pictures). 1. `WebApiServlet` sends the result back to the browser which will then process it on the front-end. Requests for static asset files (e.g. CSS, JS files, images) are served directly without going through `web.xml` configuration at all. @@ -90,10 +89,7 @@ This type of request will be processed as follows: 1. The source of the request will be checked for administrator privilege. If this privilege is absent (e.g. non-administrator users trying to invoke the automated actions), the request will be dropped and a `403 Forbidden` status will be returned. - Requests generated by the GAE server are equipped with this privilege. - Administrators can manually invoke these requests; this is particularly useful in testing the actions associated with those requests. -1. Request forwarded to the `AutomatedServlet`. -1. `AutomatedServlet` uses the `AutomatedActionFactory` to generate the matching `AutomatedAction` object, e.g. `CompileLogsAction`. -1. `AutomatedServlet` executes the action. -1. The corresponding `AutomatedAction` will be performed, interacting with the `Logic` component as necessary. +1. Request forwarded to the `WebApiServlet` and subsequent actions are the same as user-invoked AJAX requests. GAE server sends such automated requests through two different configurations: - Cron jobs: These are jobs that are automatically scheduled for a specified period of time, e.g. scheduling feedback session opening reminders. It is configured in `cron.xml`. @@ -101,7 +97,35 @@ GAE server sends such automated requests through two different configurations: ### Template Method pattern -- Since the high-level workflow of processing a request is same for any request (differing by the two request types only), we use the [Template Method pattern](http://en.wikipedia.org/wiki/Template_method_pattern) to abstract the process flow into the `Action` and `AutomatedAction` classes. +- Since the high-level workflow of processing a request is same for any request (differing by the two request types only), we use the [Template Method pattern](http://en.wikipedia.org/wiki/Template_method_pattern) to abstract the process flow into the `Action` classes. + +### Policies + +On designing API endpoints (for AJAX requests): + +- Design endpoints for resources. For example, `FeedbackSession` is a resource. The corresponding endpoint is `/session`. We use `GET`, `POST`, `PUT`, `DELETE` HTTP methods to get, create, update and delete the resource respectively. +- Prefer multiple REST calls over single RPC (Remote Procedure Call) calls. + - Reason 1: REST paradigm promotes reuse of many business logic and is not dependent of the structure of the requesting web page (or any other type of requesting agent). + - Reason 2: Multiple REST calls can be parallelized which will improve performance. +- Separate access control logic and execution logic completely. + - In the case that an endpoint serves multiple purposes, we use `Intent` to distinguish the intent for the request. For example, instructors can access `/session` with intent `INSTRUCTOR_SUBMISSION` or `FULL_DETAIL`. Some `Intent` will naturally require stricter access rights. +- Prefer HTTP request body over URL parameters (key-value) to contain data for `POST` and `PUT` requests. + - Reason 1: The URL parameters are used to identify a specific resource for an endpoint, not what should be done to them. + - Reason 2: Request body is not limited to key-value format which allows proper design and validation. + - Data Transfer Objects (DTOs) which represent different API requests and responses are defined in `request` and `output` package respectively. +- Preprocess data sent/received by the server to hide complexities. For example, timestamp is passed as UNIX epoch milliseconds in the output while it is represented as `Instant` in the back-end. + - Some constructors in the `output` package contain logic to hide "hacks" in the backend. + - Some getters/setters in the `request` package contain logic to cater the conventions in the backend. + - Some fields are required be hidden in the API response, mostly for data privacy purposes. Whenever required, there should be methods in the request output objects catered for this. +- API endpoints should not be concerned with how data is presented. + - Case study 1: some endpoint will pass timezone information via two information: timezone ID and UNIX epoch milliseconds. It is up to the front-end on how to make use of those two pieces of information. + - Case study 2: CSV file for session result or student list is just a different way of presenting the same information in the web page. Due to this, when downloding CSV, the web page will request the same information as that used when displaying in web page and do the necessary conversion to CSV. + +On data exchange between front-end and back-end: + +- Back-end is the single source of truth for all data format and the code used by front-end is generated from this. + - The endpoint information is synced to `api-endpoints.ts`. + - The schemas of the DTOs defined in `output` and `request` packages are synced to `api-output.ts` and `api-request.ts` in the frontend. ## Logic Component @@ -178,7 +202,7 @@ This is because we want to keep the data schema flexible so that new entity type ### Storage API -Represented by the `*Db` classes. These classes act as the bridge to the GAE Datastore. +Represented by the `*Db` classes. These classes act as the bridge to the Google Cloud Datastore. ### Policies @@ -217,7 +241,7 @@ Package overview: ![Data Transfer Classes](images/dataTransferClasses.png) 1. `Test Driver` can use the `DataBundle` in this manner to send an arbitrary number of objects to be persisted in the database. -1. This structure can be used to transfer data of a course (e.g., when constructing the home page for an instructor). +1. This structure can be used to transfer search results of a student or instructor or response comments. 1. This structure can be used to send results of a feedback session (e.g., when showing a feedback session report to an instructor). Some of these classes are methodless (and thus more of a data structure rather than a class); these classes use public variables for data for easy access. @@ -228,18 +252,13 @@ This component automates the testing of TEAMMATES. ![Test Driver Component](images/TestDriverComponent.png) -Package overview: -- **`test.driver`**: Contains infrastructure and helpers needed for running the tests. -- **`test.cases`**: Contains test cases. - Sub-packages: - - **`.testdriver`**: Component test cases for testing the test driver infrastructure and helpers. - - **`.datatransfer`**: Component test cases for testing the datatransfer objects from the `Common` component. - - **`.util`**: Component test cases for testing the utility classes from the `Common` component. - - **`.logic`**: Component test cases for testing the `Logic` component. - - **`.storage`**: Component test cases for testing the `Storage` component. - - **`.search`**: Component test cases for testing the search functions. - - **`.webapi`**: System test cases for testing the user-invoked actions. - - **`.automated`**: System test cases for testing the system-automated actions (manually invoked during testing). +The test driver component's package structure follows the corresponding production package structure's exactly, +e.g. `teammates.logic.core.*` will contain the test cases for the production code inside `teammates.logic.core` package. +In the same spirit, for the front end, each `*.component.ts` will have the corresponding `*.component.spec.ts` in the same folder (similarly for `*.service.ts`, `*.pipe.ts`, etc.). + +The test driver component introduces the following additional packages: +- **`architecture`**: Contains test cases used by one of the lint tools to check for architectural integrity. +- **`test`**: Contains infrastructure and helpers needed for running the tests. Also contains the test cases for the said infrastructure/helpers. Notes: - Component tests: Some of these are pure unit tests (i.e. testing one component in isolation) while others are integration tests that test units as well as integration of units with each other. diff --git a/docs/development.md b/docs/development.md index 11850bb403d..6a62f55587c 100644 --- a/docs/development.md +++ b/docs/development.md @@ -220,17 +220,17 @@ Back-end component tests and E2E tests follow this configuration: Test suite | Command | Results can be viewed in ---|---|--- -`Component tests` | `./gradlew componentTests` | `{project folder}/build/reports/component-test-try-{n}/index.html`, where `{n}` is the sequence number of the test run +`Component tests` | `./gradlew componentTests` | `{project folder}/build/reports/tests/componentTests/index.html` `E2E tests` | `./gradlew e2eTests` | `{project folder}/build/reports/e2e-test-try-{n}/index.html`, where `{n}` is the sequence number of the test run -`Failed tests` | `./gradlew failedTests` | `{project folder}/build/reports/test-failed/index.html` -Any individual test | `./gradlew test --tests TestClassName` | `{project folder}/build/reports/tests/index.html` +Any individual component test | `./gradlew componentTests --tests TestClassName` | `{project folder}/build/reports/tests/componentTests/index.html` +Any individual E2E test | `./gradlew e2eTestTry1 --tests TestClassName` | `{project folder}/build/reports/e2e-test-try-1/index.html` -- `Component tests` and `E2E tests` will be run in their entirety once and the failed tests will be re-run a few times. All other test suites will be run once and only once. +- `E2E tests` will be run in their entirety once and the failed tests will be re-run a few times. All other test suites will be run once and only once. - Before running `E2E tests`, it is important to have the both front-end and back-end dev servers running locally first if you are testing against them. You can generate the coverage data with `jacocoReport` task after running tests, e.g.: ```sh -./gradlew appengineRun componentTests jacocoReport +./gradlew componentTests jacocoReport ``` The report can be found in the `build/reports/jacoco/jacocoReport/` directory. @@ -247,7 +247,6 @@ If you are testing against a production server (staging server or live server), * In particular, you will need legitimate Google accounts to be used for testing. 1. Run the full test suite or any subset of it as how you would have done it in dev server. - * You may want to run `InstructorCourseDetailsPageUiTest` standalone first because you would need to login to test accounts for the first time. * Do note that the GAE daily quota is usually not enough to run the full test suite, in particular for accounts with no billing enabled. 1 This setup is necessary because our test suite uses the Gmail API to access Gmail accounts used for testing (these accounts are specified in `test.properties`) to confirm that those accounts receive the expected emails from TEAMMATES. diff --git a/docs/glossary.md b/docs/glossary.md index 04777f82cee..47cd36ccaa5 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -49,10 +49,3 @@ This document lines out the common terms used in the project. + **Component tests**: Unit and integration tests, i.e. white-box tests. There are separate component test suites for front-end and back-end. + **E2E tests**: End-to-end system tests, i.e. black-box tests. Also used for product acceptance. + **CI tests**: Tests to be run on the CI server. Consists of components tests and E2E tests. - -`* green`: - -+ **Dev green**: **All** tests are passing on the dev server. -+ **CI green**: **CI** tests are passing on the CI server. -+ **Staging green**: **All** tests are passing against your own staging server. -+ **Live green**: **All** tests are passing against the app running on the live server. diff --git a/docs/images/ClientComponent.png b/docs/images/ClientComponent.png index 355b339cd58..f4b8743c58d 100644 Binary files a/docs/images/ClientComponent.png and b/docs/images/ClientComponent.png differ diff --git a/docs/images/ClientComponent.pptx b/docs/images/ClientComponent.pptx index 852cffc9402..b2c8a1ad52e 100644 Binary files a/docs/images/ClientComponent.pptx and b/docs/images/ClientComponent.pptx differ diff --git a/docs/images/CommonComponent.png b/docs/images/CommonComponent.png index 6c6e102f983..8f3f848d5cb 100644 Binary files a/docs/images/CommonComponent.png and b/docs/images/CommonComponent.png differ diff --git a/docs/images/CommonComponent.pptx b/docs/images/CommonComponent.pptx index 3785b9e5826..e82e3790176 100644 Binary files a/docs/images/CommonComponent.pptx and b/docs/images/CommonComponent.pptx differ diff --git a/docs/images/E2EComponent.png b/docs/images/E2EComponent.png index 7b488631eb4..34b6a829e4d 100644 Binary files a/docs/images/E2EComponent.png and b/docs/images/E2EComponent.png differ diff --git a/docs/images/E2EComponent.pptx b/docs/images/E2EComponent.pptx index 0d17237009b..6ea2ee284b8 100644 Binary files a/docs/images/E2EComponent.pptx and b/docs/images/E2EComponent.pptx differ diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png index 9e1bc8199aa..0d96743dffb 100644 Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ diff --git a/docs/images/StorageClassDiagram.pptx b/docs/images/StorageClassDiagram.pptx index 437d6e72211..c149e6ba614 100644 Binary files a/docs/images/StorageClassDiagram.pptx and b/docs/images/StorageClassDiagram.pptx differ diff --git a/docs/images/StorageComponent.png b/docs/images/StorageComponent.png index dc477cf5e62..d46a66b0dd5 100644 Binary files a/docs/images/StorageComponent.png and b/docs/images/StorageComponent.png differ diff --git a/docs/images/StorageComponent.pptx b/docs/images/StorageComponent.pptx index a4dab94a524..be6e4557ac5 100644 Binary files a/docs/images/StorageComponent.pptx and b/docs/images/StorageComponent.pptx differ diff --git a/docs/images/TestDriverComponent.png b/docs/images/TestDriverComponent.png index 1b01e6923f0..05003dfbe51 100644 Binary files a/docs/images/TestDriverComponent.png and b/docs/images/TestDriverComponent.png differ diff --git a/docs/images/TestDriverComponent.pptx b/docs/images/TestDriverComponent.pptx index 3d843b925af..944e9c4b678 100644 Binary files a/docs/images/TestDriverComponent.pptx and b/docs/images/TestDriverComponent.pptx differ diff --git a/docs/images/UiComponent.png b/docs/images/UiComponent.png index 6c5e9a9cdeb..1f8ca422761 100644 Binary files a/docs/images/UiComponent.png and b/docs/images/UiComponent.png differ diff --git a/docs/images/UiComponent.pptx b/docs/images/UiComponent.pptx index 83a61f298b7..08165e8d97e 100644 Binary files a/docs/images/UiComponent.pptx and b/docs/images/UiComponent.pptx differ diff --git a/docs/images/dataTransferClasses.png b/docs/images/dataTransferClasses.png index 9e26ced80cf..b00b705d6b7 100644 Binary files a/docs/images/dataTransferClasses.png and b/docs/images/dataTransferClasses.png differ diff --git a/docs/images/dataTransferClasses.pptx b/docs/images/dataTransferClasses.pptx index f4e2bb371c4..9ce669b87a9 100644 Binary files a/docs/images/dataTransferClasses.pptx and b/docs/images/dataTransferClasses.pptx differ diff --git a/docs/images/highlevelArchitecture.png b/docs/images/highlevelArchitecture.png index eb3dcca8c86..b71d772c3db 100644 Binary files a/docs/images/highlevelArchitecture.png and b/docs/images/highlevelArchitecture.png differ diff --git a/docs/images/highlevelArchitecture.pptx b/docs/images/highlevelArchitecture.pptx index 172175c483c..8c2593037be 100644 Binary files a/docs/images/highlevelArchitecture.pptx and b/docs/images/highlevelArchitecture.pptx differ diff --git a/docs/images/packageDiagram.png b/docs/images/packageDiagram.png index 423121b0b84..dd2d100e7c2 100644 Binary files a/docs/images/packageDiagram.png and b/docs/images/packageDiagram.png differ diff --git a/docs/images/packageDiagram.pptx b/docs/images/packageDiagram.pptx index acd7eb81586..2b5c223c6a6 100644 Binary files a/docs/images/packageDiagram.pptx and b/docs/images/packageDiagram.pptx differ diff --git a/docs/issues.md b/docs/issues.md index 5508671d218..0c23c90dec4 100644 --- a/docs/issues.md +++ b/docs/issues.md @@ -17,18 +17,18 @@ Colors indicate which roles are involved in which states/transitions. This portion will only describe the purpose of each *label group* briefly. The full description of each individual label can be viewed under the [labels page](https://github.com/TEAMMATES/teammates/labels). -* **Status (`s.*`)**: Classifies issues and PRs based on **status** - * No `s.*` label and no other labels in issue: issue is yet to be triaged - * No `s.*` label and other labels present in issue: issue is accepted +Grouped Labels +* **Status (`s.*`)**: Classifies PRs based on **status** + * No `s.*` label: PR is yet to be triaged * **Category (`c.*`)**: Classifies issues and PRs based on **type of work done** * **Priority (`p.*`)**: Classifies issues based on **importance**, as determined by the project maintainers -* **Difficulty Level (`d.*`)**: Classifies issues based on **difficulty level** - * No `d.*` label: variable difficulty level, typically between `d.Contributors` and `d.Committers` level -* **Aspect (`a-*`)**: Classifies issues based on the **non-functional aspect** +* **Aspect (`a-*`)**: Classifies issues based on the **aspect** * No `a-*` label: no specific aspect tackled, usually the case for enhancements or new features -* **Feature (`f-*`)**: Classifies issues based on the **functional aspect** - * No `f-*` label: no specific feature tackled, usually the case for refactoring * **Technology (`t-*`)**: Classifies issues based on the **technology/tool stack** involved * No `t-*` label: usually documentation update, or mixture of many languages -* **Effort Estimate (`e.*`)**: Indicates the **estimated number of hours** needed to work on the issue - * `e.n`: `n` hours estimated effort, e.g. `e.1` is 1 hour, `e.2` is 2 hours, etc. + +Standalone Labels +* `enhancement`: Indicates new feature requests that have been accepted +* `good first issue`: Indicates a good issue for first-time contributors +* `help wanted`: Issues that should be tackled by project contributors +* `committers only`: Issues that should only be tackled by committers diff --git a/docs/overview.md b/docs/overview.md index 814ff8ad704..7d17fcbe73a 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -6,7 +6,9 @@ Biggest = many contributors, many users, relatively large code base (150k-200k LoC), evolving over a long period.
"Biggest" above also implies an exceptionally high quality standard because high quality is a necessity for the long-term survival of a big student project. -1. To become **a model and a training ground for Software Engineering students** who want to learn SE skills in the context of a non-trivial real software product. +2. To become **a model training ground for Software Engineering students** who want to learn SE skills in the context of a non-trivial real software product. + +3. To become the most flexible free peer feedback tool on the web. ## Challenges @@ -24,7 +26,7 @@ The project differs from typical student projects in the following areas, which ## Principles We apply these principles to meet the challenges stated above. -+ **We keep moving forward, always**: We release frequently, in weekly [time-boxed iterations](http://en.wikipedia.org/wiki/Timeboxing). Every week, our product becomes better than the previous week. This means "go back and rewrite from scratch" is only a last resort. ++ **We keep moving forward, always**: We release frequently, in [time-boxed iterations](http://en.wikipedia.org/wiki/Timeboxing). Every iteration, our product becomes better. This means "go back and rewrite from scratch" is only a last resort. + **We are agile**: We are able to change the system quickly and easily to match emerging requirements. We aim for **minimal yet sufficient documentation**. + **We defend our code with tests, fiercely**: Since we practice [collective code ownership](http://www.extremeprogramming.org/rules/collective.html), we have to make sure the code is not accidentally broken by others. We use fully automated regression testing. The testing automation level of this project is probably higher than 99% of the projects out there. + **We are "Gods" of the few tools we use**: We stick to a minimal toolset. Adding third-party tools and libraries to the project is done only if there is a STRONG justification. Only mature, stable, and well-supported tools are considered. Once selected, we should know the tool very well to get the best out of it. diff --git a/docs/process.md b/docs/process.md index a9122685e25..035a6b2d1ef 100644 --- a/docs/process.md +++ b/docs/process.md @@ -121,7 +121,7 @@ Make the changes to the code, tests, and documentations as needed by the issue. npm run lint ``` * **All affected tests are passing** on your dev server.
- You are more than welcome to also ensure *dev green*, i.e. all tests are passing on your dev server. + You are more than welcome to also ensure that all tests are passing on your dev server. * **Staging-tested (if need be)**: If your new code might behave differently on a remote server than how it behaves on the dev server, ensure that the affected tests are passing against the updated app running on your own GAE staging server. * **No unrelated changes** are introduced in the branch. This includes unnecessary formatting changes. @@ -216,7 +216,7 @@ Your work on the issue is done when your PR is successfully merged to the main r [GitHub's review feature](https://github.com/blog/2256-a-whole-new-github-universe-announcing-new-tools-forums-and-features#code-better-with-reviews) is to be used in this task. -* Ensure that the Travis CI build is successful and the developer has local dev green. +* Ensure that the Travis CI build is successful. * Ensure the following: * Naming conventions for PR and branch are followed, and `Fixes #....` or similar keyword is present in the PR description. * The items in [this list](#things-to-check) are all satisfied. diff --git a/docs/troubleshooting-guide.md b/docs/troubleshooting-guide.md index 6acca689ca9..da311004b30 100644 --- a/docs/troubleshooting-guide.md +++ b/docs/troubleshooting-guide.md @@ -24,7 +24,7 @@ Note that some of the screenshots might be outdated, but the instructions will r ### Common test errors and solutions -* **ERROR**: Encountered `java.net.ConnectException: Connection refused` when running some tests. +* **ERROR**: Encountered `java.net.ConnectException: Connection refused` when running E2E tests. **SOLUTION**: Ensure that your dev server is started prior to running those tests. @@ -52,10 +52,6 @@ Note that some of the screenshots might be outdated, but the instructions will r **SOLUTION**: Ensure that the text file encoding for your workspace has been set to `UTF-8` as specified under [Setting up guide](setting-up.md). -* **ERROR**: `InstructorCourseDetailsPageUiTest` fails in production server due to Gmail's access restriction (e.g `javax.mail.AuthenticationFailedException`) - - **SOLUTION**: ["Allow access for less secure apps"](https://support.google.com/accounts/answer/6010255?hl=en) for the accounts used in that particular test. As doing so will leave the accounts more vulnerable to security issues, it is strongly recommended that the access is revoked after the test passes. - * **ERROR (on Linux)**: `java.io.IOException: Directory "/tmpfiles" could not be created`. **SOLUTION**: Add `-Djava.io.tmpdir=/path/to/teammates/tmp` for the tests' run configurations. The "tmp" folder in the specified directory needs to be created before running the tests. diff --git a/jest-setup.ts b/jest-setup.ts new file mode 100644 index 00000000000..15b23c00881 --- /dev/null +++ b/jest-setup.ts @@ -0,0 +1,7 @@ +require('core-js/es/reflect'); +require('core-js/proposals/reflect-metadata'); + +(window as any).IntersectionObserver = jest.fn(() => ({ + observe: jest.fn(), + unobserve: jest.fn(), +})); diff --git a/jest.config.js b/jest.config.js index 60802aa07d3..5a626624762 100644 --- a/jest.config.js +++ b/jest.config.js @@ -7,4 +7,7 @@ module.exports = { ], coverageDirectory: './coverage', coverageReporters: ['lcov', 'text-summary'], + setupFiles: [ + './jest-setup.ts', + ], }; diff --git a/ngsw-config.json b/ngsw-config.json index cb4bcd707d1..f73605c33f7 100644 --- a/ngsw-config.json +++ b/ngsw-config.json @@ -10,8 +10,7 @@ "/assets/icons/**", "/index.html", "/manifest.webmanifest", - "/*.css", - "/*.js" + "/*.css" ] } }, { @@ -21,6 +20,7 @@ "resources": { "files": [ "/assets/**", + "/*.js", "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)" ] } diff --git a/package-lock.json b/package-lock.json index 7433c75f096..9965047543b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1462,11 +1462,6 @@ "tslib": "^1.8.1" } }, - "@fortawesome/fontawesome-free": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.13.1.tgz", - "integrity": "sha512-D819f34FLHeBN/4xvw0HR0u7U2G7RqjPSggXqf7LktsxWQ48VAfGwvMrhcVuaZV2fF069c/619RdgCCms0DHhw==" - }, "@handsontable/angular": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@handsontable/angular/-/angular-5.1.1.tgz", @@ -3487,11 +3482,6 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", "dev": true }, - "bootstrap": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.0.tgz", - "integrity": "sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA==" - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -7587,6 +7577,11 @@ "ipaddr.js": "^1.9.0" } }, + "intersection-observer": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/intersection-observer/-/intersection-observer-0.11.0.tgz", + "integrity": "sha512-KZArj2QVnmdud9zTpKf279m2bbGfG+4/kn16UU0NL3pTVl52ZHiJ9IRNSsnn6jaHrL9EGLFM5eWjTx2fz/+zoQ==" + }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -11169,19 +11164,20 @@ "resolved": "https://registry.npmjs.org/ng-dynamic-component/-/ng-dynamic-component-6.1.0.tgz", "integrity": "sha512-h+j2xfbAwRkybjmx7I0jO+7f/MGkF/WwEqO7qudQwGAVF81Xw5LVfgZ8hTKTXPA+CeCS+3I/Rl99GFRhj0TYwA==" }, + "ng-in-viewport": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/ng-in-viewport/-/ng-in-viewport-6.1.3.tgz", + "integrity": "sha512-REU59ZZE3er08obKvTpGN1B3/OTZ9TSRK7W6Yl6wC694FMfKW8YZrJo7ktoMw6cF13tegLoB/ojEPGruJ07EUA==", + "requires": { + "intersection-observer": ">=0.11.0", + "tslib": ">=1.9.0" + } + }, "ngx-captcha": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/ngx-captcha/-/ngx-captcha-8.0.1.tgz", "integrity": "sha512-YPRaHOwegkCU0+F/g9kI/xR6B6IEoqSZVUdgd84xNEEFEhM5PfdWY+xHc0dj75epriGAlquWA+NtpIRynxIFRg==" }, - "ngx-clipboard": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/ngx-clipboard/-/ngx-clipboard-13.0.1.tgz", - "integrity": "sha512-e7QBsw7bX5ajhVR2++NAaYZYw90hKeEBlb006TW85WDUA3kmlrXpMDwOvVJuRewU6Nh+U1QiQMJq5a0ivk0zWg==", - "requires": { - "ngx-window-token": ">=3.0.0" - } - }, "ngx-image-cropper": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/ngx-image-cropper/-/ngx-image-cropper-1.5.1.tgz", @@ -11195,11 +11191,6 @@ "resolved": "https://registry.npmjs.org/ngx-page-scroll-core/-/ngx-page-scroll-core-7.0.1.tgz", "integrity": "sha512-nWe2X8H23xItcGr+gvizLafErQyajQJtVAW50wPlBb5Xr9LVAjpv5uYwYp508N5c4YUdRu9IRX0rkKvrjrJv4w==" }, - "ngx-window-token": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ngx-window-token/-/ngx-window-token-3.0.0.tgz", - "integrity": "sha512-MDVIQB2SqFCbpoTqEXhO2529hsvpCYyw/iogjU6uskKqUKh79XVKWSMpRH9S1yTr0Ucgh8nFeNcpv2DnFdikJA==" - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -16225,11 +16216,6 @@ "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" }, - "tinymce": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-5.2.2.tgz", - "integrity": "sha512-G1KZOxHIrokeP/rhJuvwctmeAuHDAeH8AI1ubnVcdMZtmC6mUh3SfESqFJrFWoiF143OUMC61GkVhi920pIP0A==" - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", diff --git a/package.json b/package.json index c5a0df03603..81d4e12fed6 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "test": "ng test --watch", "coverage": "rimraf coverage && ng test --coverage", "lint:ts": "ng lint --tslint-config static-analysis/teammates-tslint.yml", - "lint:json": "jsonlint-cli src/web/**/*.json src/main/resources/*.json src/test/resources/data/*.json", - "lint:css": "stylelint \"src/web/**/*.scss\" \"src/web/**/*.html\" --config static-analysis/teammates-stylelint.yml", + "lint:json": "jsonlint-cli ./*.json src/web/**/*.json src/main/resources/*.json src/test/resources/data/*.json", + "lint:css": "stylelint \"src/web/**/*.css\" \"src/web/**/*.scss\" \"src/web/**/*.html\" --config static-analysis/teammates-stylelint.yml", "lint:spaces": "lintspaces -n -t -d spaces -l 1 -. \"src/main/**/*.html\" \"src/web/**/*.html\" \"src/**/*.xml\" \"src/**/*.json\" \"src/**/*.properties\" \"*.yml\" \"*.json\" \"*.gradle\" \"static-analysis/*.*ml\"", "lint": "npm-run-all lint:* -c" }, @@ -27,23 +27,21 @@ "@angular/pwa": "~0.901.9", "@angular/router": "~9.1.11", "@angular/service-worker": "~9.1.11", - "@fortawesome/fontawesome-free": "^5.13.1", "@handsontable/angular": "^5.1.1", "@ng-bootstrap/ng-bootstrap": "^6.1.0", "@tinymce/tinymce-angular": "^3.6.0", - "bootstrap": "^4.5.0", "classlist.js": "^1.1.20150312", "d3": "^5.16.0", "file-saver": "^2.0.2", "handsontable": "^7.4.2", + "intersection-observer": "^0.11.0", "moment-timezone": "^0.5.31", "ng-dynamic-component": "^6.1.0", + "ng-in-viewport": "^6.1.3", "ngx-captcha": "^8.0.1", - "ngx-clipboard": "^13.0.1", "ngx-image-cropper": "^1.5.1", "ngx-page-scroll-core": "^7.0.1", "rxjs": "~6.5.5", - "tinymce": "~5.2.2", "topojson": "^3.0.2", "tslib": "^1.13.0", "ua-parser-js": "^0.7.21", diff --git a/src/client/java/teammates/client/scripts/DataBundleRegenerator.java b/src/client/java/teammates/client/scripts/DataBundleRegenerator.java index 5b9dafc2d1b..452f84473f0 100644 --- a/src/client/java/teammates/client/scripts/DataBundleRegenerator.java +++ b/src/client/java/teammates/client/scripts/DataBundleRegenerator.java @@ -10,7 +10,7 @@ import teammates.common.datatransfer.DataBundle; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.JsonUtils; -import teammates.test.driver.FileHelper; +import teammates.test.FileHelper; /** * Regenerates all JSON data files used for different purposes. diff --git a/src/client/java/teammates/client/scripts/DataMigrationEntitiesBaseScript.java b/src/client/java/teammates/client/scripts/DataMigrationEntitiesBaseScript.java index 1030c550123..80f7d07f217 100644 --- a/src/client/java/teammates/client/scripts/DataMigrationEntitiesBaseScript.java +++ b/src/client/java/teammates/client/scripts/DataMigrationEntitiesBaseScript.java @@ -19,7 +19,7 @@ import teammates.client.remoteapi.RemoteApiClient; import teammates.storage.entity.BaseEntity; -import teammates.test.driver.FileHelper; +import teammates.test.FileHelper; /** * Base script to be used as a template for all data migration scripts. diff --git a/src/client/java/teammates/client/scripts/statistics/FileStore.java b/src/client/java/teammates/client/scripts/statistics/FileStore.java index ff7979efcbf..107461cd6ad 100644 --- a/src/client/java/teammates/client/scripts/statistics/FileStore.java +++ b/src/client/java/teammates/client/scripts/statistics/FileStore.java @@ -32,7 +32,7 @@ import teammates.common.util.Config; import teammates.common.util.StringHelper; -import teammates.test.driver.FileHelper; +import teammates.test.FileHelper; /** * File storage service that saves stats/cache to encrypted/unencrypted files. diff --git a/src/client/java/teammates/client/util/ClientProperties.java b/src/client/java/teammates/client/util/ClientProperties.java index 63db46d464d..b6d89124694 100644 --- a/src/client/java/teammates/client/util/ClientProperties.java +++ b/src/client/java/teammates/client/util/ClientProperties.java @@ -6,7 +6,7 @@ import java.nio.file.Paths; import java.util.Properties; -import teammates.common.util.Url; +import teammates.common.util.UrlExtension; /** * Represents properties in client.properties file. @@ -23,7 +23,7 @@ public final class ClientProperties { prop.load(testPropStream); } - TARGET_URL = Url.trimTrailingSlash(prop.getProperty("client.target.url")); + TARGET_URL = UrlExtension.trimTrailingSlash(prop.getProperty("client.target.url")); } catch (IOException e) { throw new RuntimeException(e); diff --git a/src/client/resources/client.template.properties b/src/client/resources/client.template.properties index b8a87a5157c..5f2c22d44ed 100644 --- a/src/client/resources/client.template.properties +++ b/src/client/resources/client.template.properties @@ -6,6 +6,6 @@ # This is the url of the app the script will run against. # e.g. client.target.url=http\://localhost\:8080 -# e.g. client.target.url=https\://6-0-0-dot-teammates-john.appspot.com +# e.g. client.target.url=https\://7-0-0-dot-teammates-john.appspot.com # Note: the '.' in the url has been replaced by -dot- to support https connection for the staging server. client.target.url=http\://localhost\:8080 diff --git a/src/e2e/java/teammates/e2e/cases/BaseTestCaseWithBackDoorApiAccess.java b/src/e2e/java/teammates/e2e/cases/BaseTestCaseWithBackDoorApiAccess.java index 4bb687de61d..46bef5341f1 100644 --- a/src/e2e/java/teammates/e2e/cases/BaseTestCaseWithBackDoorApiAccess.java +++ b/src/e2e/java/teammates/e2e/cases/BaseTestCaseWithBackDoorApiAccess.java @@ -17,8 +17,8 @@ import teammates.common.util.retry.RetryableTaskReturns; import teammates.e2e.util.BackDoor; import teammates.e2e.util.TestProperties; -import teammates.test.cases.BaseTestCaseWithDatastoreAccess; -import teammates.ui.webapi.output.CourseData; +import teammates.test.BaseTestCaseWithDatastoreAccess; +import teammates.ui.output.CourseData; /** * Base class for all test cases which are allowed to access the Datastore via {@link BackDoor}. @@ -56,7 +56,7 @@ protected RetryManager getPersistenceRetryManager() { } protected AccountAttributes getAccount(String googleId) { - return null; // BackDoor.getAccount(googleId); + return BackDoor.getAccount(googleId); } @Override @@ -109,7 +109,7 @@ protected boolean isCourseInRecycleBin(String courseId) { } protected FeedbackQuestionAttributes getFeedbackQuestion(String courseId, String feedbackSessionName, int qnNumber) { - return null; // BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, qnNumber); + return BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, qnNumber); } @Override @@ -129,18 +129,26 @@ public FeedbackQuestionAttributes run() { }); } + protected FeedbackResponseCommentAttributes getFeedbackResponseComment(String feedbackResponseId) { + return BackDoor.getFeedbackResponseComment(feedbackResponseId); + } + @Override protected FeedbackResponseCommentAttributes getFeedbackResponseComment(FeedbackResponseCommentAttributes frc) { - throw new UnsupportedOperationException("Method not used"); + return getFeedbackResponseComment(frc.feedbackResponseId); + } + + protected FeedbackResponseAttributes getFeedbackResponse(String feedbackQuestionId, String giver, String recipient) { + return BackDoor.getFeedbackResponse(feedbackQuestionId, giver, recipient); } @Override protected FeedbackResponseAttributes getFeedbackResponse(FeedbackResponseAttributes fr) { - return null; // BackDoor.getFeedbackResponse(fr.feedbackQuestionId, fr.giver, fr.recipient); + return getFeedbackResponse(fr.feedbackQuestionId, fr.giver, fr.recipient); } protected FeedbackSessionAttributes getFeedbackSession(String courseId, String feedbackSessionName) { - return null; // BackDoor.getFeedbackSession(courseId, feedbackSessionName); + return BackDoor.getFeedbackSession(courseId, feedbackSessionName); } @Override @@ -159,6 +167,10 @@ public FeedbackSessionAttributes run() { }); } + protected FeedbackSessionAttributes getSoftDeletedSession(String feedbackSessionName, String instructorId) { + return BackDoor.getSoftDeletedSession(feedbackSessionName, instructorId); + } + protected InstructorAttributes getInstructor(String courseId, String instructorEmail) { return BackDoor.getInstructor(courseId, instructorEmail); } @@ -179,7 +191,7 @@ public InstructorAttributes run() { } protected String getKeyForInstructor(String courseId, String instructorEmail) { - return null; // BackDoor.getEncryptedKeyForInstructor(courseId, instructorEmail); + return getInstructor(courseId, instructorEmail).getKey(); } protected String getKeyForInstructorWithRetry(String courseId, String instructorEmail) @@ -202,6 +214,10 @@ protected StudentAttributes getStudent(StudentAttributes student) { return BackDoor.getStudent(student.course, student.email); } + protected String getKeyForStudent(StudentAttributes student) { + return getStudent(student).getKey(); + } + @Override protected String doRemoveAndRestoreDataBundle(DataBundle testData) throws HttpRequestFailedException { return BackDoor.removeAndRestoreDataBundle(testData); diff --git a/src/e2e/java/teammates/e2e/cases/e2e/AdminAccountsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/AdminAccountsPageE2ETest.java new file mode 100644 index 00000000000..c68ceb6df7b --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/AdminAccountsPageE2ETest.java @@ -0,0 +1,93 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.AccountAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AdminAccountsPage; + +/** + * SUT: {@link Const.WebPageURIs#ADMIN_ACCOUNTS_PAGE}. + */ +public class AdminAccountsPageE2ETest extends BaseE2ETestCase { + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/AdminAccountsPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + } + + @Test + public void testAll() { + + String googleId = "AAMgtE2eT.instr2"; + + ______TS("verify loaded data"); + + AppUrl accountsPageUrl = createUrl(Const.WebPageURIs.ADMIN_ACCOUNTS_PAGE) + .withParam(Const.ParamsNames.INSTRUCTOR_ID, googleId); + AdminAccountsPage accountsPage = loginAdminToPage(accountsPageUrl, AdminAccountsPage.class); + + AccountAttributes account = getAccount(googleId); + accountsPage.verifyAccountDetails(account); + + ______TS("action: remove instructor from course"); + + InstructorAttributes instructor = testData.instructors.get("AAMgtE2eT.instr2-AAMgtE2eT.CS2103"); + String courseId = instructor.courseId; + + verifyPresentInDatastore(instructor); + accountsPage.clickRemoveInstructorFromCourse(courseId); + accountsPage.verifyStatusMessage("Instructor is successfully deleted from course \"" + courseId + "\""); + verifyAbsentInDatastore(instructor); + + ______TS("action: remove student from course"); + + StudentAttributes student = testData.students.get("AAMgtE2eT.instr2-student-CS2103"); + courseId = student.course; + + verifyPresentInDatastore(student); + accountsPage.clickRemoveStudentFromCourse(courseId); + accountsPage.verifyStatusMessage("Student is successfully deleted from course \"" + courseId + "\""); + verifyAbsentInDatastore(student); + + ______TS("action: downgrade instructor account"); + + InstructorAttributes instructor2 = testData.instructors.get("AAMgtE2eT.instr2-AAMgtE2eT.CS2104"); + InstructorAttributes instructor3 = testData.instructors.get("AAMgtE2eT.instr2-AAMgtE2eT.CS1101"); + verifyPresentInDatastore(instructor2); + verifyPresentInDatastore(instructor3); + + accountsPage.clickDowngradeAccount(); + accountsPage.verifyStatusMessage("Instructor account is successfully downgraded to student."); + + account = getAccount(googleId); + assertFalse(account.isInstructor); + accountsPage.verifyAccountDetails(account); + + // instructor entities should also be deleted + verifyAbsentInDatastore(instructor2); + verifyAbsentInDatastore(instructor3); + + ______TS("action: delete account entirely"); + + StudentAttributes student2 = testData.students.get("AAMgtE2eT.instr2-student-CS2104"); + StudentAttributes student3 = testData.students.get("AAMgtE2eT.instr2-student-CS1101"); + verifyPresentInDatastore(student2); + verifyPresentInDatastore(student3); + + accountsPage.clickDeleteAccount(); + accountsPage.verifyStatusMessage("Account \"" + googleId + "\" is successfully deleted."); + + verifyAbsentInDatastore(account); + + // student entities should be deleted + verifyAbsentInDatastore(student2); + verifyAbsentInDatastore(student3); + + } + +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/AdminSearchPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/AdminSearchPageE2ETest.java index bcf4bee21c1..b3fde4682f6 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/AdminSearchPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/AdminSearchPageE2ETest.java @@ -12,9 +12,7 @@ import teammates.common.util.AppUrl; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.e2e.pageobjects.AdminHomePage; import teammates.e2e.pageobjects.AdminSearchPage; -import teammates.e2e.pageobjects.AppPage; /** * SUT: {@link Const.WebPageURIs#ADMIN_SEARCH_PAGE}. @@ -32,10 +30,8 @@ protected void prepareTestData() { @Test public void allTests() { AppUrl url = createUrl(Const.WebPageURIs.ADMIN_SEARCH_PAGE); - loginAdminToPage(url, AdminHomePage.class); - searchPage = AppPage.getNewPageInstance(browser, url, AdminSearchPage.class); + searchPage = loginAdminToPage(url, AdminSearchPage.class); - searchPage.waitForPageToLoad(); StudentAttributes student = testData.students.get("student1InCourse1"); AccountAttributes studentAccount = testData.accounts.get("student1InCourse1"); InstructorAttributes instructor = testData.instructors.get("instructor1OfCourse1"); @@ -129,7 +125,7 @@ private String getExpectedStudentHomePageLink(StudentAttributes student) { private String getExpectedStudentManageAccountLink(StudentAttributes student) { return student.isRegistered() ? createUrl(Const.WebPageURIs.ADMIN_ACCOUNTS_PAGE) - .withInstructorId(student.googleId) + .withParam(Const.ParamsNames.INSTRUCTOR_ID, student.googleId) .toAbsoluteString() : ""; } @@ -196,7 +192,7 @@ private String getExpectedInstructorHomePageLink(InstructorAttributes instructor private String getExpectedInstructorManageAccountLink(InstructorAttributes instructor) { String googleId = instructor.isRegistered() ? instructor.googleId : ""; return createUrl(Const.WebPageURIs.ADMIN_ACCOUNTS_PAGE) - .withInstructorId(googleId) + .withParam(Const.ParamsNames.INSTRUCTOR_ID, googleId) .toAbsoluteString(); } @@ -231,6 +227,8 @@ private void verifyLinkExpansionButtons(StudentAttributes student, InstructorAtt searchPage.clickExpandInstructorLinks(); searchPage.clickCollapseStudentLinks(); + searchPage.waitUntilAnimationFinish(); + numExpandedStudentRows = searchPage.getNumExpandedRows(studentRow); numExpandedInstructorRows = searchPage.getNumExpandedRows(instructorRow); assertEquals(numExpandedStudentRows, 0); diff --git a/src/e2e/java/teammates/e2e/cases/e2e/AdminSessionsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/AdminSessionsPageE2ETest.java new file mode 100644 index 00000000000..b6345b2f8cb --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/AdminSessionsPageE2ETest.java @@ -0,0 +1,139 @@ +package teammates.e2e.cases.e2e; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.common.util.TimeHelper; +import teammates.e2e.pageobjects.AdminSessionsPage; + +/** + * SUT: {@link Const.WebPageURIs#ADMIN_SESSIONS_PAGE}. + */ +public class AdminSessionsPageE2ETest extends BaseE2ETestCase { + private FeedbackSessionAttributes openFeedbackSession; + private FeedbackSessionAttributes awaitingFeedbackSession; + private FeedbackSessionAttributes futureFeedbackSession; + private Instant instant3DaysAgo = TimeHelper.getInstantDaysOffsetFromNow(-3); + private Instant instantTomorrow = TimeHelper.getInstantDaysOffsetFromNow(1); + private Instant instant3DaysLater = TimeHelper.getInstantDaysOffsetFromNow(3); + private Instant instantNextWeek = TimeHelper.getInstantDaysOffsetFromNow(7); + private Instant instant10DaysLater = TimeHelper.getInstantDaysOffsetFromNow(10); + private Instant instant14DaysLater = TimeHelper.getInstantDaysOffsetFromNow(14); + private Instant instant24DaysLater = TimeHelper.getInstantDaysOffsetFromNow(24); + + private String formatDateTime(Instant instant, String timeZone) { + return DateTimeFormatter + .ofPattern("EEE, dd MMM YYYY, hh:mm a") + .format(instant.atZone(ZoneId.of(timeZone))) + .replaceFirst(" AM$", " am") + .replaceFirst(" PM$", " pm"); + } + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/AdminSessionsPageE2ETest.json"); + + // To guarantee that there will always be some "ongoing sessions" listed, + // the test data is injected with date/time values relative to the time where the test takes place + + openFeedbackSession = testData.feedbackSessions.get("session1InCourse1"); + openFeedbackSession.setStartTime(instant3DaysAgo); + openFeedbackSession.setCreatedTime(instant3DaysAgo); + openFeedbackSession.setSessionVisibleFromTime(instant3DaysAgo); + openFeedbackSession.setEndTime(instant3DaysLater); + openFeedbackSession.setResultsVisibleFromTime(instant3DaysLater); + + awaitingFeedbackSession = testData.feedbackSessions.get("session2InCourse1"); + awaitingFeedbackSession.setStartTime(instantTomorrow); + awaitingFeedbackSession.setCreatedTime(instant3DaysAgo); + awaitingFeedbackSession.setSessionVisibleFromTime(instantTomorrow); + awaitingFeedbackSession.setEndTime(instant3DaysLater); + awaitingFeedbackSession.setResultsVisibleFromTime(instant3DaysLater); + + futureFeedbackSession = testData.feedbackSessions.get("session3InCourse1"); + futureFeedbackSession.setStartTime(instant10DaysLater); + futureFeedbackSession.setCreatedTime(instant3DaysAgo); + futureFeedbackSession.setSessionVisibleFromTime(instant10DaysLater); + futureFeedbackSession.setEndTime(instant24DaysLater); + futureFeedbackSession.setResultsVisibleFromTime(instant24DaysLater); + + removeAndRestoreDataBundle(testData); + } + + @Test + public void testAll() { + + ______TS("verify loaded data"); + + AppUrl sessionsUrl = createUrl(Const.WebPageURIs.ADMIN_SESSIONS_PAGE); + AdminSessionsPage sessionsPage = loginAdminToPage(sessionsUrl, AdminSessionsPage.class); + sessionsPage.waitUntilAnimationFinish(); + + String tableTimezone = sessionsPage.getSessionsTableTimezone(); + + String[] openSessionCells = { + "[Opened]", + String.format("[%s] %s", openFeedbackSession.getCourseId(), + openFeedbackSession.getFeedbackSessionName()), + "Show", + formatDateTime(instant3DaysAgo, tableTimezone), + formatDateTime(instant3DaysLater, tableTimezone), + openFeedbackSession.getCreatorEmail(), + }; + + String[] awaitingSessionCells = { + "[Waiting To Open]", + String.format("[%s] %s", awaitingFeedbackSession.getCourseId(), + awaitingFeedbackSession.getFeedbackSessionName()), + "Show", + formatDateTime(instantTomorrow, tableTimezone), + formatDateTime(instant3DaysLater, tableTimezone), + awaitingFeedbackSession.getCreatorEmail(), + }; + + String[] futureSessionCells = { + "[Waiting To Open]", + String.format("[%s] %s", futureFeedbackSession.getCourseId(), + futureFeedbackSession.getFeedbackSessionName()), + "Show", + formatDateTime(instant10DaysLater, tableTimezone), + formatDateTime(instant24DaysLater, tableTimezone), + futureFeedbackSession.getCreatorEmail(), + }; + + String[][] sessionsCells = { + openSessionCells, awaitingSessionCells, futureSessionCells, + }; + + // Open and awaiting session should be displayed with the appropriate status + // Future session should not be displayed yet + + boolean[] expectedSessionShownStatus = { true, true, false }; + + sessionsPage.verifySessionRows(sessionsCells, expectedSessionShownStatus); + + ______TS("query future session"); + + sessionsPage.toggleSessionFilter(); + sessionsPage.waitForSessionFilterVisibility(); + + sessionsPage.setFilterStartDate(instantNextWeek); + sessionsPage.setFilterEndDate(instant14DaysLater); + sessionsPage.filterSessions(); + + // This time, only future session should be displayed + // The previous open and awaiting session would have closed by this date + + expectedSessionShownStatus = new boolean[] { false, false, true }; + + sessionsPage.verifySessionRows(sessionsCells, expectedSessionShownStatus); + + } + +} diff --git a/src/test/java/teammates/test/cases/browsertests/AutomatedSessionRemindersTest.java b/src/e2e/java/teammates/e2e/cases/e2e/AutomatedSessionRemindersTest.java similarity index 66% rename from src/test/java/teammates/test/cases/browsertests/AutomatedSessionRemindersTest.java rename to src/e2e/java/teammates/e2e/cases/e2e/AutomatedSessionRemindersTest.java index d6c3f9af080..425d32f5a1c 100644 --- a/src/test/java/teammates/test/cases/browsertests/AutomatedSessionRemindersTest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/AutomatedSessionRemindersTest.java @@ -1,16 +1,14 @@ -package teammates.test.cases.browsertests; +package teammates.e2e.cases.e2e; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.AppUrl; -import teammates.common.util.Config; import teammates.common.util.Const; import teammates.common.util.TimeHelper; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.test.driver.TimeHelperExtension; -import teammates.test.pageobjects.GenericAppPage; +import teammates.common.util.TimeHelperExtension; +import teammates.e2e.pageobjects.GenericAppPage; +import teammates.e2e.util.TestProperties; /** * SUT: {@link Const.CronJobURIs#AUTOMATED_FEEDBACK_OPENING_REMINDERS}, @@ -18,27 +16,25 @@ * {@link Const.CronJobURIs#AUTOMATED_FEEDBACK_CLOSED_REMINDERS}, * {@link Const.CronJobURIs#AUTOMATED_FEEDBACK_PUBLISHED_REMINDERS}. */ -@Priority(5) public class AutomatedSessionRemindersTest extends BaseE2ETestCase { @Override protected void prepareTestData() { testData = loadDataBundle("/AutomatedSessionRemindersTest.json"); - /* - * In this test, we set the email address of the accounts to be the same as the - * support email address. When running the test against a production server, - * email alerts will be sent to the specified support email address. - * The tester should manually check the email box after running the test suite. - */ - - testData.accounts.get("instructorWithEvals").email = Config.SUPPORT_EMAIL; - testData.instructors.get("AutSessRem.instructor").email = Config.SUPPORT_EMAIL; - testData.students.get("alice.tmms@AutSessRem.course").email = Config.SUPPORT_EMAIL; - testData.feedbackSessions.get("closedSession").setCreatorEmail(Config.SUPPORT_EMAIL); - testData.feedbackSessions.get("closingSession").setCreatorEmail(Config.SUPPORT_EMAIL); - testData.feedbackSessions.get("openingSession").setCreatorEmail(Config.SUPPORT_EMAIL); - testData.feedbackSessions.get("publishedSession").setCreatorEmail(Config.SUPPORT_EMAIL); + // When running the test against a production server, email alerts will be sent + // to the specified email address + // The tester should manually check the email box after running the test suite + // TODO check if we can automate this checking process + + String student1Email = TestProperties.TEST_STUDENT1_ACCOUNT + "@gmail.com"; + testData.accounts.get("instructorWithEvals").email = student1Email; + testData.instructors.get("AutSessRem.instructor").email = student1Email; + testData.students.get("alice.tmms@AutSessRem.course").email = student1Email; + testData.feedbackSessions.get("closedSession").setCreatorEmail(student1Email); + testData.feedbackSessions.get("closingSession").setCreatorEmail(student1Email); + testData.feedbackSessions.get("openingSession").setCreatorEmail(student1Email); + testData.feedbackSessions.get("publishedSession").setCreatorEmail(student1Email); // Set closing time of one feedback session to tomorrow FeedbackSessionAttributes closingFeedbackSession = testData.feedbackSessions.get("closingSession"); @@ -52,33 +48,37 @@ protected void prepareTestData() { FeedbackSessionAttributes openingFeedbackSession = testData.feedbackSessions.get("openingSession"); openingFeedbackSession.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); - //Published time for one feedback session already set to some time in the past. + // Published time for one feedback session already set to some time in the past. removeAndRestoreDataBundle(testData); } + // In all the tests, we need to explicitly log in as admin + // because the cron job URLs are additionally protected by admin constraint in web.xml + // and adding backdoor key is not sufficient to bypass it + @Test public void testFeedbackSessionOpeningReminders() { AppUrl openingRemindersUrl = createUrl(Const.CronJobURIs.AUTOMATED_FEEDBACK_OPENING_REMINDERS); - loginAdminToPageOld(openingRemindersUrl, GenericAppPage.class); + loginAdminToPage(openingRemindersUrl, GenericAppPage.class); } @Test public void testFeedbackSessionClosingReminders() { AppUrl closingRemindersUrl = createUrl(Const.CronJobURIs.AUTOMATED_FEEDBACK_CLOSING_REMINDERS); - loginAdminToPageOld(closingRemindersUrl, GenericAppPage.class); + loginAdminToPage(closingRemindersUrl, GenericAppPage.class); } @Test public void testFeedbackSessionClosedReminders() { AppUrl closedRemindersUrl = createUrl(Const.CronJobURIs.AUTOMATED_FEEDBACK_CLOSED_REMINDERS); - loginAdminToPageOld(closedRemindersUrl, GenericAppPage.class); + loginAdminToPage(closedRemindersUrl, GenericAppPage.class); } @Test public void testFeedbackSessionPublishedReminders() { AppUrl publishedRemindersUrl = createUrl(Const.CronJobURIs.AUTOMATED_FEEDBACK_PUBLISHED_REMINDERS); - loginAdminToPageOld(publishedRemindersUrl, GenericAppPage.class); + loginAdminToPage(publishedRemindersUrl, GenericAppPage.class); } } diff --git a/src/e2e/java/teammates/e2e/cases/e2e/BaseE2ETestCase.java b/src/e2e/java/teammates/e2e/cases/e2e/BaseE2ETestCase.java index a7cbd00c765..29ceec828ba 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/BaseE2ETestCase.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/BaseE2ETestCase.java @@ -2,22 +2,29 @@ import java.io.File; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import org.testng.ITestContext; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import teammates.common.datatransfer.DataBundle; import teammates.common.util.AppUrl; import teammates.common.util.Const; +import teammates.common.util.ThreadHelper; import teammates.common.util.Url; import teammates.e2e.cases.BaseTestCaseWithBackDoorApiAccess; import teammates.e2e.pageobjects.AdminHomePage; import teammates.e2e.pageobjects.AppPage; import teammates.e2e.pageobjects.Browser; -import teammates.e2e.pageobjects.BrowserPool; +import teammates.e2e.pageobjects.DevServerLoginPage; import teammates.e2e.pageobjects.HomePage; import teammates.e2e.pageobjects.LoginPage; +import teammates.e2e.util.EmailAccount; import teammates.e2e.util.TestProperties; +import teammates.test.FileHelper; /** * Base class for all browser tests. @@ -37,7 +44,7 @@ public void baseClassSetup() throws Exception { } protected void prepareBrowser() { - browser = BrowserPool.getBrowser(); + browser = new Browser(); } protected abstract void prepareTestData() throws Exception; @@ -47,16 +54,25 @@ protected String getTestDataFolder() { return TestProperties.TEST_DATA_FOLDER; } - @AfterClass(alwaysRun = true) - public void baseClassTearDown() { - releaseBrowser(); + protected String getTestDownloadsFolder() { + return TestProperties.TEST_DOWNLOADS_FOLDER; } - protected void releaseBrowser() { + @AfterClass + public void baseClassTearDown(ITestContext context) { + boolean isSuccess = context.getFailedTests().getAllMethods() + .stream() + .noneMatch(method -> method.getConstructorOrMethod().getMethod().getDeclaringClass() == this.getClass()); + releaseBrowser(isSuccess); + } + + protected void releaseBrowser(boolean isSuccess) { if (browser == null) { return; } - BrowserPool.release(browser); + if (isSuccess || TestProperties.CLOSE_BROWSER_ON_FAILURE) { + browser.driver.close(); + } } /** @@ -82,19 +98,24 @@ protected static Url createLocalUrl(String testFileName) throws IOException { * Logs in a page using admin credentials (i.e. in masquerade mode). */ protected T loginAdminToPage(AppUrl url, Class typeOfPage) { + // When not using dev server, Google blocks log in by automation. + // To log in, log in manually to teammates in your browser before running e2e tests. + // Refer to teammates.e2e.pageobjects.Browser for more information. + if (!TestProperties.isDevServer()) { + // skip login and navigate to the desired page. + return AppPage.getNewPageInstance(browser, url, typeOfPage); + } if (browser.isAdminLoggedIn) { - browser.driver.get(url.toAbsoluteString()); try { - return AppPage.getNewPageInstance(browser, typeOfPage); + return AppPage.getNewPageInstance(browser, url, typeOfPage); } catch (Exception e) { //ignore and try to logout and login again if fail. - ignorePossibleException(); } } // logout and attempt to load the requested URL. This will be - // redirected to a dev-server/google login page + // redirected to a dev-server login page logout(); browser.driver.get(url.toAbsoluteString()); @@ -103,27 +124,16 @@ protected T loginAdminToPage(AppUrl url, Class typeOfPage String userId = url.get(Const.ParamsNames.USER_ID); - if (TestProperties.isDevServer() && userId != null) { + if (userId != null) { // This workaround is necessary because the front-end has not been optimized // to enable masquerade mode yet adminUsername = userId; } - // login based on the login page type - LoginPage loginPage = AppPage.createCorrectLoginPageType(browser); + LoginPage loginPage = AppPage.getNewPageInstance(browser, DevServerLoginPage.class); loginPage.loginAsAdmin(adminUsername, adminPassword); - // After login, the browser should be redirected to the page requested originally. - // No need to reload. In fact, reloading might results in duplicate request to the server. - return AppPage.getNewPageInstance(browser, typeOfPage); - } - - /** - * TODO legacy method to be removed after migration of UI tests. - */ - @Deprecated - protected T loginAdminToPageOld(AppUrl url, Class typeOfPage) { - return teammates.test.pageobjects.AppPage.getNewPageInstance(browser, typeOfPage); + return AppPage.getNewPageInstance(browser, url, typeOfPage); } /** @@ -149,4 +159,61 @@ protected AdminHomePage loginAdmin() { return loginAdminToPage(createUrl(Const.WebPageURIs.ADMIN_HOME_PAGE), AdminHomePage.class); } + /** + * Deletes file with fileName from the downloads folder. + */ + protected void deleteDownloadsFile(String fileName) { + String filePath = getTestDownloadsFolder() + fileName; + FileHelper.deleteFile(filePath); + } + + /** + * Verifies downloaded file has correct fileName and contains expected content. + */ + protected void verifyDownloadedFile(String expectedFileName, List expectedContent) { + String filePath = getTestDownloadsFolder() + expectedFileName; + int retryLimit = 5; + boolean actual = Files.exists(Paths.get(filePath)); + while (!actual && retryLimit > 0) { + retryLimit--; + ThreadHelper.waitFor(1000); + actual = Files.exists(Paths.get(filePath)); + } + assertTrue(actual); + + try { + String actualContent = FileHelper.readFile(filePath); + for (String content : expectedContent) { + assertTrue(actualContent.contains(content)); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + /** + * Verifies that email with subject is found in inbox. + * Email used must be an authentic gmail account. + */ + protected void verifyEmailSent(String email, String subject) { + if (TestProperties.isDevServer()) { + return; + } + EmailAccount emailAccount = new EmailAccount(email); + try { + emailAccount.getUserAuthenticated(); + int retryLimit = 5; + boolean actual = emailAccount.isEmailWithSubjectPresent(subject); + while (!actual && retryLimit > 0) { + retryLimit--; + ThreadHelper.waitFor(1000); + actual = emailAccount.isEmailWithSubjectPresent(subject); + } + emailAccount.markAllUnreadEmailAsRead(); + assertTrue(actual); + } catch (Exception e) { + fail("Failed to verify email sent:" + e); + } + } + } diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackConstSumOptionQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackConstSumOptionQuestionE2ETest.java new file mode 100644 index 00000000000..0f518690107 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackConstSumOptionQuestionE2ETest.java @@ -0,0 +1,137 @@ +package teammates.e2e.cases.e2e; + +import java.util.Arrays; +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackConstantSumQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackConstantSumResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for ConstSumOption questions. + */ +public class FeedbackConstSumOptionQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackConstSumOptionQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FConstSumOptionQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackConstantSumQuestionDetails questionDetails = + (FeedbackConstantSumQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyConstSumQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addConstSumOptionQuestion(loadedQuestion); + + feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackConstantSumQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyConstSumQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackConstantSumQuestionDetails) loadedQuestion.getQuestionDetails(); + List options = questionDetails.getConstSumOptions(); + options.add("Edited option."); + questionDetails.setNumOfConstSumOptions(questionDetails.getNumOfConstSumOptions() + 1); + questionDetails.setConstSumOptions(options); + questionDetails.setPointsPerOption(true); + questionDetails.setPoints(1000); + questionDetails.setDistributePointsFor("At least some options"); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editConstSumQuestion(2, questionDetails); + + feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + feedbackSubmitPage.verifyConstSumQuestion(1, "", + (FeedbackConstantSumQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, Arrays.asList(50, 20, 30)); + feedbackSubmitPage.submitConstSumOptionResponse(1, "", response); + + verifyPresentInDatastore(response); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyConstSumOptionResponse(1, "", response); + + ______TS("edit response"); + response = getResponse(questionId, Arrays.asList(23, 47, 30)); + feedbackSubmitPage.submitConstSumOptionResponse(1, "", response); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyConstSumOptionResponse(1, "", response); + verifyPresentInDatastore(response); + } + + private FeedbackResponseAttributes getResponse(String questionId, List answers) { + FeedbackConstantSumResponseDetails details = new FeedbackConstantSumResponseDetails(); + details.setAnswers(answers); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), student.getEmail()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackConstSumRecipientQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackConstSumRecipientQuestionE2ETest.java new file mode 100644 index 00000000000..89ba03499ea --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackConstSumRecipientQuestionE2ETest.java @@ -0,0 +1,141 @@ +package teammates.e2e.cases.e2e; + +import java.util.Arrays; +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackConstantSumQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackConstantSumResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for ConstSumRecipient questions. + */ +public class FeedbackConstSumRecipientQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackConstSumRecipientQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FConstSumRecipientQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackConstantSumQuestionDetails questionDetails = + (FeedbackConstantSumQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyConstSumQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addConstSumRecipientQuestion(loadedQuestion); + + feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackConstantSumQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyConstSumQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackConstantSumQuestionDetails) loadedQuestion.getQuestionDetails(); + questionDetails.setPointsPerOption(true); + questionDetails.setPoints(1000); + questionDetails.setDistributePointsFor("At least some options"); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editConstSumQuestion(2, questionDetails); + + feedbackEditPage.verifyConstSumQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + StudentAttributes receiver = testData.students.get("benny.tmms@FConstSumRecipientQuestionE2eT.CS2104"); + StudentAttributes receiver2 = testData.students.get("charlie.tmms@FConstSumRecipientQuestionE2eT.CS2104"); + feedbackSubmitPage.verifyConstSumQuestion(1, "", + (FeedbackConstantSumQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, receiver, 49); + FeedbackResponseAttributes response2 = getResponse(questionId, receiver2, 51); + List responses = Arrays.asList(response, response2); + feedbackSubmitPage.submitConstSumRecipientResponse(1, responses); + + verifyPresentInDatastore(response); + verifyPresentInDatastore(response2); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyConstSumRecipientResponse(1, responses); + + ______TS("edit response"); + response = getResponse(questionId, receiver, 21); + response2 = getResponse(questionId, receiver2, 79); + responses = Arrays.asList(response, response2); + feedbackSubmitPage.submitConstSumRecipientResponse(1, responses); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyConstSumRecipientResponse(1, responses); + verifyPresentInDatastore(response); + verifyPresentInDatastore(response2); + } + + private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, Integer answer) { + FeedbackConstantSumResponseDetails details = new FeedbackConstantSumResponseDetails(); + details.setAnswers(Arrays.asList(answer)); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), receiver.getTeam()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackContributionQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackContributionQuestionE2ETest.java new file mode 100644 index 00000000000..7e1adc19dde --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackContributionQuestionE2ETest.java @@ -0,0 +1,143 @@ +package teammates.e2e.cases.e2e; + +import java.util.Arrays; +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackContributionQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackContributionResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for Contribution questions. + */ +public class FeedbackContributionQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackContributionQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FContributionQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackContributionQuestionDetails questionDetails = + (FeedbackContributionQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyContributionQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addContributionQuestion(loadedQuestion); + + feedbackEditPage.verifyContributionQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackContributionQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyContributionQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackContributionQuestionDetails) loadedQuestion.getQuestionDetails(); + questionDetails.setNotSureAllowed(false); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editContributionQuestion(2, questionDetails); + + feedbackEditPage.verifyContributionQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + StudentAttributes receiver = testData.students.get("benny.tmms@FContributionQuestionE2eT.CS2104"); + StudentAttributes receiver2 = testData.students.get("charlie.tmms@FContributionQuestionE2eT.CS2104"); + feedbackSubmitPage.verifyContributionQuestion(1, + (FeedbackContributionQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, student, 170); + FeedbackResponseAttributes response2 = getResponse(questionId, receiver, 180); + FeedbackResponseAttributes response3 = getResponse(questionId, receiver2, 60); + List responses = Arrays.asList(response, response2, response3); + feedbackSubmitPage.submitContributionResponse(1, responses); + + verifyPresentInDatastore(response); + verifyPresentInDatastore(response2); + verifyPresentInDatastore(response3); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyContributionResponse(1, responses); + + ______TS("edit response"); + response = getResponse(questionId, student, 50); + response2 = getResponse(questionId, receiver, Const.POINTS_EQUAL_SHARE); + response3 = getResponse(questionId, receiver2, Const.POINTS_NOT_SURE); + responses = Arrays.asList(response, response2, response3); + feedbackSubmitPage.submitContributionResponse(1, responses); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyContributionResponse(1, responses); + verifyPresentInDatastore(response); + verifyPresentInDatastore(response2); + verifyPresentInDatastore(response3); + } + + private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, int answer) { + FeedbackContributionResponseDetails details = new FeedbackContributionResponseDetails(); + details.setAnswer(answer); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), receiver.getEmail()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackMcqQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackMcqQuestionE2ETest.java new file mode 100644 index 00000000000..24ad3abf9ef --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackMcqQuestionE2ETest.java @@ -0,0 +1,153 @@ +package teammates.e2e.cases.e2e; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMcqResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for MCQ questions. + */ +public class FeedbackMcqQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackMcqQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FMcqQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackMcqQuestionDetails questionDetails = (FeedbackMcqQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyMcqQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addMcqQuestion(loadedQuestion); + + feedbackEditPage.verifyMcqQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackMcqQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyMcqQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackMcqQuestionDetails) loadedQuestion.getQuestionDetails(); + questionDetails.setHasAssignedWeights(false); + questionDetails.setMcqWeights(new ArrayList<>()); + questionDetails.setOtherEnabled(false); + questionDetails.setMcqOtherWeight(0); + questionDetails.setNumOfMcqChoices(4); + List choices = questionDetails.getMcqChoices(); + choices.add("Edited choice"); + questionDetails.setMcqChoices(choices); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editMcqQuestion(2, questionDetails); + + feedbackEditPage.verifyMcqQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + feedbackSubmitPage.verifyMcqQuestion(1, "", + (FeedbackMcqQuestionDetails) question.getQuestionDetails()); + + ______TS("verify question with generated options"); + feedbackSubmitPage.verifyGeneratedMcqQuestion(3, "", getGeneratedStudentOptions()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, false, "UI"); + feedbackSubmitPage.submitMcqResponse(1, "", response); + + verifyPresentInDatastore(response); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyMcqResponse(1, "", response); + + ______TS("edit response"); + response = getResponse(questionId, true, "This is the edited response."); + feedbackSubmitPage.submitMcqResponse(1, "", response); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyMcqResponse(1, "", response); + verifyPresentInDatastore(response); + } + + private List getGeneratedStudentOptions() { + return testData.students.values().stream() + .filter(s -> s.getCourse().equals(student.course)) + .map(s -> s.getName() + " (" + s.getTeam() + ")") + .collect(Collectors.toList()); + } + + private FeedbackResponseAttributes getResponse(String questionId, boolean isOther, String answer) { + FeedbackMcqResponseDetails details = new FeedbackMcqResponseDetails(); + if (isOther) { + details.setOther(true); + details.setOtherFieldContent(answer); + } else { + details.setAnswer(answer); + } + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), "%GENERAL%") + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackMsqQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackMsqQuestionE2ETest.java new file mode 100644 index 00000000000..8c6f9810f97 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackMsqQuestionE2ETest.java @@ -0,0 +1,161 @@ +package teammates.e2e.cases.e2e; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackMsqQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMsqResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for MSQ questions. + */ +public class FeedbackMsqQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackMsqQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FMsqQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackMsqQuestionDetails questionDetails = (FeedbackMsqQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyMsqQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addMsqQuestion(loadedQuestion); + + feedbackEditPage.verifyMsqQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackMsqQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyMsqQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackMsqQuestionDetails) loadedQuestion.getQuestionDetails(); + questionDetails.setHasAssignedWeights(false); + questionDetails.setMsqWeights(new ArrayList<>()); + questionDetails.setOtherEnabled(false); + questionDetails.setMsqOtherWeight(0); + questionDetails.setMaxSelectableChoices(Integer.MIN_VALUE); + List choices = questionDetails.getMsqChoices(); + choices.add("Edited choice"); + questionDetails.setMsqChoices(choices); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editMsqQuestion(2, questionDetails); + + feedbackEditPage.verifyMsqQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + StudentAttributes receiver = testData.students.get("benny.tmms@FMsqQuestionE2eT.CS2104"); + feedbackSubmitPage.verifyMsqQuestion(1, receiver.getName(), + (FeedbackMsqQuestionDetails) question.getQuestionDetails()); + + ______TS("verify loaded question with generated options"); + FeedbackQuestionAttributes generatedQn = testData.feedbackQuestions.get("qn1ForSecondSession"); + feedbackSubmitPage.verifyGeneratedMsqQuestion(3, "", + (FeedbackMsqQuestionDetails) generatedQn.getQuestionDetails(), getGeneratedTeams()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + List answers = Arrays.asList("Leadership", "This is the other response."); + FeedbackResponseAttributes response = getResponse(questionId, receiver, answers.get(answers.size() - 1), answers); + feedbackSubmitPage.submitMsqResponse(1, receiver.getName(), response); + + verifyPresentInDatastore(response); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyMsqResponse(1, receiver.getName(), response); + + ______TS("edit response"); + answers = Arrays.asList(""); + response = getResponse(questionId, receiver, "", answers); + feedbackSubmitPage.submitMsqResponse(1, receiver.getName(), response); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyMsqResponse(1, receiver.getName(), response); + verifyPresentInDatastore(response); + } + + private List getGeneratedTeams() { + return testData.students.values().stream() + .filter(s -> s.getCourse().equals(student.course)) + .map(s -> s.getTeam()) + .distinct() + .collect(Collectors.toList()); + } + + private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, String other, + List answers) { + FeedbackMsqResponseDetails details = new FeedbackMsqResponseDetails(); + if (!other.isEmpty()) { + details.setOther(true); + details.setOtherFieldContent(other); + } + details.setAnswers(answers); + + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), receiver.getEmail()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackNumScaleQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackNumScaleQuestionE2ETest.java new file mode 100644 index 00000000000..7e341a75870 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackNumScaleQuestionE2ETest.java @@ -0,0 +1,131 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackNumericalScaleQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackNumericalScaleResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for NumScale questions. + */ +public class FeedbackNumScaleQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackNumScaleQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FNumScaleQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackNumericalScaleQuestionDetails questionDetails = + (FeedbackNumericalScaleQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyNumScaleQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addNumScaleQuestion(loadedQuestion); + + feedbackEditPage.verifyNumScaleQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackNumericalScaleQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyNumScaleQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackNumericalScaleQuestionDetails) loadedQuestion.getQuestionDetails(); + questionDetails.setMinScale(0); + questionDetails.setStep(1); + questionDetails.setMaxScale(100); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editNumScaleQuestion(2, questionDetails); + + feedbackEditPage.verifyNumScaleQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + StudentAttributes receiver = testData.students.get("benny.tmms@FNumScaleQuestionE2eT.CS2104"); + feedbackSubmitPage.verifyNumScaleQuestion(1, receiver.getTeam(), + (FeedbackNumericalScaleQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, receiver, 5.4); + feedbackSubmitPage.submitNumScaleResponse(1, receiver.getTeam(), response); + + verifyPresentInDatastore(response); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyNumScaleResponse(1, receiver.getTeam(), response); + + ______TS("edit response"); + response = getResponse(questionId, receiver, 10.0); + feedbackSubmitPage.submitNumScaleResponse(1, receiver.getTeam(), response); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyNumScaleResponse(1, receiver.getTeam(), response); + verifyPresentInDatastore(response); + } + + private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, Double answer) { + FeedbackNumericalScaleResponseDetails details = new FeedbackNumericalScaleResponseDetails(); + details.setAnswer(answer); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), receiver.getTeam()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRankOptionQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRankOptionQuestionE2ETest.java new file mode 100644 index 00000000000..e4be0a132bb --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRankOptionQuestionE2ETest.java @@ -0,0 +1,140 @@ +package teammates.e2e.cases.e2e; + +import java.util.Arrays; +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackRankOptionsQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRankOptionsResponseDetails; +import teammates.common.datatransfer.questions.FeedbackRankQuestionDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for RankOption questions. + */ +public class FeedbackRankOptionQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackRankOptionQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FRankOptionQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackRankOptionsQuestionDetails questionDetails = + (FeedbackRankOptionsQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyRankQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addRankOptionsQuestion(loadedQuestion); + + feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackRankOptionsQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyRankQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackRankOptionsQuestionDetails) loadedQuestion.getQuestionDetails(); + List options = questionDetails.getOptions(); + options.remove(0); + options.set(1, "Edited option."); + questionDetails.setOptions(options); + questionDetails.setAreDuplicatesAllowed(true); + questionDetails.setMaxOptionsToBeRanked(Integer.MIN_VALUE); + questionDetails.setMinOptionsToBeRanked(1); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editRankQuestion(2, questionDetails); + + feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + StudentAttributes receiver = testData.students.get("benny.tmms@FRankOptionQuestionE2eT.CS2104"); + feedbackSubmitPage.verifyRankQuestion(1, receiver.getName(), + (FeedbackRankQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, receiver, Arrays.asList(2, 1, 3, + Const.POINTS_NOT_SUBMITTED)); + feedbackSubmitPage.submitRankOptionResponse(1, receiver.getName(), response); + + verifyPresentInDatastore(response); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyRankOptionResponse(1, receiver.getName(), response); + + ______TS("edit response"); + response = getResponse(questionId, receiver, Arrays.asList(Const.POINTS_NOT_SUBMITTED, 1, 3, 2)); + feedbackSubmitPage.submitRankOptionResponse(1, receiver.getName(), response); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyRankOptionResponse(1, receiver.getName(), response); + verifyPresentInDatastore(response); + } + + private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, List answers) { + FeedbackRankOptionsResponseDetails details = new FeedbackRankOptionsResponseDetails(); + details.setAnswers(answers); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), receiver.getEmail()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRankRecipientQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRankRecipientQuestionE2ETest.java new file mode 100644 index 00000000000..e224be7169e --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRankRecipientQuestionE2ETest.java @@ -0,0 +1,142 @@ +package teammates.e2e.cases.e2e; + +import java.util.Arrays; +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackRankQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRankRecipientsQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRankRecipientsResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for RankRecipient questions. + */ +public class FeedbackRankRecipientQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackRankRecipientQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FRankRecipientQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackRankRecipientsQuestionDetails questionDetails = + (FeedbackRankRecipientsQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyRankQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addRankRecipientsQuestion(loadedQuestion); + + feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackRankRecipientsQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyRankQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails = (FeedbackRankRecipientsQuestionDetails) loadedQuestion.getQuestionDetails(); + questionDetails.setAreDuplicatesAllowed(false); + questionDetails.setMaxOptionsToBeRanked(3); + questionDetails.setMinOptionsToBeRanked(Integer.MIN_VALUE); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editRankQuestion(2, questionDetails); + + feedbackEditPage.verifyRankQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + InstructorAttributes receiver = testData.instructors.get("instructor"); + InstructorAttributes receiver2 = testData.instructors.get("instructor2"); + feedbackSubmitPage.verifyRankQuestion(1, receiver.getName(), + (FeedbackRankQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, receiver, 1); + FeedbackResponseAttributes response2 = getResponse(questionId, receiver2, 2); + List responses = Arrays.asList(response, response2); + feedbackSubmitPage.submitRankRecipientResponse(1, responses); + + verifyPresentInDatastore(response); + verifyPresentInDatastore(response2); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyRankRecipientResponse(1, responses); + + ______TS("edit response"); + response = getResponse(questionId, receiver, Const.POINTS_NOT_SUBMITTED); + response2 = getResponse(questionId, receiver2, 1); + responses = Arrays.asList(response, response2); + feedbackSubmitPage.submitRankRecipientResponse(1, responses); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyRankRecipientResponse(1, responses); + verifyAbsentInDatastore(response); + verifyPresentInDatastore(response2); + } + + private FeedbackResponseAttributes getResponse(String questionId, InstructorAttributes receiver, Integer answer) { + FeedbackRankRecipientsResponseDetails details = new FeedbackRankRecipientsResponseDetails(); + details.setAnswer(answer); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), receiver.getEmail()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRubricQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRubricQuestionE2ETest.java new file mode 100644 index 00000000000..b577df8c9f7 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackRubricQuestionE2ETest.java @@ -0,0 +1,152 @@ +package teammates.e2e.cases.e2e; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackRubricQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRubricResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for Rubric questions. + */ +public class FeedbackRubricQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackRubricQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FRubricQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession").getCopy(); + FeedbackRubricQuestionDetails questionDetails = + (FeedbackRubricQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyRubricQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addRubricQuestion(loadedQuestion); + + feedbackEditPage.verifyRubricQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackRubricQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyRubricQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + // add a new choice + questionDetails = (FeedbackRubricQuestionDetails) loadedQuestion.getQuestionDetails(); + List choices = questionDetails.getRubricChoices(); + choices.add("Edited choice."); + List> descriptions = questionDetails.getRubricDescriptions(); + descriptions.get(0).add("Edit description."); + descriptions.get(1).add("Edit description 1."); + questionDetails.setNumOfRubricChoices(3); + // edit existing descriptions + descriptions.get(0).set(1, "Edit description 2"); + descriptions.get(1).set(0, ""); + // edit existing subquestion + List subQns = questionDetails.getRubricSubQuestions(); + subQns.set(0, "Edited subquestion."); + // add a new subquestion + subQns.add("Added subquestion."); + questionDetails.setNumOfRubricSubQuestions(3); + descriptions.add(Arrays.asList("", "test", "")); + // remove assigned weights + questionDetails.setHasAssignedWeights(false); + questionDetails.setRubricWeightsForEachCell(new ArrayList<>()); + loadedQuestion.questionDetails = questionDetails; + feedbackEditPage.editRubricQuestion(2, questionDetails); + + feedbackEditPage.verifyRubricQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + StudentAttributes receiver = testData.students.get("benny.tmms@FRubricQuestionE2eT.CS2104"); + feedbackSubmitPage.verifyRubricQuestion(1, receiver.getName(), + (FeedbackRubricQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, receiver, Arrays.asList(1, 1)); + feedbackSubmitPage.submitRubricResponse(1, receiver.getName(), response); + + verifyPresentInDatastore(response); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyRubricResponse(1, receiver.getName(), response); + + ______TS("edit response"); + response = getResponse(questionId, receiver, Arrays.asList(0, 0)); + feedbackSubmitPage.submitRubricResponse(1, receiver.getName(), response); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyRubricResponse(1, receiver.getName(), response); + verifyPresentInDatastore(response); + } + + private FeedbackResponseAttributes getResponse(String questionId, StudentAttributes receiver, List answers) { + FeedbackRubricResponseDetails details = new FeedbackRubricResponseDetails(); + details.setAnswer(answers); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), receiver.getEmail()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackSubmitPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackSubmitPageE2ETest.java new file mode 100644 index 00000000000..92713783f4e --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackSubmitPageE2ETest.java @@ -0,0 +1,243 @@ +package teammates.e2e.cases.e2e; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackMcqResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.util.TestProperties; + +/** + * SUT: {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE}. + */ +public class FeedbackSubmitPageE2ETest extends BaseE2ETestCase { + private StudentAttributes student; + private InstructorAttributes instructor; + + private FeedbackSessionAttributes openSession; + private FeedbackSessionAttributes closedSession; + private FeedbackSessionAttributes gracePeriodSession; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackSubmitPageE2ETest.json"); + testData.feedbackSessions.get("Grace Period Session").setEndTime(Instant.now()); + student = testData.students.get("Alice"); + if (!TestProperties.isDevServer()) { + student.email = TestProperties.TEST_STUDENT1_ACCOUNT; + } + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("SFSubmitE2eT.instr"); + openSession = testData.feedbackSessions.get("Open Session"); + closedSession = testData.feedbackSessions.get("Closed Session"); + gracePeriodSession = testData.feedbackSessions.get("Grace Period Session"); + } + + @Test + public void testAll() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_SUBMISSION_PAGE) + .withUserId(instructor.getGoogleId()) + .withCourseId(openSession.getCourseId()) + .withSessionName(openSession.getFeedbackSessionName()); + FeedbackSubmitPage submitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded session data"); + submitPage.verifyFeedbackSessionDetails(openSession); + + ______TS("questions with giver type instructor"); + submitPage.verifyNumQuestions(1); + submitPage.verifyQuestionDetails(1, testData.feedbackQuestions.get("qn5InSession1")); + + ______TS("questions with giver type students"); + submitPage = loginAdminToPage(getStudentSubmitPageUrl(student, openSession), FeedbackSubmitPage.class); + + submitPage.verifyNumQuestions(4); + submitPage.verifyQuestionDetails(1, testData.feedbackQuestions.get("qn1InSession1")); + submitPage.verifyQuestionDetails(2, testData.feedbackQuestions.get("qn2InSession1")); + submitPage.verifyQuestionDetails(3, testData.feedbackQuestions.get("qn3InSession1")); + submitPage.verifyQuestionDetails(4, testData.feedbackQuestions.get("qn4InSession1")); + + ______TS("verify recipients: students"); + submitPage.verifyLimitedRecipients(1, 3, getOtherStudents(student)); + + ______TS("verify recipients: instructors"); + submitPage.verifyRecipients(2, getInstructors(), "Instructor"); + + ______TS("verify recipients: team mates"); + submitPage.verifyRecipients(3, getTeammates(student), "Student"); + + ______TS("verify recipients: teams"); + submitPage.verifyRecipients(4, getOtherTeams(student), "Team"); + + ______TS("submit partial response"); + int[] unansweredQuestions = { 1, 2, 3, 4 }; + submitPage.verifyWarningMessageForPartialResponse(unansweredQuestions); + + ______TS("cannot submit in closed session"); + AppUrl closedSessionUrl = getStudentSubmitPageUrl(student, closedSession); + submitPage = AppPage.getNewPageInstance(browser, closedSessionUrl, FeedbackSubmitPage.class); + submitPage.verifyCannotSubmit(); + + ______TS("can submit in grace period"); + AppUrl gracePeriodSessionUrl = getStudentSubmitPageUrl(student, gracePeriodSession); + submitPage = AppPage.getNewPageInstance(browser, gracePeriodSessionUrl, FeedbackSubmitPage.class); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1InGracePeriodSession"); + String questionId = getFeedbackQuestion(question).getId(); + String recipient = "Team 2"; + FeedbackResponseAttributes response = getMcqResponse(questionId, recipient, false, "UI"); + submitPage.submitMcqResponse(1, recipient, response); + + verifyPresentInDatastore(response); + + ______TS("confirmation email"); + submitPage.markWithConfirmationEmail(); + submitPage.submitMcqResponse(1, recipient, response); + + verifyEmailSent(student.getEmail(), "TEAMMATES: Feedback responses successfully recorded" + + " [Course: " + testData.courses.get("SFSubmitE2eT.CS2104").getName() + "][Feedback Session: " + + gracePeriodSession.getFeedbackSessionName() + "]"); + + ______TS("add comment"); + String responseId = getFeedbackResponse(response).getId(); + int qnToComment = 1; + String comment = "

new comment

"; + submitPage.addComment(qnToComment, recipient, comment); + + submitPage.verifyComment(qnToComment, recipient, comment); + verifyPresentInDatastore(getFeedbackResponseComment(responseId, comment)); + + ______TS("edit comment"); + comment = "

edited comment

"; + submitPage.editComment(qnToComment, recipient, comment); + + submitPage.verifyComment(qnToComment, recipient, comment); + verifyPresentInDatastore(getFeedbackResponseComment(responseId, comment)); + + ______TS("delete comment"); + submitPage.deleteComment(qnToComment, recipient); + + submitPage.verifyStatusMessage("Your comment has been deleted!"); + submitPage.verifyNoCommentPresent(qnToComment, recipient); + verifyAbsentInDatastore(getFeedbackResponseComment(responseId, comment)); + + ______TS("preview as student"); + url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(instructor.googleId) + .withCourseId(openSession.getCourseId()) + .withSessionName(openSession.getFeedbackSessionName()) + .withParam("previewas", student.getEmail()); + submitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + + submitPage.verifyFeedbackSessionDetails(openSession); + submitPage.verifyNumQuestions(4); + submitPage.verifyQuestionDetails(1, testData.feedbackQuestions.get("qn1InSession1")); + submitPage.verifyQuestionDetails(2, testData.feedbackQuestions.get("qn2InSession1")); + submitPage.verifyQuestionDetails(3, testData.feedbackQuestions.get("qn3InSession1")); + submitPage.verifyQuestionDetails(4, testData.feedbackQuestions.get("qn4InSession1")); + submitPage.verifyCannotSubmit(); + + ______TS("preview as instructor"); + url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_SUBMISSION_PAGE) + .withUserId(instructor.googleId) + .withCourseId(openSession.getCourseId()) + .withSessionName(openSession.getFeedbackSessionName()) + .withParam("previewas", instructor.getEmail()); + submitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + + submitPage.verifyFeedbackSessionDetails(openSession); + submitPage.verifyNumQuestions(1); + submitPage.verifyQuestionDetails(1, testData.feedbackQuestions.get("qn5InSession1")); + submitPage.verifyCannotSubmit(); + + ______TS("moderating instructor cannot see questions without instructor visibility"); + url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(instructor.googleId) + .withCourseId(gracePeriodSession.getCourseId()) + .withSessionName(gracePeriodSession.getFeedbackSessionName()) + .withParam("moderatedperson", student.getEmail()) + .withParam("moderatedquestionId", questionId); + submitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + + submitPage.verifyFeedbackSessionDetails(gracePeriodSession); + // One out of two questions in grace period session should not be visible + submitPage.verifyNumQuestions(1); + submitPage.verifyQuestionDetails(1, question); + + ______TS("submit moderated response"); + response = getMcqResponse(questionId, recipient, false, "Algo"); + submitPage.submitMcqResponse(1, recipient, response); + + verifyPresentInDatastore(response); + } + + private AppUrl getStudentSubmitPageUrl(StudentAttributes student, FeedbackSessionAttributes session) { + return createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(session.getFeedbackSessionName()); + } + + private List getOtherStudents(StudentAttributes currentStudent) { + return testData.students.values().stream() + .filter(s -> !s.equals(currentStudent)) + .map(s -> s.getName()) + .collect(Collectors.toList()); + } + + private List getInstructors() { + return testData.instructors.values().stream() + .map(i -> i.getName()) + .collect(Collectors.toList()); + } + + private List getTeammates(StudentAttributes currentStudent) { + return testData.students.values().stream() + .filter(s -> !s.equals(currentStudent) && s.getTeam().equals(currentStudent.getTeam())) + .map(s -> s.getName()) + .collect(Collectors.toList()); + } + + private List getOtherTeams(StudentAttributes currentStudent) { + return new ArrayList<>(testData.students.values().stream() + .filter(s -> !s.getTeam().equals(currentStudent.getTeam())) + .map(s -> s.getTeam()) + .collect(Collectors.toSet())); + } + + private FeedbackResponseAttributes getMcqResponse(String questionId, String recipient, boolean isOther, String answer) { + FeedbackMcqResponseDetails details = new FeedbackMcqResponseDetails(); + if (isOther) { + details.setOther(true); + details.setOtherFieldContent(answer); + } else { + details.setAnswer(answer); + } + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), recipient) + .withResponseDetails(details) + .build(); + } + + private FeedbackResponseCommentAttributes getFeedbackResponseComment(String responseId, String comment) { + return FeedbackResponseCommentAttributes.builder() + .withFeedbackResponseId(responseId) + .withCommentGiver(student.getEmail()) + .withCommentFromFeedbackParticipant(true) + .withCommentText(comment) + .build(); + } +} + diff --git a/src/e2e/java/teammates/e2e/cases/e2e/FeedbackTextQuestionE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackTextQuestionE2ETest.java new file mode 100644 index 00000000000..91f818ed12c --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/FeedbackTextQuestionE2ETest.java @@ -0,0 +1,128 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE} + * specifically for text questions. + */ +public class FeedbackTextQuestionE2ETest extends BaseE2ETestCase { + InstructorAttributes instructor; + CourseAttributes course; + FeedbackSessionAttributes feedbackSession; + StudentAttributes student; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/FeedbackTextQuestionE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + feedbackSession = testData.feedbackSessions.get("openSession"); + student = testData.students.get("alice.tmms@FTextQuestionE2eT.CS2104"); + } + + @Test + public void testAll() { + testEditPage(); + testSubmitPage(); + } + + private void testEditPage() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes loadedQuestion = testData.feedbackQuestions.get("qn1ForFirstSession"); + FeedbackTextQuestionDetails questionDetails = (FeedbackTextQuestionDetails) loadedQuestion.getQuestionDetails(); + feedbackEditPage.verifyTextQuestionDetails(1, questionDetails); + + ______TS("add new question"); + // add new question exactly like loaded question + loadedQuestion.setQuestionNumber(2); + feedbackEditPage.addTextQuestion(loadedQuestion); + + feedbackEditPage.verifyTextQuestionDetails(2, questionDetails); + verifyPresentInDatastore(loadedQuestion); + + ______TS("copy question"); + FeedbackQuestionAttributes copiedQuestion = testData.feedbackQuestions.get("qn1ForSecondSession"); + questionDetails = (FeedbackTextQuestionDetails) copiedQuestion.getQuestionDetails(); + feedbackEditPage.copyQuestion(copiedQuestion.getCourseId(), + copiedQuestion.getQuestionDetails().getQuestionText()); + copiedQuestion.courseId = course.getId(); + copiedQuestion.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + copiedQuestion.setQuestionNumber(3); + + feedbackEditPage.verifyTextQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + + ______TS("edit question"); + questionDetails.setRecommendedLength(200); + copiedQuestion.questionDetails = questionDetails; + feedbackEditPage.editTextQuestion(3, questionDetails); + + feedbackEditPage.verifyTextQuestionDetails(3, questionDetails); + verifyPresentInDatastore(copiedQuestion); + } + + private void testSubmitPage() { + AppUrl url = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) + .withUserId(student.googleId) + .withCourseId(student.course) + .withSessionName(feedbackSession.getFeedbackSessionName()); + FeedbackSubmitPage feedbackSubmitPage = loginAdminToPage(url, FeedbackSubmitPage.class); + + ______TS("verify loaded question"); + FeedbackQuestionAttributes question = testData.feedbackQuestions.get("qn1ForFirstSession"); + InstructorAttributes receiver = testData.instructors.get("instructor"); + question.setQuestionNumber(1); + feedbackSubmitPage.verifyTextQuestion(1, (FeedbackTextQuestionDetails) question.getQuestionDetails()); + + ______TS("submit response"); + String questionId = getFeedbackQuestion(question).getId(); + FeedbackResponseAttributes response = getResponse(questionId, receiver, "

This is the response for qn 1

"); + feedbackSubmitPage.submitTextResponse(1, receiver.getName(), response); + + verifyPresentInDatastore(response); + + ______TS("check previous response"); + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyTextResponse(1, receiver.getName(), response); + + ______TS("edit response"); + String editedResponse = "

Edited response

"; + FeedbackTextResponseDetails editedDetails = new FeedbackTextResponseDetails(editedResponse); + response.setResponseDetails(editedDetails); + feedbackSubmitPage.submitTextResponse(1, receiver.getName(), response); + + feedbackSubmitPage = AppPage.getNewPageInstance(browser, url, FeedbackSubmitPage.class); + feedbackSubmitPage.verifyTextResponse(1, receiver.getName(), response); + verifyPresentInDatastore(response); + } + + private FeedbackResponseAttributes getResponse(String questionId, InstructorAttributes instructor, String answer) { + FeedbackTextResponseDetails details = new FeedbackTextResponseDetails(answer); + return FeedbackResponseAttributes.builder(questionId, student.getEmail(), instructor.getEmail()) + .withResponseDetails(details) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseDetailsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseDetailsPageE2ETest.java new file mode 100644 index 00000000000..a399258cea9 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseDetailsPageE2ETest.java @@ -0,0 +1,152 @@ +package teammates.e2e.cases.e2e; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.InstructorCourseDetailsPage; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsEditPage; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsViewPage; +import teammates.e2e.pageobjects.InstructorStudentRecordsPage; +import teammates.e2e.util.TestProperties; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_DETAILS_PAGE}. + */ +public class InstructorCourseDetailsPageE2ETest extends BaseE2ETestCase { + private StudentAttributes student; + private CourseAttributes course; + + private String fileName; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorCourseDetailsPageE2ETest.json"); + student = testData.students.get("charlie.tmms@ICDetailsE2eT.CS2104"); + if (!TestProperties.isDevServer()) { + student.email = TestProperties.TEST_STUDENT1_ACCOUNT; + } + + removeAndRestoreDataBundle(testData); + course = testData.courses.get("ICDetailsE2eT.CS2104"); + fileName = "/" + course.getId() + "_studentList.csv"; + } + + @BeforeClass + public void classSetup() { + deleteDownloadsFile(fileName); + } + + @Test + public void allTests() { + AppUrl detailsPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_DETAILS_PAGE) + .withUserId(testData.instructors.get("ICDetailsE2eT.instr").googleId) + .withCourseId(course.getId()); + InstructorCourseDetailsPage detailsPage = loginAdminToPage(detailsPageUrl, InstructorCourseDetailsPage.class); + + ______TS("verify loaded details"); + InstructorAttributes[] instructors = { + testData.instructors.get("ICDetailsE2eT.instr"), + testData.instructors.get("ICDetailsE2eT.instr2"), + }; + StudentAttributes[] students = { + testData.students.get("alice.tmms@ICDetailsE2eT.CS2104"), + testData.students.get("benny.tmms@ICDetailsE2eT.CS2104"), + testData.students.get("charlie.tmms@ICDetailsE2eT.CS2104"), + testData.students.get("danny.tmms@ICDetailsE2eT.CS2104"), + }; + + verifyCourseDetails(detailsPage, course, instructors, students); + detailsPage.verifyNumStudents(students.length); + detailsPage.verifyStudentDetails(students); + + ______TS("link: view student details page"); + + StudentAttributes studentToView = testData.students.get("benny.tmms@ICDetailsE2eT.CS2104"); + + InstructorCourseStudentDetailsViewPage studentDetailsViewPage = + detailsPage.clickViewStudent(studentToView); + studentDetailsViewPage.verifyIsCorrectPage(course.getId(), studentToView.getEmail()); + studentDetailsViewPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("link: edit student details page"); + + InstructorCourseStudentDetailsEditPage studentDetailsEditPage = + detailsPage.clickEditStudent(studentToView); + studentDetailsEditPage.verifyIsCorrectPage(course.getId(), studentToView.getEmail()); + studentDetailsEditPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("link: view all records page"); + + InstructorStudentRecordsPage studentRecordsPage = + detailsPage.clickViewAllRecords(studentToView); + studentRecordsPage.verifyIsCorrectPage(course.getId(), studentToView.getName()); + studentRecordsPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("send invite"); + detailsPage.sendInvite(student); + + detailsPage.verifyStatusMessage("An email has been sent to " + student.getEmail()); + String expectedEmailSubject = "TEAMMATES: Invitation to join course [" + + course.getName() + "][" + course.getId() + "]"; + verifyEmailSent(student.getEmail(), expectedEmailSubject); + + ______TS("remind all students to join"); + detailsPage.remindAllToJoin(); + + detailsPage.verifyStatusMessage("Emails have been sent to unregistered students."); + verifyEmailSent(student.getEmail(), expectedEmailSubject); + + ______TS("download student list"); + detailsPage.downloadStudentList(); + String status = student.googleId.isEmpty() ? "Yet to Join" : "Joined"; + String lastName = student.getName().split(" ")[1]; + String[] studentInfo = { student.getTeam(), student.getName(), lastName, status, student.getEmail() }; + List expectedContent = Arrays.asList("Course ID," + course.getId(), + "Course Name," + course.getName(), String.join(",", studentInfo)); + verifyDownloadedFile(fileName, expectedContent); + + ______TS("delete student"); + detailsPage.sortByName(); + detailsPage.sortByStatus(); + StudentAttributes[] studentsAfterDelete = { students[3], students[0], students[1] }; + detailsPage.deleteStudent(student); + + detailsPage.verifyStatusMessage("Student is successfully deleted from course \"" + + course.getId() + "\""); + detailsPage.verifyNumStudents(studentsAfterDelete.length); + detailsPage.verifyStudentDetails(studentsAfterDelete); + verifyAbsentInDatastore(student); + + ______TS("delete all students"); + detailsPage.deleteAllStudents(); + + detailsPage.verifyStatusMessage("All the students have been removed from the course"); + detailsPage.verifyNumStudents(0); + for (StudentAttributes student : studentsAfterDelete) { + verifyAbsentInDatastore(student); + } + } + + private void verifyCourseDetails(InstructorCourseDetailsPage detailsPage, CourseAttributes course, + InstructorAttributes[] instructors, StudentAttributes[] students) { + Set sections = new HashSet<>(); + Set teams = new HashSet<>(); + + for (StudentAttributes student : students) { + sections.add(student.getSection()); + teams.add(student.getTeam()); + } + + detailsPage.verifyCourseDetails(course, instructors, sections.size(), teams.size(), students.length); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEditPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEditPageE2ETest.java index 35583707564..289d345b3be 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEditPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEditPageE2ETest.java @@ -10,7 +10,6 @@ import teammates.common.util.Const; import teammates.e2e.pageobjects.AppPage; import teammates.e2e.pageobjects.InstructorCourseEditPage; -import teammates.e2e.pageobjects.InstructorHomePage; /** * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_EDIT_PAGE}. @@ -39,8 +38,7 @@ public void testAll() { AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_EDIT_PAGE) .withUserId(instructors[2].googleId) .withCourseId(course.getId()); - loginAdminToPage(url, InstructorHomePage.class); - InstructorCourseEditPage editPage = AppPage.getNewPageInstance(browser, url, InstructorCourseEditPage.class); + InstructorCourseEditPage editPage = loginAdminToPage(url, InstructorCourseEditPage.class); editPage.verifyCourseNotEditable(); editPage.verifyInstructorsNotEditable(); @@ -52,10 +50,8 @@ public void testAll() { .withUserId(instructors[3].googleId) .withCourseId(course.getId()); editPage = AppPage.getNewPageInstance(browser, url, InstructorCourseEditPage.class); - editPage.waitForPageToLoad(); editPage.verifyCourseDetails(course); - editPage.verifyInstructorDetails(instructors[0]); editPage.verifyInstructorDetails(instructors[1]); editPage.verifyInstructorDetails(instructors[2]); @@ -93,7 +89,6 @@ public void testAll() { Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS, true); editPage.editInstructor(1, instructors[0]); - editPage.waitForPageToLoad(); editPage.toggleCustomCourseLevelPrivilege(1, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); editPage.toggleCustomCourseLevelPrivilege(1, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); editPage.toggleCustomSectionLevelPrivilege(1, 1, "Section 2", diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEnrollPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEnrollPageE2ETest.java index 16e173450b9..0028b75d5fe 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEnrollPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseEnrollPageE2ETest.java @@ -7,7 +7,6 @@ import teammates.common.util.Const; import teammates.e2e.pageobjects.AppPage; import teammates.e2e.pageobjects.InstructorCourseEnrollPage; -import teammates.e2e.pageobjects.InstructorHomePage; /** * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_ENROLL_PAGE}. @@ -24,9 +23,7 @@ public void testAll() { AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_ENROLL_PAGE) .withUserId(testData.instructors.get("ICEnrollE2eT.teammates.test").googleId) .withCourseId(testData.courses.get("ICEnrollE2eT.CS2104").getId()); - loginAdminToPage(url, InstructorHomePage.class); - InstructorCourseEnrollPage enrollPage = - AppPage.getNewPageInstance(browser, url, InstructorCourseEnrollPage.class); + InstructorCourseEnrollPage enrollPage = loginAdminToPage(url, InstructorCourseEnrollPage.class); ______TS("Add rows to enroll spreadsheet"); int numRowsToAdd = 30; @@ -69,14 +66,7 @@ public void testAll() { // student2 included to test modified without change table StudentAttributes[] studentsEnrollingToExistingCourse = {student2, student3, student4, student5}; enrollPage.enroll(studentsEnrollingToExistingCourse); - enrollPage.verifyStatusMessage("Some students failed to be enrolled, see the summary below." - + " You may check that: " - + "\"Section\" and \"Comment\" are optional while \"Team\", \"Name\", and \"Email\" must be filled. " - + "\"Section\", \"Team\", \"Name\", and \"Comment\" should start with an alphabetical character, " - + "unless wrapped by curly brackets \"{}\", " - + "and should not contain vertical bar \"|\" and percentage sign\"%\". " - + "\"Email\" should contain some text followed by one '@' sign followed by some more text. " - + "\"Team\" should not have same format of email to avoid mis-interpretation."); + enrollPage.verifyStatusMessage("Some students failed to be enrolled, see the summary below."); StudentAttributes[] newStudentsData = {student4}; StudentAttributes[] modifiedStudentsData = {student3}; diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseJoinConfirmationPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseJoinConfirmationPageE2ETest.java new file mode 100644 index 00000000000..888132d87fd --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseJoinConfirmationPageE2ETest.java @@ -0,0 +1,56 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.CourseJoinConfirmationPage; +import teammates.e2e.pageobjects.ErrorReportingModal; +import teammates.e2e.pageobjects.InstructorHomePage; + +/** + * SUT: {@link Const.WebPageURIs#JOIN_PAGE}. + */ +public class InstructorCourseJoinConfirmationPageE2ETest extends BaseE2ETestCase { + InstructorAttributes newInstructor; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorCourseJoinConfirmationPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + + newInstructor = testData.instructors.get("ICJConfirmationE2eT.instr.CS1101"); + newInstructor.googleId = "ICJConfirmationE2eT.instr2"; + } + + @Test + public void testAll() { + ______TS("Click join link: invalid key"); + String invalidEncryptedKey = "invalidKey"; + AppUrl joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) + .withRegistrationKey(invalidEncryptedKey) + .withEntityType(Const.EntityType.INSTRUCTOR) + .withUserId(newInstructor.googleId); + ErrorReportingModal errorPage = loginAdminToPage(joinLink, ErrorReportingModal.class); + + errorPage.verifyErrorMessage("No instructor with given registration key: " + invalidEncryptedKey); + + ______TS("Click join link: valid key"); + String courseId = testData.courses.get("ICJConfirmationE2eT.CS1101").getId(); + String instructorEmail = newInstructor.email; + joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) + .withRegistrationKey(getKeyForInstructor(courseId, instructorEmail)) + .withEntityType(Const.EntityType.INSTRUCTOR) + .withUserId(newInstructor.googleId); + CourseJoinConfirmationPage confirmationPage = loginAdminToPage(joinLink, CourseJoinConfirmationPage.class); + + confirmationPage.verifyJoiningUser(newInstructor.googleId); + confirmationPage.confirmJoinCourse(InstructorHomePage.class); + + ______TS("Already joined, no confirmation page"); + browser.driver.get(joinLink.toAbsoluteString()); + AppPage.getNewPageInstance(browser, InstructorHomePage.class); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseStudentDetailsEditPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseStudentDetailsEditPageE2ETest.java new file mode 100644 index 00000000000..938eacf5428 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseStudentDetailsEditPageE2ETest.java @@ -0,0 +1,73 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsEditPage; +import teammates.e2e.util.TestProperties; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_STUDENT_DETAILS_EDIT_PAGE}. + */ +public class InstructorCourseStudentDetailsEditPageE2ETest extends BaseE2ETestCase { + private StudentAttributes student; + private StudentAttributes otherStudent; + private CourseAttributes course; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorCourseStudentDetailsEditPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + + student = testData.students.get("ICSDEditE2eT.jose.tmms"); + otherStudent = testData.students.get("ICSDEditE2eT.benny.c"); + course = testData.courses.get("ICSDEditE2eT.CS2104"); + } + + @Test + public void testAll() { + AppUrl editPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_STUDENT_DETAILS_EDIT_PAGE) + .withUserId(testData.instructors.get("ICSDEditE2eT.instr").googleId) + .withCourseId(course.getId()) + .withStudentEmail(student.email); + InstructorCourseStudentDetailsEditPage editPage = + loginAdminToPage(editPageUrl, InstructorCourseStudentDetailsEditPage.class); + + ______TS("verify loaded data"); + editPage.verifyStudentDetails(student); + + ______TS("edit student details"); + student.name = "edited name"; + student.section = "edited section"; + student.team = "edited team"; + student.comments = "edited comment"; + editPage.editStudentDetails(student); + + editPage.verifyStatusMessage("Student has been updated"); + verifyPresentInDatastore(student); + + ______TS("cannot edit to an existing email"); + editPage = AppPage.getNewPageInstance(browser, editPageUrl, InstructorCourseStudentDetailsEditPage.class); + editPage.editStudentEmailAndResendLinks(otherStudent.email); + + editPage.verifyStatusMessage("Trying to update to an email that is already in use"); + + ______TS("edit email and resend links"); + String newEmail = "editedEmail@gmail.tmt"; + if (!TestProperties.isDevServer()) { + newEmail = TestProperties.TEST_STUDENT1_ACCOUNT; + } + student.email = newEmail; + student.googleId = null; + editPage.editStudentEmailAndResendLinks(newEmail); + + editPage.verifyStatusMessage("Student has been updated and email sent"); + verifyPresentInDatastore(student); + verifyEmailSent(newEmail, "TEAMMATES: Summary of course [" + + course.getName() + "][Course ID: " + course.getId() + "]"); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseStudentDetailsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseStudentDetailsPageE2ETest.java new file mode 100644 index 00000000000..da40cbda841 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCourseStudentDetailsPageE2ETest.java @@ -0,0 +1,48 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.attributes.StudentProfileAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsViewPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_STUDENT_DETAILS_PAGE}. + */ +public class InstructorCourseStudentDetailsPageE2ETest extends BaseE2ETestCase { + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorCourseStudentDetailsPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + } + + @Test + public void testAll() { + ______TS("verify loaded details - student with profile"); + StudentAttributes student = testData.students.get("ICSDetailsE2eT.jose.tmms"); + StudentProfileAttributes studentProfile = testData.profiles.get("ICSDetailsE2eT.jose.tmms"); + AppUrl viewPageUrl = getStudentDetailsViewPageUrl(student.getEmail()); + InstructorCourseStudentDetailsViewPage viewPage = + loginAdminToPage(viewPageUrl, InstructorCourseStudentDetailsViewPage.class); + + viewPage.verifyStudentDetails(studentProfile, student); + + ______TS("verify loaded details - student without profile"); + student = testData.students.get("ICSDetailsE2eT.benny.c"); + viewPageUrl = getStudentDetailsViewPageUrl(student.getEmail()); + viewPage = AppPage.getNewPageInstance(browser, viewPageUrl, InstructorCourseStudentDetailsViewPage.class); + + viewPage.verifyStudentDetails(null, student); + } + + private AppUrl getStudentDetailsViewPageUrl(String studentEmail) { + return createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_STUDENT_DETAILS_PAGE) + .withUserId(testData.instructors.get("ICSDetailsE2eT.instr").getGoogleId()) + .withCourseId(testData.courses.get("ICSDetailsE2eT.CS2104").getId()) + .withStudentEmail(studentEmail); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCoursesPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCoursesPageE2ETest.java index 738450ea66e..4b4cf306224 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/InstructorCoursesPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorCoursesPageE2ETest.java @@ -13,9 +13,7 @@ import teammates.common.util.AppUrl; import teammates.common.util.Const; import teammates.common.util.ThreadHelper; -import teammates.e2e.pageobjects.AppPage; import teammates.e2e.pageobjects.InstructorCoursesPage; -import teammates.e2e.pageobjects.InstructorHomePage; import teammates.e2e.util.BackDoor; /** @@ -50,9 +48,7 @@ public void testAll() { String instructorId = testData.accounts.get("instructor").getGoogleId(); AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSES_PAGE) .withUserId(instructorId); - loginAdminToPage(url, InstructorHomePage.class); - InstructorCoursesPage coursesPage = AppPage.getNewPageInstance(browser, url, InstructorCoursesPage.class); - coursesPage.waitForPageToLoad(); + InstructorCoursesPage coursesPage = loginAdminToPage(url, InstructorCoursesPage.class); ______TS("verify loaded data"); CourseAttributes[] activeCourses = { courses[0] }; @@ -70,15 +66,10 @@ public void testAll() { coursesPage.verifyNotModifiable(courses[0].getId()); ______TS("add new course"); - CourseAttributes[] activeCoursesWithNewCourse = { newCourse, courses[0] }; - String[] expectedLinks = { Const.WebPageURIs.INSTRUCTOR_COURSE_ENROLL_PAGE + "?courseid=" + newCourse.getId(), - Const.WebPageURIs.INSTRUCTOR_COURSE_EDIT_PAGE + "?courseid=" + newCourse.getId() }; + CourseAttributes[] activeCoursesWithNewCourse = { courses[0], newCourse }; coursesPage.addCourse(newCourse); - coursesPage.verifyStatusMessageWithLinks("The course has been added. " - + "Click here to add students to the course or click here to add other instructors.\n" - + "If you don't see the course in the list below, please refresh the page after a few moments.", - expectedLinks); + coursesPage.verifyStatusMessage("The course has been added."); coursesPage.sortByCourseId(); coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourse); verifyPresentInDatastore(newCourse); @@ -94,12 +85,13 @@ public void testAll() { verifyCourseArchivedInDatastore(instructorId, newCourse); ______TS("unarchive course"); + CourseAttributes[] activeCoursesWithNewCourseSortedByName = { newCourse, courses[0] }; coursesPage.unarchiveCourse(newCourse.getId()); coursesPage.verifyStatusMessage("The course has been unarchived."); coursesPage.verifyNumArchivedCourses(1); coursesPage.sortByCourseName(); - coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourse); + coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourseSortedByName); verifyCourseNotArchivedInDatastore(instructorId, newCourse); ______TS("move active course to recycle bin"); @@ -115,12 +107,13 @@ public void testAll() { ______TS("restore active course"); newCourse.deletedAt = null; + CourseAttributes[] activeCoursesWithNewCourseSortedByCreationDate = { newCourse, courses[0] }; coursesPage.restoreCourse(newCourse.getId()); coursesPage.verifyStatusMessage("The course " + newCourse.getId() + " has been restored."); coursesPage.verifyNumDeletedCourses(1); - coursesPage.sortByCreationDate(); - coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourse); + // No need to call sortByCreationDate() here because it is the default sort in DESC order + coursesPage.verifyActiveCoursesDetails(activeCoursesWithNewCourseSortedByCreationDate); assertFalse(isCourseInRecycleBin(newCourse.getId())); ______TS("move archived course to recycle bin"); diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorFeedbackEditPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorFeedbackEditPageE2ETest.java new file mode 100644 index 00000000000..0502cfd11cb --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorFeedbackEditPageE2ETest.java @@ -0,0 +1,189 @@ +package teammates.e2e.cases.e2e; + +import java.time.temporal.ChronoUnit; +import java.util.Arrays; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.FeedbackParticipantType; +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.questions.FeedbackContributionQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.common.util.ThreadHelper; +import teammates.e2e.pageobjects.FeedbackSubmitPage; +import teammates.e2e.pageobjects.InstructorFeedbackEditPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}. + */ +public class InstructorFeedbackEditPageE2ETest extends BaseE2ETestCase { + private InstructorAttributes instructor; + private FeedbackSessionAttributes feedbackSession; + private CourseAttributes course; + private CourseAttributes copiedCourse; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorFeedbackEditPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + feedbackSession = testData.feedbackSessions.get("openSession"); + course = testData.courses.get("course"); + copiedCourse = testData.courses.get("course2"); + } + + @Test + public void allTests() throws Exception { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) + .withUserId(instructor.googleId) + .withCourseId(course.getId()) + .withSessionName(feedbackSession.getFeedbackSessionName()); + InstructorFeedbackEditPage feedbackEditPage = loginAdminToPage(url, InstructorFeedbackEditPage.class); + + ______TS("verify loaded data"); + feedbackEditPage.verifySessionDetails(course, feedbackSession); + + ______TS("edit session details"); + feedbackSession.setInstructions("

new instructions

"); + feedbackSession.setStartTime(feedbackSession.getEndTime().minus(30, ChronoUnit.DAYS)); + feedbackSession.setEndTime(feedbackSession.getEndTime().plus(30, ChronoUnit.DAYS)); + feedbackSession.setGracePeriodMinutes(30); + feedbackSession.setSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING); + feedbackSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_VISIBLE); + feedbackSession.setClosingEmailEnabled(false); + + feedbackEditPage.editSessionDetails(feedbackSession); + feedbackEditPage.verifyStatusMessage("The feedback session has been updated."); + feedbackEditPage.verifySessionDetails(course, feedbackSession); + verifyPresentInDatastore(feedbackSession); + + ______TS("add template question"); + FeedbackQuestionAttributes templateQuestion = getTemplateQuestion(); + feedbackEditPage.addTemplateQuestion(1); + + feedbackEditPage.verifyStatusMessage("The question has been added to this feedback session."); + feedbackEditPage.verifyNumQuestions(1); + feedbackEditPage.verifyQuestionDetails(1, templateQuestion); + verifyPresentInDatastore(templateQuestion); + + ______TS("copy question from other session"); + FeedbackQuestionAttributes questionToCopy = testData.feedbackQuestions.get("qn1"); + questionToCopy.courseId = course.getId(); + questionToCopy.feedbackSessionName = feedbackSession.getFeedbackSessionName(); + questionToCopy.questionNumber = 2; + feedbackEditPage.copyQuestion(copiedCourse.getId(), questionToCopy.getQuestionDetails().getQuestionText()); + + feedbackEditPage.verifyStatusMessage("The question has been added to this feedback session."); + feedbackEditPage.verifyNumQuestions(2); + feedbackEditPage.verifyQuestionDetails(2, questionToCopy); + verifyPresentInDatastore(questionToCopy); + + ______TS("reorder questions"); + questionToCopy.setQuestionNumber(1); + templateQuestion.setQuestionNumber(2); + feedbackEditPage.editQuestionNumber(2, 1); + + feedbackEditPage.verifyStatusMessage("The changes to the question have been updated."); + verifyReorder(questionToCopy); + verifyReorder(templateQuestion); + feedbackEditPage.verifyQuestionDetails(1, questionToCopy); + feedbackEditPage.verifyQuestionDetails(2, templateQuestion); + + ______TS("edit question"); + FeedbackQuestionAttributes editedQuestion = getTemplateQuestion(); + editedQuestion.setQuestionNumber(1); + String questionBrief = editedQuestion.getQuestionDetails().getQuestionText(); + editedQuestion.setQuestionDetails(new FeedbackTextQuestionDetails(questionBrief)); + editedQuestion.setQuestionDescription("

New Description

"); + feedbackEditPage.editQuestionDetails(1, editedQuestion); + + feedbackEditPage.verifyStatusMessage("The changes to the question have been updated."); + feedbackEditPage.verifyQuestionDetails(1, editedQuestion); + verifyPresentInDatastore(editedQuestion); + + ______TS("duplicate question"); + editedQuestion.setQuestionNumber(3); + feedbackEditPage.duplicateQuestion(1); + + feedbackEditPage.verifyStatusMessage("The question has been duplicated below."); + feedbackEditPage.verifyNumQuestions(3); + feedbackEditPage.verifyQuestionDetails(3, editedQuestion); + verifyPresentInDatastore(editedQuestion); + + ______TS("delete question"); + templateQuestion.setQuestionNumber(1); + feedbackEditPage.deleteQuestion(1); + + feedbackEditPage.verifyStatusMessage("The question has been deleted."); + feedbackEditPage.verifyNumQuestions(2); + feedbackEditPage.verifyQuestionDetails(1, templateQuestion); + // verify qn 1 has been replaced in datastore by qn 2 + verifyReorder(templateQuestion); + + ______TS("preview session as student"); + FeedbackSubmitPage previewPage = feedbackEditPage.previewAsStudent( + testData.students.get("benny.tmms@CFeedbackEditE2eT.CS2104")); + previewPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("preview session as instructor"); + previewPage = feedbackEditPage.previewAsInstructor(instructor); + previewPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("copy session to other course"); + feedbackSession.setCourseId(copiedCourse.getId()); + String copiedSessionName = "Copied Session"; + feedbackSession.setFeedbackSessionName(copiedSessionName); + feedbackEditPage.copySessionToOtherCourse(copiedCourse, copiedSessionName); + + feedbackEditPage.verifyStatusMessage("The feedback session has been copied. " + + "Please modify settings/questions as necessary."); + verifyPresentInDatastore(feedbackSession); + + ______TS("delete session"); + feedbackEditPage.deleteSession(); + + feedbackEditPage.verifyStatusMessage("The feedback session has been deleted. " + + "You can restore it from the deleted sessions table below."); + assertNotNull(getSoftDeletedSession(copiedSessionName, + instructor.googleId)); + } + + private void verifyReorder(FeedbackQuestionAttributes question) { + int retryLimit = 5; + FeedbackQuestionAttributes actual = getFeedbackQuestion(question); + while (!actual.equals(question) && retryLimit > 0) { + retryLimit--; + ThreadHelper.waitFor(1000); + actual = getFeedbackQuestion(question); + } + assertEquals(question, actual); + } + + private FeedbackQuestionAttributes getTemplateQuestion() { + FeedbackContributionQuestionDetails detail = new FeedbackContributionQuestionDetails(); + detail.setQuestionText("Your estimate of how much each team member has contributed."); + detail.setNotSureAllowed(false); + + return FeedbackQuestionAttributes.builder() + .withCourseId(course.getId()) + .withFeedbackSessionName(feedbackSession.getFeedbackSessionName()) + .withQuestionDetails(detail) + .withQuestionDescription("") + .withQuestionNumber(1) + .withGiverType(FeedbackParticipantType.STUDENTS) + .withRecipientType(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF) + .withNumberOfEntitiesToGiveFeedbackTo(Const.MAX_POSSIBLE_RECIPIENTS) + .withShowResponsesTo(Arrays.asList(FeedbackParticipantType.INSTRUCTORS, + FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.RECEIVER)) + .withShowGiverNameTo(Arrays.asList(FeedbackParticipantType.INSTRUCTORS)) + .withShowRecipientNameTo(Arrays.asList(FeedbackParticipantType.INSTRUCTORS, + FeedbackParticipantType.RECEIVER)) + .build(); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorFeedbackSessionsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorFeedbackSessionsPageE2ETest.java new file mode 100644 index 00000000000..496918f998a --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorFeedbackSessionsPageE2ETest.java @@ -0,0 +1,287 @@ +package teammates.e2e.cases.e2e; + +import java.time.Duration; +import java.time.Instant; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.common.util.ThreadHelper; +import teammates.common.util.TimeHelper; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.InstructorFeedbackSessionsPage; +import teammates.e2e.util.TestProperties; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSIONS_PAGE}. + */ +public class InstructorFeedbackSessionsPageE2ETest extends BaseE2ETestCase { + private InstructorAttributes instructor; + private CourseAttributes course; + private CourseAttributes copiedCourse; + private StudentAttributes studentToEmail; + + private FeedbackSessionAttributes openSession; + private FeedbackSessionAttributes closedSession; + private FeedbackSessionAttributes newSession; + + private String fileName; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorFeedbackSessionsPageE2ETest.json"); + studentToEmail = testData.students.get("charlie.tmms@CFeedbackSessionsE2eT.CS1101"); + if (!TestProperties.isDevServer()) { + studentToEmail.email = TestProperties.TEST_STUDENT1_ACCOUNT; + } + removeAndRestoreDataBundle(testData); + + instructor = testData.instructors.get("instructor"); + course = testData.courses.get("course"); + copiedCourse = testData.courses.get("course2"); + + openSession = testData.feedbackSessions.get("openSession"); + closedSession = testData.feedbackSessions.get("closedSession"); + newSession = FeedbackSessionAttributes + .builder("New Session", course.getId()) + .withCreatorEmail(instructor.getEmail()) + .withStartTime(TimeHelper.parseInstant("2035-04-01 9:59 PM +0000")) + .withEndTime(TimeHelper.parseInstant("2035-04-30 8:00 PM +0000")) + .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) + .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) + .withGracePeriod(Duration.ZERO) + .withInstructions("

Please fill in the new feedback session.

") + .withTimeZone(course.getTimeZone()) + .withIsClosingEmailEnabled(true) + .withIsPublishedEmailEnabled(true) + .build(); + + fileName = "/" + openSession.getCourseId() + "_" + openSession.getFeedbackSessionName() + + "_result.csv"; + } + + @BeforeClass + public void classSetup() { + deleteDownloadsFile(fileName); + } + + @Test + public void allTests() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSIONS_PAGE).withUserId(instructor.googleId); + InstructorFeedbackSessionsPage feedbackSessionsPage = loginAdminToPage(url, InstructorFeedbackSessionsPage.class); + + ______TS("verify loaded data"); + FeedbackSessionAttributes[] loadedSessions = { openSession, closedSession }; + feedbackSessionsPage.sortByCourseId(); + feedbackSessionsPage.verifySessionsTable(loadedSessions); + + ______TS("verify response rate"); + feedbackSessionsPage.verifyResponseRate(closedSession, getExpectedResponseRate(closedSession)); + feedbackSessionsPage.verifyResponseRate(openSession, getExpectedResponseRate(openSession)); + + ______TS("add new session"); + FeedbackSessionAttributes[] sessionsForAdded = { closedSession, newSession, openSession }; + feedbackSessionsPage.addFeedbackSession(newSession, true); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been added." + + "Click the \"Add New Question\" button below to begin adding questions for the feedback session."); + feedbackSessionsPage = AppPage.getNewPageInstance(browser, url, + InstructorFeedbackSessionsPage.class); + feedbackSessionsPage.sortBySessionsName(); + feedbackSessionsPage.verifySessionsTable(sessionsForAdded); + verifyPresentInDatastore(newSession); + + ______TS("add new copied session"); + String newName = "Copied Name"; + FeedbackSessionAttributes copiedSession = openSession.getCopy(); + copiedSession.setCourseId(course.getId()); + copiedSession.setFeedbackSessionName(newName); + copiedSession.setCreatedTime(Instant.now()); + feedbackSessionsPage.addCopyOfSession(openSession, course, newName); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been copied. " + + "Please modify settings/questions as necessary."); + feedbackSessionsPage = AppPage.getNewPageInstance(browser, url, + InstructorFeedbackSessionsPage.class); + feedbackSessionsPage.verifySessionDetails(copiedSession); + verifyPresentInDatastore(copiedSession); + + ______TS("copy session"); + newName = "Copied Name 2"; + FeedbackSessionAttributes copiedSession2 = openSession.getCopy(); + copiedSession2.setCourseId(course.getId()); + copiedSession2.setFeedbackSessionName(newName); + copiedSession2.setCreatedTime(Instant.now()); + feedbackSessionsPage.copySession(openSession, course, newName); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been copied. " + + "Please modify settings/questions as necessary."); + feedbackSessionsPage = AppPage.getNewPageInstance(browser, url, + InstructorFeedbackSessionsPage.class); + feedbackSessionsPage.verifySessionDetails(copiedSession2); + verifyPresentInDatastore(copiedSession2); + + ______TS("publish results"); + openSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_NOW); + feedbackSessionsPage.publishSessionResults(openSession); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been published. " + + "Please allow up to 1 hour for all the notification emails to be sent out."); + feedbackSessionsPage.verifySessionDetails(openSession); + verifySessionPublishedState(openSession, true); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session results published" + + " [Course: " + copiedCourse.getName() + "][Feedback Session: " + + openSession.getFeedbackSessionName() + "]"); + + ______TS("send reminder email"); + feedbackSessionsPage.sendReminderEmail(openSession, studentToEmail); + + feedbackSessionsPage.verifyStatusMessage("Reminder e-mails have been sent out to those students" + + " and instructors. Please allow up to 1 hour for all the notification emails to be sent out."); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session reminder" + + " [Course: " + copiedCourse.getName() + "][Feedback Session: " + + openSession.getFeedbackSessionName() + "]"); + + ______TS("resend results link"); + feedbackSessionsPage.resendResultsLink(openSession, studentToEmail); + + feedbackSessionsPage.verifyStatusMessage("Session published notification emails have been resent" + + " to those students and instructors. Please allow up to 1 hour for all the notification emails to be" + + " sent out."); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session results published" + + " [Course: " + copiedCourse.getName() + "][Feedback Session: " + + openSession.getFeedbackSessionName() + "]"); + + ______TS("unpublish results"); + openSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER); + feedbackSessionsPage.unpublishSessionResults(openSession); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been unpublished."); + feedbackSessionsPage.verifySessionDetails(openSession); + verifySessionPublishedState(openSession, false); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session results unpublished" + + " [Course: " + copiedCourse.getName() + "][Feedback Session: " + + openSession.getFeedbackSessionName() + "]"); + + ______TS("download results"); + feedbackSessionsPage.downloadResults(openSession); + List expectedContent = Arrays.asList("Course,CFeedbackSessionsE2eT.CS1101", + "Session Name,Second Session", "Question 1,Testing question text"); + verifyDownloadedFile(fileName, expectedContent); + + ______TS("soft delete session"); + closedSession.setDeletedTime(Instant.now()); + FeedbackSessionAttributes[] sessionsForSoftDelete = { copiedSession, copiedSession2, newSession, openSession }; + FeedbackSessionAttributes[] softDeletedSessions = { closedSession }; + feedbackSessionsPage.moveToRecycleBin(closedSession); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been deleted. " + + "You can restore it from the deleted sessions table below."); + feedbackSessionsPage.sortBySessionsName(); + feedbackSessionsPage.verifySessionsTable(sessionsForSoftDelete); + feedbackSessionsPage.verifySoftDeletedSessionsTable(softDeletedSessions); + assertNotNull(getSoftDeletedSession(closedSession.getFeedbackSessionName(), + instructor.googleId)); + + ______TS("restore session"); + FeedbackSessionAttributes[] sessionsForRestore = { openSession, newSession, closedSession, copiedSession2, + copiedSession }; + feedbackSessionsPage.restoreSession(closedSession); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been restored."); + feedbackSessionsPage.sortBySessionsName(); + feedbackSessionsPage.verifySessionsTable(sessionsForRestore); + feedbackSessionsPage.verifyNumSoftDeleted(0); + assertNull(getSoftDeletedSession(closedSession.getFeedbackSessionName(), + instructor.googleId)); + + ______TS("permanently delete session"); + FeedbackSessionAttributes[] sessionsForDelete = { copiedSession, copiedSession2, closedSession, + openSession }; + feedbackSessionsPage.moveToRecycleBin(newSession); + feedbackSessionsPage.deleteSession(newSession); + + feedbackSessionsPage.verifyStatusMessage("The feedback session has been permanently deleted."); + feedbackSessionsPage.sortBySessionsName(); + feedbackSessionsPage.verifySessionsTable(sessionsForDelete); + feedbackSessionsPage.verifyNumSoftDeleted(0); + verifyAbsentInDatastore(newSession); + + ______TS("restore all session"); + FeedbackSessionAttributes[] sessionsForRestoreAll = { openSession, closedSession, copiedSession2, + copiedSession }; + feedbackSessionsPage.moveToRecycleBin(copiedSession); + feedbackSessionsPage.moveToRecycleBin(copiedSession2); + feedbackSessionsPage.restoreAllSessions(); + + feedbackSessionsPage.verifyStatusMessage("All sessions have been restored."); + feedbackSessionsPage.sortBySessionsName(); + feedbackSessionsPage.verifySessionsTable(sessionsForRestoreAll); + feedbackSessionsPage.verifyNumSoftDeleted(0); + assertNull(getSoftDeletedSession(copiedSession.getFeedbackSessionName(), + instructor.googleId)); + assertNull(getSoftDeletedSession(copiedSession2.getFeedbackSessionName(), + instructor.googleId)); + + ______TS("delete all session"); + feedbackSessionsPage.moveToRecycleBin(copiedSession); + feedbackSessionsPage.moveToRecycleBin(copiedSession2); + FeedbackSessionAttributes[] sessionsForDeleteAll = { closedSession, openSession }; + feedbackSessionsPage.deleteAllSessions(); + + feedbackSessionsPage.verifyStatusMessage("All sessions have been permanently deleted."); + feedbackSessionsPage.sortBySessionsName(); + feedbackSessionsPage.verifySessionsTable(sessionsForDeleteAll); + feedbackSessionsPage.verifyNumSoftDeleted(0); + verifyAbsentInDatastore(copiedSession); + verifyAbsentInDatastore(copiedSession2); + } + + private String getExpectedResponseRate(FeedbackSessionAttributes session) { + String sessionName = session.getFeedbackSessionName(); + boolean hasQuestion = testData.feedbackQuestions.values() + .stream() + .anyMatch(q -> q.feedbackSessionName.equals(sessionName)); + + if (!hasQuestion) { + return "0 / 0"; + } + + long numStudents = testData.students.values() + .stream() + .filter(s -> s.getCourse().equals(session.getCourseId())) + .count(); + + Set uniqueGivers = new HashSet<>(); + testData.feedbackResponses.values() + .stream() + .filter(r -> r.feedbackSessionName.equals(sessionName)) + .forEach(r -> uniqueGivers.add(r.giver)); + int numResponses = uniqueGivers.size(); + + return numResponses + " / " + numStudents; + } + + private void verifySessionPublishedState(FeedbackSessionAttributes feedbackSession, boolean state) { + int retryLimit = 5; + FeedbackSessionAttributes actual = getFeedbackSession(feedbackSession.getCourseId(), + feedbackSession.getFeedbackSessionName()); + while (actual.isPublished() == state && retryLimit > 0) { + retryLimit--; + ThreadHelper.waitFor(1000); + actual = getFeedbackSession(feedbackSession.getCourseId(), + feedbackSession.getFeedbackSessionName()); + } + assertEquals(actual.isPublished(), state); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorHomePageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorHomePageE2ETest.java new file mode 100644 index 00000000000..5f0c74d53be --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorHomePageE2ETest.java @@ -0,0 +1,257 @@ +package teammates.e2e.cases.e2e; + +import java.time.Instant; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.common.util.ThreadHelper; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.InstructorHomePage; +import teammates.e2e.pageobjects.InstructorSearchPage; +import teammates.e2e.util.TestProperties; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_HOME_PAGE}. + */ +public class InstructorHomePageE2ETest extends BaseE2ETestCase { + private InstructorAttributes instructor; + private StudentAttributes studentToEmail; + private CourseAttributes course; + private CourseAttributes otherCourse; + + private FeedbackSessionAttributes feedbackSessionAwaiting; + private FeedbackSessionAttributes feedbackSessionOpen; + private FeedbackSessionAttributes feedbackSessionClosed; + private FeedbackSessionAttributes feedbackSessionPublished; + private FeedbackSessionAttributes otherCourseSession; + + private String fileName; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorHomePageE2ETest.json"); + studentToEmail = testData.students.get("IHomeE2eT.charlie.d.tmms@IHomeE2eT.CS2104"); + if (!TestProperties.isDevServer()) { + studentToEmail.email = TestProperties.TEST_STUDENT1_ACCOUNT; + } + removeAndRestoreDataBundle(testData); + putDocuments(testData); + + instructor = testData.instructors.get("IHomeE2eT.instr.CS2104"); + course = testData.courses.get("IHomeE2eT.CS2104"); + otherCourse = testData.courses.get("IHomeE2eT.CS1101"); + + feedbackSessionAwaiting = testData.feedbackSessions.get("Second Feedback Session"); + feedbackSessionOpen = testData.feedbackSessions.get("First Feedback Session"); + feedbackSessionClosed = testData.feedbackSessions.get("Third Feedback Session"); + feedbackSessionPublished = testData.feedbackSessions.get("Fourth Feedback Session"); + otherCourseSession = testData.feedbackSessions.get("CS1101 Session"); + + fileName = "/" + feedbackSessionOpen.getCourseId() + "_" + feedbackSessionOpen.getFeedbackSessionName() + + "_result.csv"; + } + + @BeforeClass + public void classSetup() { + deleteDownloadsFile(fileName); + } + + @Test + public void allTests() { + AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE).withUserId(instructor.googleId); + InstructorHomePage homePage = loginAdminToPage(url, InstructorHomePage.class); + + ______TS("search for valid student"); + InstructorSearchPage searchPage = homePage.searchKeyword(studentToEmail.getName()); + + // Here, it is sufficient to ensure that the number of search results matches + // A more thorough testing of this page will be done in its own E2E test + + searchPage.verifyNumCoursesInStudentResults(2); + homePage = AppPage.getNewPageInstance(browser, url, InstructorHomePage.class); + + ______TS("search for invalid student"); + searchPage = homePage.searchKeyword("INVALID"); + + searchPage.verifyStatusMessage("No results found."); + searchPage.verifyNumCoursesInStudentResults(0); + homePage = AppPage.getNewPageInstance(browser, url, InstructorHomePage.class); + + ______TS("verify loaded data"); + homePage.sortCoursesById(); + int courseIndex = 1; + int otherCourseIndex = 0; + // by default, sessions are sorted by end date in descending order + FeedbackSessionAttributes[] courseSessions = { feedbackSessionOpen, feedbackSessionAwaiting, + feedbackSessionClosed, feedbackSessionPublished }; + FeedbackSessionAttributes[] otherCourseSessions = { otherCourseSession }; + // use course index instead of searching for course in table to test sorted order of courses + homePage.verifyCourseTabDetails(otherCourseIndex, otherCourse, otherCourseSessions); + homePage.verifyCourseTabDetails(courseIndex, course, courseSessions); + + ______TS("verify response rate"); + for (int i = 0; i < courseSessions.length; i++) { + homePage.verifyResponseRate(courseIndex, i, getExpectedResponseRate(courseSessions[i])); + } + + ______TS("copy session"); + int sessionIndex = 1; + String newName = "Copied Name"; + FeedbackSessionAttributes copiedSession = feedbackSessionAwaiting.getCopy(); + copiedSession.setCourseId(otherCourse.getId()); + copiedSession.setFeedbackSessionName(newName); + copiedSession.setCreatedTime(Instant.now()); + copiedSession.setTimeZone(otherCourse.getTimeZone()); + homePage.copySession(courseIndex, sessionIndex, otherCourse, newName); + + homePage.verifyStatusMessage("The feedback session has been copied. " + + "Please modify settings/questions as necessary."); + homePage = AppPage.getNewPageInstance(browser, url, InstructorHomePage.class); + homePage.sortCoursesByName(); + // flip index after sorting + courseIndex = 0; + otherCourseIndex = 1; + FeedbackSessionAttributes[] otherCourseSessionsWithCopy = { copiedSession, otherCourseSession }; + homePage.verifyCourseTabDetails(otherCourseIndex, otherCourse, otherCourseSessionsWithCopy); + verifyPresentInDatastore(copiedSession); + + ______TS("publish results"); + sessionIndex = 0; + feedbackSessionOpen.setResultsVisibleFromTime(Const.TIME_REPRESENTS_NOW); + homePage.publishSessionResults(courseIndex, sessionIndex); + + homePage.verifyStatusMessage("The feedback session has been published. " + + "Please allow up to 1 hour for all the notification emails to be sent out."); + homePage.verifySessionDetails(courseIndex, sessionIndex, feedbackSessionOpen); + verifySessionPublishedState(feedbackSessionOpen, true); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session results published" + + " [Course: " + course.getName() + "][Feedback Session: " + + feedbackSessionOpen.getFeedbackSessionName() + "]"); + + ______TS("send reminder email"); + homePage.sendReminderEmail(courseIndex, sessionIndex, studentToEmail); + + homePage.verifyStatusMessage("Reminder e-mails have been sent out to those students" + + " and instructors. Please allow up to 1 hour for all the notification emails to be sent out."); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session reminder" + + " [Course: " + course.getName() + "][Feedback Session: " + + feedbackSessionOpen.getFeedbackSessionName() + "]"); + + ______TS("resend results link"); + homePage.resendResultsLink(courseIndex, sessionIndex, studentToEmail); + + homePage.verifyStatusMessage("Session published notification emails have been resent" + + " to those students and instructors. Please allow up to 1 hour for all the notification emails to be" + + " sent out."); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session results published" + + " [Course: " + course.getName() + "][Feedback Session: " + + feedbackSessionOpen.getFeedbackSessionName() + "]"); + + ______TS("unpublish results"); + feedbackSessionOpen.setResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER); + homePage.unpublishSessionResults(courseIndex, sessionIndex); + + homePage.verifyStatusMessage("The feedback session has been unpublished."); + homePage.verifySessionDetails(courseIndex, sessionIndex, feedbackSessionOpen); + verifySessionPublishedState(feedbackSessionOpen, false); + verifyEmailSent(studentToEmail.getEmail(), "TEAMMATES: Feedback session results unpublished" + + " [Course: " + course.getName() + "][Feedback Session: " + + feedbackSessionOpen.getFeedbackSessionName() + "]"); + + ______TS("download results"); + homePage.downloadResults(courseIndex, sessionIndex); + List expectedContent = Arrays.asList("Course,IHomeE2eT.CS2104", + "Session Name,First Feedback Session", "Question 1,Rate 5 other students' products"); + verifyDownloadedFile(fileName, expectedContent); + + ______TS("soft delete session"); + copiedSession.setDeletedTime(Instant.now()); + homePage.deleteSession(otherCourseIndex, sessionIndex); + + homePage.verifyStatusMessage("The feedback session has been deleted. " + + "You can restore it from the 'Sessions' tab."); + homePage.sortCoursesByCreationDate(); + courseIndex = 1; + otherCourseIndex = 0; + homePage.verifyCourseTabDetails(otherCourseIndex, otherCourse, otherCourseSessions); + assertNotNull(getSoftDeletedSession(copiedSession.getFeedbackSessionName(), + instructor.googleId)); + + ______TS("archive course"); + homePage.archiveCourse(courseIndex); + + homePage.verifyStatusMessage("The course " + course.getId() + " has been archived. " + + "You can retrieve it from the Courses page."); + homePage.verifyNumCourses(1); + verifyCourseArchivedInDatastore(instructor.getGoogleId(), course); + + ______TS("delete course"); + otherCourseIndex = 0; + homePage.deleteCourse(otherCourseIndex); + + homePage.verifyStatusMessage("The course " + otherCourse.getId() + " has been deleted. " + + "You can restore it from the Recycle Bin manually."); + homePage.verifyNumCourses(0); + assertTrue(isCourseInRecycleBin(otherCourse.getId())); + } + + private String getExpectedResponseRate(FeedbackSessionAttributes session) { + String sessionName = session.getFeedbackSessionName(); + boolean hasQuestion = testData.feedbackQuestions.values() + .stream() + .anyMatch(q -> q.feedbackSessionName.equals(sessionName)); + + if (!hasQuestion) { + return "0 / 0"; + } + + long numStudents = testData.students.values() + .stream() + .filter(s -> s.getCourse().equals(session.getCourseId())) + .count(); + + Set uniqueGivers = new HashSet<>(); + testData.feedbackResponses.values() + .stream() + .filter(r -> r.feedbackSessionName.equals(sessionName)) + .forEach(r -> uniqueGivers.add(r.giver)); + int numResponses = uniqueGivers.size(); + + return numResponses + " / " + numStudents; + } + + private void verifySessionPublishedState(FeedbackSessionAttributes feedbackSession, boolean state) { + int retryLimit = 5; + FeedbackSessionAttributes actual = getFeedbackSession(feedbackSession.getCourseId(), + feedbackSession.getFeedbackSessionName()); + while (actual.isPublished() == state && retryLimit > 0) { + retryLimit--; + ThreadHelper.waitFor(1000); + actual = getFeedbackSession(feedbackSession.getCourseId(), + feedbackSession.getFeedbackSessionName()); + } + assertEquals(actual.isPublished(), state); + } + + private void verifyCourseArchivedInDatastore(String instructorId, CourseAttributes course) { + int retryLimit = 5; + CourseAttributes actual = getArchivedCourse(instructorId, course.getId()); + while (actual == null && retryLimit > 0) { + retryLimit--; + ThreadHelper.waitFor(1000); + actual = getArchivedCourse(instructorId, course.getId()); + } + assertEquals(actual, course); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorSearchPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorSearchPageE2ETest.java new file mode 100644 index 00000000000..a328cedf748 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorSearchPageE2ETest.java @@ -0,0 +1,113 @@ +package teammates.e2e.cases.e2e; + +import java.util.HashMap; +import java.util.Map; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsEditPage; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsViewPage; +import teammates.e2e.pageobjects.InstructorSearchPage; +import teammates.e2e.pageobjects.InstructorStudentRecordsPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SEARCH_PAGE}. + */ +public class InstructorSearchPageE2ETest extends BaseE2ETestCase { + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorSearchPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + putDocuments(testData); + } + + @Test + public void allTests() { + + String instructorId = testData.accounts.get("instructor1OfCourse1").googleId; + AppUrl searchPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SEARCH_PAGE).withUserId(instructorId); + + InstructorSearchPage searchPage = loginAdminToPage(searchPageUrl, InstructorSearchPage.class); + + ______TS("cannot click search button if no checkbox is selected"); + + searchPage.search(false, false, "anykeyword"); + + ______TS("search with no result"); + + searchPage.search(true, true, "thiswillnothitanything"); + searchPage.verifyStatusMessage("No results found."); + + ______TS("search for students"); + + searchPage.search(true, false, "student2"); + + CourseAttributes course1 = testData.courses.get("typicalCourse1"); + CourseAttributes course2 = testData.courses.get("typicalCourse2"); + + StudentAttributes[] studentsInCourse1 = { + testData.students.get("student2.2InCourse1"), + testData.students.get("student2InCourse1"), + }; + StudentAttributes[] studentsInCourse2 = { + testData.students.get("student2.2InCourse2"), + testData.students.get("student2InCourse2"), + }; + + Map courseIdToStudents = new HashMap<>(); + courseIdToStudents.put(course1.getId(), studentsInCourse1); + courseIdToStudents.put(course2.getId(), studentsInCourse2); + + Map courseIdToCourse = new HashMap<>(); + courseIdToCourse.put(course1.getId(), course1); + courseIdToCourse.put(course2.getId(), course2); + + searchPage.verifyStudentDetails(courseIdToCourse, courseIdToStudents); + + ______TS("link: view student details page"); + + StudentAttributes studentToView = testData.students.get("student2.2InCourse1"); + String studentEmail = studentToView.getEmail(); + + InstructorCourseStudentDetailsViewPage studentDetailsViewPage = + searchPage.clickViewStudent(course1, studentEmail); + studentDetailsViewPage.verifyIsCorrectPage(course1.getId(), studentEmail); + studentDetailsViewPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("link: edit student details page"); + + InstructorCourseStudentDetailsEditPage studentDetailsEditPage = + searchPage.clickEditStudent(course1, studentEmail); + studentDetailsEditPage.verifyIsCorrectPage(course1.getId(), studentEmail); + studentDetailsEditPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("link: view all records page"); + + InstructorStudentRecordsPage studentRecordsPage = + searchPage.clickViewAllRecords(course1, studentEmail); + studentRecordsPage.verifyIsCorrectPage(course1.getId(), studentToView.getName()); + studentRecordsPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("action: delete student"); + + StudentAttributes studentToDelete = testData.students.get("student2InCourse1"); + + searchPage.deleteStudent(course1, studentToDelete.getEmail()); + + StudentAttributes[] studentsAfterDelete = { + testData.students.get("student2.2InCourse1"), + }; + + searchPage.verifyStudentDetails(course1, studentsAfterDelete); + verifyAbsentInDatastore(studentToDelete); + + // TODO add tests for search response comments + + } + +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorStudentListPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorStudentListPageE2ETest.java new file mode 100644 index 00000000000..24c4a8c96e2 --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorStudentListPageE2ETest.java @@ -0,0 +1,129 @@ +package teammates.e2e.cases.e2e; + +import java.util.HashMap; +import java.util.Map; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.InstructorCourseEnrollPage; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsEditPage; +import teammates.e2e.pageobjects.InstructorCourseStudentDetailsViewPage; +import teammates.e2e.pageobjects.InstructorStudentListPage; +import teammates.e2e.pageobjects.InstructorStudentRecordsPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_STUDENT_LIST_PAGE}. + */ +public class InstructorStudentListPageE2ETest extends BaseE2ETestCase { + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorStudentListPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + } + + @Test + public void testAll() { + + ______TS("verify loaded data"); + + InstructorAttributes instructor = testData.instructors.get("instructorOfCourse1"); + String instructorId = instructor.googleId; + + AppUrl listPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); + InstructorStudentListPage listPage = loginAdminToPage(listPageUrl, InstructorStudentListPage.class); + + CourseAttributes course1 = testData.courses.get("course1"); + CourseAttributes course2 = testData.courses.get("course2"); + CourseAttributes course3 = testData.courses.get("course3"); + + // Expand all headers first + + listPage.clickCourseTabHeader(course1); + listPage.clickCourseTabHeader(course2); + listPage.clickCourseTabHeader(course3); + + StudentAttributes[] studentsInCourse1 = {}; + + // Note: by right, there should not be any student shown here as the instructor does not have sufficient privilege + // However, due to issue #8000, the students will be listed anyway + StudentAttributes[] studentsInCourse2 = { + testData.students.get("Student1Course2"), + testData.students.get("Student2Course2"), + testData.students.get("Student3Course2"), + }; + + StudentAttributes[] studentsInCourse3 = { + testData.students.get("Student1Course3"), + testData.students.get("Student2Course3"), + testData.students.get("Student3Course3"), + testData.students.get("Student4Course3"), + }; + + Map courseIdToStudents = new HashMap<>(); + courseIdToStudents.put(course1.getId(), studentsInCourse1); + courseIdToStudents.put(course2.getId(), studentsInCourse2); + courseIdToStudents.put(course3.getId(), studentsInCourse3); + + Map courseIdToCourse = new HashMap<>(); + courseIdToCourse.put(course1.getId(), course1); + courseIdToCourse.put(course2.getId(), course2); + courseIdToCourse.put(course3.getId(), course3); + + listPage.verifyStudentDetails(courseIdToCourse, courseIdToStudents); + + ______TS("link: enroll page"); + + InstructorCourseEnrollPage enrollPage = listPage.clickEnrollStudents(course3); + enrollPage.verifyIsCorrectPage(course3.getId()); + + listPage = loginAdminToPage(listPageUrl, InstructorStudentListPage.class); + listPage.clickCourseTabHeader(course3); + + ______TS("link: view student details page"); + + StudentAttributes studentToView = testData.students.get("Student1Course3"); + String studentEmail = studentToView.getEmail(); + + InstructorCourseStudentDetailsViewPage studentDetailsViewPage = + listPage.clickViewStudent(course3, studentEmail); + studentDetailsViewPage.verifyIsCorrectPage(course3.getId(), studentEmail); + studentDetailsViewPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("link: edit student details page"); + + InstructorCourseStudentDetailsEditPage studentDetailsEditPage = + listPage.clickEditStudent(course3, studentEmail); + studentDetailsEditPage.verifyIsCorrectPage(course3.getId(), studentEmail); + studentDetailsEditPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("link: view all records page"); + + InstructorStudentRecordsPage studentRecordsPage = + listPage.clickViewAllRecords(course3, studentEmail); + studentRecordsPage.verifyIsCorrectPage(course3.getId(), studentToView.getName()); + studentRecordsPage.closeCurrentWindowAndSwitchToParentWindow(); + + ______TS("action: delete student"); + + StudentAttributes studentToDelete = testData.students.get("Student3Course3"); + + listPage.deleteStudent(course3, studentToDelete.getEmail()); + + StudentAttributes[] studentsAfterDelete = { + testData.students.get("Student1Course3"), + testData.students.get("Student2Course3"), + testData.students.get("Student4Course3"), + }; + + listPage.verifyStudentDetails(course3, studentsAfterDelete); + verifyAbsentInDatastore(studentToDelete); + + } + +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/InstructorStudentRecordsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/InstructorStudentRecordsPageE2ETest.java new file mode 100644 index 00000000000..e87ec0f2f1f --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/InstructorStudentRecordsPageE2ETest.java @@ -0,0 +1,49 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.attributes.StudentProfileAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.InstructorStudentRecordsPage; + +/** + * SUT: {@link Const.WebPageURIs#INSTRUCTOR_STUDENT_RECORDS_PAGE}. + */ +public class InstructorStudentRecordsPageE2ETest extends BaseE2ETestCase { + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/InstructorStudentRecordsPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + } + + @Test + public void testAll() { + + ______TS("verify loaded data: student details"); + + InstructorAttributes instructor = testData.instructors.get("teammates.test.CS2104"); + StudentAttributes student = testData.students.get("benny.c.tmms@ISR.CS2104"); + StudentProfileAttributes studentProfile = testData.profiles.get("benny.c.tmms@ISR.CS2104"); + + String instructorId = instructor.googleId; + String courseId = instructor.courseId; + String studentEmail = student.email; + + AppUrl recordsPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_RECORDS_PAGE) + .withUserId(instructorId) + .withCourseId(courseId) + .withStudentEmail(studentEmail); + + InstructorStudentRecordsPage recordsPage = loginAdminToPage(recordsPageUrl, InstructorStudentRecordsPage.class); + + recordsPage.verifyStudentDetails(studentProfile, student); + + // TODO add tests for feedback responses + + } + +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/StudentCourseDetailsPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/StudentCourseDetailsPageE2ETest.java index 774209ad1d5..bd41af6f77f 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/StudentCourseDetailsPageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/StudentCourseDetailsPageE2ETest.java @@ -1,13 +1,13 @@ package teammates.e2e.cases.e2e; -import org.openqa.selenium.By; import org.testng.annotations.Test; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.util.AppUrl; import teammates.common.util.Const; -import teammates.e2e.pageobjects.AppPage; import teammates.e2e.pageobjects.StudentCourseDetailsPage; -import teammates.e2e.pageobjects.StudentHomePage; /** * SUT: {@link Const.WebPageURIs#STUDENT_COURSE_DETAILS_PAGE}. @@ -24,26 +24,22 @@ protected void prepareTestData() { public void testAll() { AppUrl url = createUrl(Const.WebPageURIs.STUDENT_COURSE_DETAILS_PAGE) - .withCourseId("SCDetailsUiT.CS2104") - .withUserId(testData.students.get("SCDetailsUiT.alice").googleId); - loginAdminToPage(url, StudentHomePage.class); - AppPage.getNewPageInstance(browser, url, StudentCourseDetailsPage.class) - .waitForPageToLoad(); - - verifyContent(); - - logout(); - } - - private void verifyContent() { - String instructorDetails = browser.driver.findElements(By.tagName("tbody")).get(0).getText(); - String teammatesDetails = browser.driver.findElements(By.tagName("tbody")).get(1).getText(); - String courseDetails = browser.driver.findElements(By.className("form")).get(0).getText(); - String studentDetails = browser.driver.findElements(By.className("form")).get(1).getText(); - - assertTrue(courseDetails.contains(testData.courses.get("SCDetailsUiT.CS2104").getId())); - assertTrue(instructorDetails.contains(testData.instructors.get("SCDetailsUiT.instr").email)); - assertTrue(studentDetails.contains(testData.students.get("SCDetailsUiT.alice").email)); - assertTrue(teammatesDetails.contains(testData.profiles.get("SCDetailsUiT.student1InTSCourse").email)); + .withCourseId("SCDetailsE2eT.CS2104") + .withUserId(testData.students.get("SCDetailsE2eT.alice").googleId); + StudentCourseDetailsPage detailsPage = loginAdminToPage(url, StudentCourseDetailsPage.class); + + ______TS("verify loaded data"); + InstructorAttributes[] instructors = { testData.instructors.get("SCDetailsE2eT.instr"), + testData.instructors.get("SCDetailsE2eT.instr2") }; + StudentAttributes[] teammates = { testData.students.get("SCDetailsE2eT.benny"), + testData.students.get("SCDetailsE2eT.charlie") }; + StudentProfileAttributes[] teammatesProfiles = { testData.profiles.get("SCDetailsE2eT.benny"), + testData.profiles.get("SCDetailsE2eT.charlie") }; + + detailsPage.verifyCourseDetails(testData.courses.get("SCDetailsE2eT.CS2104")); + detailsPage.verifyInstructorsDetails(instructors); + detailsPage.verifyStudentDetails(testData.students.get("SCDetailsE2eT.alice")); + detailsPage.sortTeammatesByName(); + detailsPage.verifyTeammatesDetails(teammates, teammatesProfiles); } } diff --git a/src/e2e/java/teammates/e2e/cases/e2e/StudentCourseJoinConfirmationPageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/StudentCourseJoinConfirmationPageE2ETest.java new file mode 100644 index 00000000000..d679707267f --- /dev/null +++ b/src/e2e/java/teammates/e2e/cases/e2e/StudentCourseJoinConfirmationPageE2ETest.java @@ -0,0 +1,57 @@ +package teammates.e2e.cases.e2e; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.AppUrl; +import teammates.common.util.Const; +import teammates.e2e.pageobjects.AppPage; +import teammates.e2e.pageobjects.CourseJoinConfirmationPage; +import teammates.e2e.pageobjects.ErrorReportingModal; +import teammates.e2e.pageobjects.StudentHomePage; + +/** + * SUT: {@link Const.WebPageURIs#JOIN_PAGE}. + */ +public class StudentCourseJoinConfirmationPageE2ETest extends BaseE2ETestCase { + private StudentAttributes newStudent; + + @Override + protected void prepareTestData() { + testData = loadDataBundle("/StudentCourseJoinConfirmationPageE2ETest.json"); + removeAndRestoreDataBundle(testData); + + newStudent = testData.students.get("alice.tmms@SCJConfirmationE2eT.CS2104"); + newStudent.googleId = testData.accounts.get("alice.tmms").googleId; + } + + @Test + public void testAll() { + ______TS("Click join link: invalid key"); + String courseId = testData.courses.get("SCJConfirmationE2eT.CS2104").getId(); + String invalidEncryptedKey = "invalidKey"; + AppUrl joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) + .withRegistrationKey(invalidEncryptedKey) + .withCourseId(courseId) + .withEntityType(Const.EntityType.STUDENT) + .withUserId(newStudent.googleId); + ErrorReportingModal errorPage = loginAdminToPage(joinLink, ErrorReportingModal.class); + + errorPage.verifyErrorMessage("No student with given registration key: " + invalidEncryptedKey); + + ______TS("Click join link: valid key"); + joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) + .withRegistrationKey(getKeyForStudent(newStudent)) + .withCourseId(courseId) + .withEntityType(Const.EntityType.STUDENT) + .withUserId(newStudent.googleId); + CourseJoinConfirmationPage confirmationPage = loginAdminToPage(joinLink, CourseJoinConfirmationPage.class); + + confirmationPage.verifyJoiningUser(newStudent.googleId); + confirmationPage.confirmJoinCourse(StudentHomePage.class); + + ______TS("Already joined, no confirmation page"); + browser.driver.get(joinLink.toAbsoluteString()); + AppPage.getNewPageInstance(browser, StudentHomePage.class); + } +} diff --git a/src/e2e/java/teammates/e2e/cases/e2e/StudentHomePageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/StudentHomePageE2ETest.java index f54eb86038b..bf829fcdeab 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/StudentHomePageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/StudentHomePageE2ETest.java @@ -30,8 +30,6 @@ public void testAll() { AppUrl url = createUrl(Const.WebPageURIs.STUDENT_HOME_PAGE).withUserId("SHomeUiT.student"); loginAdminToPage(url, StudentHomePage.class); - browser.waitForPageLoad(); - List courseIds = getAllVisibleCourseIds(); for (int i = 0; i < courseIds.size(); i++) { diff --git a/src/e2e/java/teammates/e2e/cases/e2e/StudentProfilePageE2ETest.java b/src/e2e/java/teammates/e2e/cases/e2e/StudentProfilePageE2ETest.java index 370622a7117..09ae732f32f 100644 --- a/src/e2e/java/teammates/e2e/cases/e2e/StudentProfilePageE2ETest.java +++ b/src/e2e/java/teammates/e2e/cases/e2e/StudentProfilePageE2ETest.java @@ -5,8 +5,6 @@ import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.util.AppUrl; import teammates.common.util.Const; -import teammates.e2e.pageobjects.AppPage; -import teammates.e2e.pageobjects.StudentHomePage; import teammates.e2e.pageobjects.StudentProfilePage; /** @@ -26,8 +24,7 @@ public void testAll() { ______TS("Typical case: Log in with filled profile values"); AppUrl url = createUrl(Const.WebPageURIs.STUDENT_PROFILE_PAGE).withUserId("SProfUiT.student"); - loginAdminToPage(url, StudentHomePage.class); - StudentProfilePage profilePage = AppPage.getNewPageInstance(browser, url, StudentProfilePage.class); + StudentProfilePage profilePage = loginAdminToPage(url, StudentProfilePage.class); profilePage.ensureProfileContains("Ben", "i.m.benny@gmail.tmt", "TEAMMATES Test Institute 4", "Singaporean", StudentProfileAttributes.Gender.MALE, "I am just another student :P"); diff --git a/src/e2e/java/teammates/e2e/cases/lnp/BaseLNPTestCase.java b/src/e2e/java/teammates/e2e/cases/lnp/BaseLNPTestCase.java index 04f55a2f356..849ca3efbe3 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/BaseLNPTestCase.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/BaseLNPTestCase.java @@ -40,8 +40,8 @@ import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; import teammates.e2e.util.TestProperties; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.FileHelper; +import teammates.test.BaseTestCase; +import teammates.test.FileHelper; /** * Base class for all L&P test cases. diff --git a/src/e2e/java/teammates/e2e/cases/lnp/FeedbackQuestionUpdateLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/FeedbackQuestionUpdateLNPTest.java index cf10667f167..280c5db7a8c 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/FeedbackQuestionUpdateLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/FeedbackQuestionUpdateLNPTest.java @@ -35,8 +35,8 @@ import teammates.e2e.util.JMeterElements; import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; -import teammates.ui.webapi.output.NumberOfEntitiesToGiveFeedbackToSetting; -import teammates.ui.webapi.request.FeedbackQuestionUpdateRequest; +import teammates.ui.output.NumberOfEntitiesToGiveFeedbackToSetting; +import teammates.ui.request.FeedbackQuestionUpdateRequest; /** * L&P Test Case for feedback question update cascade API. @@ -306,7 +306,7 @@ private Map getRequestHeaders() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.QUESTION + return Const.ResourceURIs.QUESTION + "?courseid=${courseId}&fsname=${fsname}&questionid=${fqname_1}"; } diff --git a/src/e2e/java/teammates/e2e/cases/lnp/InstructorCourseUpdateLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/InstructorCourseUpdateLNPTest.java index 52763b8d410..92f18a46e8a 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/InstructorCourseUpdateLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/InstructorCourseUpdateLNPTest.java @@ -27,7 +27,7 @@ import teammates.e2e.util.JMeterElements; import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; -import teammates.ui.webapi.request.CourseUpdateRequest; +import teammates.ui.request.CourseUpdateRequest; /** * L&P Test Case for course update cascade API. @@ -173,7 +173,7 @@ private Map getRequestHeaders() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.COURSE + "?courseid=${courseId}"; + return Const.ResourceURIs.COURSE + "?courseid=${courseId}"; } @Override diff --git a/src/e2e/java/teammates/e2e/cases/lnp/InstructorStudentEnrollmentLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/InstructorStudentEnrollmentLNPTest.java index 69a541c5b9a..7952cdbc3b4 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/InstructorStudentEnrollmentLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/InstructorStudentEnrollmentLNPTest.java @@ -24,7 +24,7 @@ import teammates.e2e.util.JMeterElements; import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; -import teammates.ui.webapi.request.StudentsEnrollRequest; +import teammates.ui.request.StudentsEnrollRequest; /** * L&P Test Case for instructor's student enrollment API endpoint. @@ -148,7 +148,7 @@ private Map getRequestHeaders() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.STUDENTS + "?courseid=${courseId}"; + return Const.ResourceURIs.STUDENTS + "?courseid=${courseId}"; } @Override diff --git a/src/e2e/java/teammates/e2e/cases/lnp/InstructorUpdateLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/InstructorUpdateLNPTest.java index 52b812eafa6..98c1375fd1d 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/InstructorUpdateLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/InstructorUpdateLNPTest.java @@ -35,7 +35,7 @@ import teammates.e2e.util.JMeterElements; import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; -import teammates.ui.webapi.request.InstructorCreateRequest; +import teammates.ui.request.InstructorCreateRequest; /** * L&P Test Case for instructor update cascade API. @@ -312,7 +312,7 @@ private Map getRequestHeaders() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.INSTRUCTOR + "?courseid=${courseId}"; + return Const.ResourceURIs.INSTRUCTOR + "?courseid=${courseId}"; } @Override diff --git a/src/e2e/java/teammates/e2e/cases/lnp/StudentEmailUpdateLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/StudentEmailUpdateLNPTest.java index b80935341a8..e8f0ea6aabd 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/StudentEmailUpdateLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/StudentEmailUpdateLNPTest.java @@ -34,7 +34,7 @@ import teammates.e2e.util.JMeterElements; import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; -import teammates.ui.webapi.request.StudentUpdateRequest; +import teammates.ui.request.StudentUpdateRequest; /** * L&P Test Case for student update by email cascade API. @@ -265,7 +265,7 @@ private Map getRequestHeaders() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.STUDENT + return Const.ResourceURIs.STUDENT + "?courseid=${courseId}&studentid=${studentId}&studentemail=${studentEmail}"; } diff --git a/src/e2e/java/teammates/e2e/cases/lnp/StudentProfileLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/StudentProfileLNPTest.java index 5f8d16dd477..7a22f9a60b8 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/StudentProfileLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/StudentProfileLNPTest.java @@ -162,7 +162,7 @@ public List> generateCsvData() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.STUDENT_PROFILE + "?googleid=${googleId}"; + return Const.ResourceURIs.STUDENT_PROFILE + "?googleid=${googleId}"; } @Override diff --git a/src/e2e/java/teammates/e2e/cases/lnp/StudentSectionUpdateLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/StudentSectionUpdateLNPTest.java index 5a58b7735db..40487f9a6b9 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/StudentSectionUpdateLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/StudentSectionUpdateLNPTest.java @@ -34,7 +34,7 @@ import teammates.e2e.util.JMeterElements; import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; -import teammates.ui.webapi.request.StudentUpdateRequest; +import teammates.ui.request.StudentUpdateRequest; /** * L&P Test Case for student update by section name cascade API. @@ -265,7 +265,7 @@ private Map getRequestHeaders() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.STUDENT + return Const.ResourceURIs.STUDENT + "?courseid=${courseId}&studentid=${studentId}&studentemail=${studentEmail}"; } diff --git a/src/e2e/java/teammates/e2e/cases/lnp/StudentTeamUpdateLNPTest.java b/src/e2e/java/teammates/e2e/cases/lnp/StudentTeamUpdateLNPTest.java index 7e60e1e8eb3..9c127a9ad68 100644 --- a/src/e2e/java/teammates/e2e/cases/lnp/StudentTeamUpdateLNPTest.java +++ b/src/e2e/java/teammates/e2e/cases/lnp/StudentTeamUpdateLNPTest.java @@ -34,7 +34,7 @@ import teammates.e2e.util.JMeterElements; import teammates.e2e.util.LNPSpecification; import teammates.e2e.util.LNPTestData; -import teammates.ui.webapi.request.StudentUpdateRequest; +import teammates.ui.request.StudentUpdateRequest; /** * L&P Test Case for student update by team cascade API. @@ -278,7 +278,7 @@ private Map getRequestHeaders() { } private String getTestEndpoint() { - return Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.STUDENT + return Const.ResourceURIs.STUDENT + "?courseid=${courseId}&studentid=${studentId}&studentemail=${studentEmail}"; } diff --git a/src/e2e/java/teammates/e2e/cases/util/TestNgXmlTest.java b/src/e2e/java/teammates/e2e/cases/util/TestNgXmlTest.java index 8744f6aacc0..f38b65b25c2 100644 --- a/src/e2e/java/teammates/e2e/cases/util/TestNgXmlTest.java +++ b/src/e2e/java/teammates/e2e/cases/util/TestNgXmlTest.java @@ -7,8 +7,8 @@ import org.testng.annotations.Test; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.FileHelper; +import teammates.test.BaseTestCase; +import teammates.test.FileHelper; /** * Verifies that the testng-e2e.xml configuration file contains all the E2E test cases in the project. @@ -72,7 +72,7 @@ private Map addFilesToTestsRecursively(String path, boolean areF testFiles.put(name.replace(".java", ""), packageName); } else if (file.isDirectory() && !"lnp".equals(name)) { - // If the package name is in TestNG in the form of + // If the package name is in TestNG in the form of // then files in the current directory are excluded because the whole package would be tested by TestNG. testFiles.putAll( diff --git a/src/e2e/java/teammates/e2e/cases/util/TestPropertiesTest.java b/src/e2e/java/teammates/e2e/cases/util/TestPropertiesTest.java index f540d5fcd0b..ce4171adfff 100644 --- a/src/e2e/java/teammates/e2e/cases/util/TestPropertiesTest.java +++ b/src/e2e/java/teammates/e2e/cases/util/TestPropertiesTest.java @@ -3,7 +3,7 @@ import org.testng.annotations.Test; import teammates.e2e.util.TestProperties; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link TestProperties}. diff --git a/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java new file mode 100644 index 00000000000..e9091d9ced0 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/AdminAccountsPage.java @@ -0,0 +1,111 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.AccountAttributes; + +/** + * Page Object Model for the admin accounts page. + */ +public class AdminAccountsPage extends AppPage { + + @FindBy(id = "account-google-id") + private WebElement accountId; + + @FindBy(id = "account-name") + private WebElement accountName; + + @FindBy(id = "account-email") + private WebElement accountEmail; + + @FindBy(id = "account-institute") + private WebElement accountInstitute; + + @FindBy(id = "account-is-instructor") + private WebElement accountIsInstructor; + + @FindBy(id = "instructor-table") + private WebElement instructorTable; + + @FindBy(id = "student-table") + private WebElement studentTable; + + @FindBy(id = "btn-downgrade-account") + private WebElement downgradeAccountButton; + + @FindBy(id = "btn-delete-account") + private WebElement deleteAccountButton; + + public AdminAccountsPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageSource().contains("Account Details"); + } + + public void verifyAccountDetails(AccountAttributes account) { + assertEquals(account.getGoogleId(), accountId.getText()); + assertEquals(account.getName(), accountName.getText()); + assertEquals(account.getEmail(), accountEmail.getText()); + assertEquals(account.getInstitute(), accountInstitute.getText()); + assertEquals(account.isInstructor(), Boolean.parseBoolean(accountIsInstructor.getText())); + } + + public void clickRemoveInstructorFromCourse(String courseId) { + List instructorRows = + instructorTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); + + WebElement deleteButton = null; + for (WebElement instructorRow : instructorRows) { + List cells = instructorRow.findElements(By.tagName("td")); + if (cells.get(0).getText().startsWith("[" + courseId + "]")) { + deleteButton = cells.get(1).findElement(By.className("btn-danger")); + } + } + + if (deleteButton == null) { + fail("Instructor to be deleted is not found"); + } + click(deleteButton); + waitForPageToLoad(true); + } + + public void clickRemoveStudentFromCourse(String courseId) { + List studentRows = + studentTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); + + WebElement deleteButton = null; + for (WebElement studentRow : studentRows) { + List cells = studentRow.findElements(By.tagName("td")); + if (cells.get(0).getText().startsWith("[" + courseId + "]")) { + deleteButton = cells.get(1).findElement(By.className("btn-danger")); + } + } + + if (deleteButton == null) { + fail("Student to be deleted is not found"); + } + click(deleteButton); + waitForPageToLoad(true); + } + + public void clickDowngradeAccount() { + click(downgradeAccountButton); + waitForPageToLoad(true); + } + + public void clickDeleteAccount() { + click(deleteAccountButton); + waitForPageToLoad(true); + } + +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/AdminSearchPage.java b/src/e2e/java/teammates/e2e/pageobjects/AdminSearchPage.java index 6cb60ed9e20..8a5aeeede3b 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/AdminSearchPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/AdminSearchPage.java @@ -50,12 +50,6 @@ public class AdminSearchPage extends AppPage { @FindBy(id = "hide-instructor-links") private WebElement collapseInstructorLinksButton; - @FindBy(tagName = "tm-regenerate-links-confirm-modal") - private WebElement regenerateLinksModal; - - @FindBy(tagName = "tm-reset-google-id-confirm-modal") - private WebElement resetGoogleIdModal; - public AdminSearchPage(Browser browser) { super(browser); } @@ -83,7 +77,7 @@ public void regenerateLinksForStudent(StudentAttributes student) { studentRow.findElement(By.xpath("//button[text()='Regenerate links']")).click(); waitForPageToLoad(); - regenerateLinksModal.findElement(By.className("btn-warning")).click(); + waitForConfirmationModalAndClickOk(); waitForPageToLoad(true); } @@ -162,7 +156,7 @@ public void resetStudentGoogleId(StudentAttributes student) { studentRow.findElement(By.linkText(LINK_TEXT_RESET_GOOGLE_ID)).click(); waitForPageToLoad(); - resetGoogleIdModal.findElement(By.className("btn-warning")).click(); + waitForConfirmationModalAndClickOk(); waitForPageToLoad(); } @@ -210,7 +204,7 @@ public void resetInstructorGoogleId(InstructorAttributes instructor) { instructorRow.findElement(By.linkText(LINK_TEXT_RESET_GOOGLE_ID)).click(); waitForPageToLoad(); - resetGoogleIdModal.findElement(By.className("btn-warning")).click(); + waitForConfirmationModalAndClickOk(); waitForPageToLoad(); } diff --git a/src/e2e/java/teammates/e2e/pageobjects/AdminSessionsPage.java b/src/e2e/java/teammates/e2e/pageobjects/AdminSessionsPage.java new file mode 100644 index 00000000000..7b8392aed15 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/AdminSessionsPage.java @@ -0,0 +1,108 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +/** + * Page Object Model for the admin sessions page. + */ +public class AdminSessionsPage extends AppPage { + + @FindBy(id = "btn-toggle-filter") + private WebElement toggleFilterButton; + + @FindBy(id = "ongoing-sessions-table") + private WebElement ongoingSessionsTable; + + public AdminSessionsPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageSource().contains("Ongoing Sessions"); + } + + private List getOngoingSessionsRows() { + return ongoingSessionsTable.findElement(By.tagName("tbody")).findElements(By.tagName("tr")); + } + + public void verifySessionRows(String[][] sessionsCells, boolean[] expectedSessionShownStatus) { + assertEquals(sessionsCells.length, expectedSessionShownStatus.length); + + boolean[] actualSessionShownStatus = new boolean[expectedSessionShownStatus.length]; + + List ongoingSessionRows = getOngoingSessionsRows(); + for (WebElement sessionRow : ongoingSessionRows) { + List cells = sessionRow.findElements(By.tagName("td")); + + // Only validate for the preset ongoing sessions + // This is because the page will display all ongoing sessions in the database, which is not predictable + + for (int i = 0; i < sessionsCells.length; i++) { + String[] sessionCells = sessionsCells[i]; + if (sessionCells[1].equals(cells.get(1).getText())) { + verifyTableRowValues(sessionRow, sessionCells); + actualSessionShownStatus[i] = true; + } + } + } + + for (int i = 0; i < expectedSessionShownStatus.length; i++) { + assertEquals(expectedSessionShownStatus[i], actualSessionShownStatus[i]); + } + } + + public void toggleSessionFilter() { + click(toggleFilterButton); + } + + public void waitForSessionFilterVisibility() { + By by = By.id("filter-section"); + waitForElementVisibility(by); + } + + public void setFilterStartDate(Instant instant) { + WebElement timezoneElement = browser.driver.findElement(By.id("filter-timezone")); + String timezone = getSelectedDropdownOptionText(timezoneElement); + + WebElement startDate = browser.driver.findElement(By.id("start-date")); + fillTextBox(startDate, formatDateTimeForFilter(instant, ZoneId.of(timezone))); + } + + public void setFilterEndDate(Instant instant) { + WebElement timezoneElement = browser.driver.findElement(By.id("filter-timezone")); + String timezone = getSelectedDropdownOptionText(timezoneElement); + + WebElement endDate = browser.driver.findElement(By.id("end-date")); + fillTextBox(endDate, formatDateTimeForFilter(instant, ZoneId.of(timezone))); + } + + public void filterSessions() { + By by = By.id("btn-get-sessions"); + waitForElementPresence(by); + click(by); + waitForPageToLoad(); + waitUntilAnimationFinish(); + } + + private String formatDateTimeForFilter(Instant instant, ZoneId timeZone) { + return DateTimeFormatter + .ofPattern("YYYY-MM-dd") + .format(instant.atZone(timeZone)); + } + + public String getSessionsTableTimezone() { + WebElement timezoneElement = browser.driver.findElement(By.id("table-timezone")); + return getSelectedDropdownOptionText(timezoneElement); + } + +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/AppPage.java b/src/e2e/java/teammates/e2e/pageobjects/AppPage.java index 56774753323..ab67b959b87 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/AppPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/AppPage.java @@ -3,6 +3,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.File; @@ -26,6 +27,7 @@ import org.openqa.selenium.support.PageFactory; import org.openqa.selenium.support.ui.ExpectedCondition; import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.Select; import org.openqa.selenium.support.ui.WebDriverWait; import teammates.common.util.ThreadHelper; @@ -34,7 +36,7 @@ import teammates.common.util.retry.RetryManager; import teammates.common.util.retry.RetryableTask; import teammates.e2e.util.TestProperties; -import teammates.test.driver.FileHelper; +import teammates.test.FileHelper; /** * An abstract class that represents a browser-loaded page of the app and @@ -83,10 +85,16 @@ public AppPage(Browser browser) { this.browser = browser; this.firefoxChangeHandler = new FirefoxChangeHandler(); //legit firefox - boolean isCorrectPageType = containsExpectedPageContents(); + boolean isCorrectPageType; - if (isCorrectPageType) { - return; + try { + isCorrectPageType = containsExpectedPageContents(); + + if (isCorrectPageType) { + return; + } + } catch (Exception e) { + // ignore and try again } // To minimize test failures due to eventual consistency, we try to @@ -113,6 +121,7 @@ public AppPage(Browser browser) { */ public static T getNewPageInstance(Browser currentBrowser, Url url, Class typeOfPage) { currentBrowser.driver.get(url.toAbsoluteString()); + currentBrowser.waitForPageLoad(); return getNewPageInstance(currentBrowser, typeOfPage); } @@ -131,13 +140,6 @@ public static T getNewPageInstance(Browser currentBrowser, C } } - /** - * Gives an AppPage instance based on the given Browser. - */ - public static AppPage getNewPageInstance(Browser currentBrowser) { - return getNewPageInstance(currentBrowser, GenericAppPage.class); - } - /** * Fails if the new page content does not match content expected in a page of * the type indicated by the parameter {@code newPageType}. @@ -190,6 +192,12 @@ public void waitForElementToBeClickable(WebElement element) { waitFor(ExpectedConditions.elementToBeClickable(element)); } + public void waitUntilAnimationFinish() { + WebDriverWait wait = new WebDriverWait(browser.driver, 2); + wait.until(ExpectedConditions.invisibilityOfElementLocated(By.className("ng-animating"))); + ThreadHelper.waitFor(500); + } + /** * Waits until an element is no longer attached to the DOM or the timeout expires. * @param element the WebElement @@ -201,6 +209,14 @@ public void waitForElementStaleness(WebElement element) { waitFor(ExpectedConditions.stalenessOf(element)); } + public void verifyUnclickable(WebElement element) { + if (element.getTagName().equals("a")) { + assertTrue(element.getAttribute("class").contains("disabled")); + } else { + assertNotNull(element.getAttribute("disabled")); + } + } + /** * Waits for a confirmation modal to appear and click the confirm button. */ @@ -263,9 +279,7 @@ public String getTitle() { } public String getPageTitle() { - By headerTag = By.tagName("h1"); - waitForElementPresence(headerTag); - return browser.driver.findElement(headerTag).getText(); + return waitForElementPresence(By.tagName("h1")).getText(); } public void click(By by) { @@ -372,27 +386,67 @@ protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) { } /** - * 'check' the check box, if it is not already 'checked'. - * No action taken if it is already 'checked'. + * Get rich text from editor. + */ + protected String getEditorRichText(WebElement editor) { + waitForElementPresence(By.tagName("iframe")); + browser.driver.switchTo().frame(editor.findElement(By.tagName("iframe"))); + + String innerHtml = browser.driver.findElement(By.id("tinymce")).getAttribute("innerHTML"); + // check if editor is empty + innerHtml = innerHtml.contains("data-mce-bogus") ? "" : innerHtml; + browser.driver.switchTo().defaultContent(); + return innerHtml; + } + + /** + * Write rich text to editor. + */ + protected void writeToRichTextEditor(WebElement editor, String text) { + waitForElementPresence(By.tagName("iframe")); + String id = editor.findElement(By.tagName("textarea")).getAttribute("id"); + executeScript(String.format("tinyMCE.get('%s').setContent('%s');" + + " tinyMCE.get('%s').save()", id, text, id)); + } + + /** + * Select the option, if it is not already selected. + * No action taken if it is already selected. */ - protected void markCheckBoxAsChecked(WebElement checkBox) { - waitForElementVisibility(checkBox); - if (!checkBox.isSelected()) { - click(checkBox); + protected void markOptionAsSelected(WebElement option) { + waitForElementVisibility(option); + if (!option.isSelected()) { + click(option); } } /** - * 'uncheck' the check box, if it is not already 'unchecked'. - * No action taken if it is already 'unchecked'. + * Unselect the option, if it is not already unselected. + * No action taken if it is already unselected'. */ - protected void markCheckBoxAsUnchecked(WebElement checkBox) { - waitForElementVisibility(checkBox); - if (checkBox.isSelected()) { - click(checkBox); + protected void markOptionAsUnselected(WebElement option) { + waitForElementVisibility(option); + if (option.isSelected()) { + click(option); } } + /** + * Returns the text of the option selected in the dropdown. + */ + protected String getSelectedDropdownOptionText(WebElement dropdown) { + Select select = new Select(dropdown); + return select.getFirstSelectedOption().getText(); + } + + /** + * Selects option in dropdown based on visible text. + */ + protected void selectDropdownOptionByText(WebElement dropdown, String text) { + Select select = new Select(dropdown); + select.selectByVisibleText(text); + } + /** * Returns the value of the cell located at {@code (row, column)} * from the first table (which is of type {@code class=table}) in the page. @@ -554,10 +608,17 @@ public void clickDismissModalButtonAndWaitForModalHidden(WebElement dismissModal */ void scrollElementToCenterAndClick(WebElement element) { // TODO: migrate to `scrollIntoView` when Geckodriver is adopted - executeScript(SCROLL_ELEMENT_TO_CENTER_AND_CLICK_SCRIPT, element); + scrollElementToCenter(element); element.click(); } + /** + * Scrolls element to center. + */ + void scrollElementToCenter(WebElement element) { + executeScript(SCROLL_ELEMENT_TO_CENTER_AND_CLICK_SCRIPT, element); + } + /** * Asserts message in toast is equal to the expected message. */ @@ -599,6 +660,20 @@ protected void setWindowSize(int x, int y) { browser.driver.manage().window().setSize(d); } + /** + * Switches to the new browser window just opened. + */ + protected void switchToNewWindow() { + browser.switchToNewWindow(); + } + + /** + * Closes current window and switches back to parent window. + */ + public void closeCurrentWindowAndSwitchToParentWindow() { + browser.closeCurrentWindowAndSwitchToParentWindow(); + } + /** * Encapsulates methods for handling Firefox {@code change} events. The methods can only handle one {@value CHANGE_EVENT} * event at a time and will only do something useful if test browser is Firefox. Note that the class does not check if diff --git a/src/e2e/java/teammates/e2e/pageobjects/Browser.java b/src/e2e/java/teammates/e2e/pageobjects/Browser.java index bf6ada728df..1fa194136b9 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/Browser.java +++ b/src/e2e/java/teammates/e2e/pageobjects/Browser.java @@ -1,19 +1,27 @@ package teammates.e2e.pageobjects; +import java.io.File; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; import java.util.Stack; +import java.util.concurrent.TimeUnit; import org.openqa.selenium.JavascriptExecutor; +import org.openqa.selenium.ScriptTimeoutException; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile; +import org.openqa.selenium.firefox.ProfilesIni; import org.openqa.selenium.support.ui.WebDriverWait; import teammates.e2e.util.TestProperties; -import teammates.test.driver.FileHelper; +import teammates.test.FileHelper; /** * A programmatic interface to the Browser used to test the app. @@ -41,12 +49,6 @@ public class Browser { */ public boolean isAdminLoggedIn; - /** - * Indicates to the {@link BrowserPool} that this object is currently being used - * and not ready to be reused by another test. - */ - boolean isInUse; - /** * Keeps track of multiple windows opened by the {@link WebDriver}. */ @@ -55,7 +57,8 @@ public class Browser { public Browser() { this.driver = createWebDriver(); this.driver.manage().window().maximize(); - this.isInUse = false; + this.driver.manage().timeouts().pageLoadTimeout(TestProperties.TEST_TIMEOUT * 2, TimeUnit.SECONDS); + this.driver.manage().timeouts().setScriptTimeout(TestProperties.TEST_TIMEOUT, TimeUnit.SECONDS); this.isAdminLoggedIn = false; } @@ -87,12 +90,16 @@ public void waitForPageLoad() { * as criteria for page load's completion. */ public void waitForPageLoad(boolean excludeToast) { - WebDriverWait wait = new WebDriverWait(driver, TestProperties.TEST_TIMEOUT); - wait.until(driver -> { - return "complete".equals( - ((JavascriptExecutor) driver).executeAsyncScript(PAGE_LOAD_SCRIPT, excludeToast ? 1 : 0) - ); - }); + try { + WebDriverWait wait = new WebDriverWait(driver, TestProperties.TEST_TIMEOUT); + wait.until(driver -> { + return "complete".equals( + ((JavascriptExecutor) driver).executeAsyncScript(PAGE_LOAD_SCRIPT, excludeToast ? 1 : 0) + ); + }); + } catch (ScriptTimeoutException e) { + System.out.println("Page could not load completely. Trying to continue test."); + } } /** @@ -116,6 +123,14 @@ public void closeCurrentWindowAndSwitchToParentWindow() { private WebDriver createWebDriver() { System.out.print("Initializing Selenium: "); + String downloadPath; + try { + downloadPath = new File(TestProperties.TEST_DOWNLOADS_FOLDER).getCanonicalPath(); + System.out.println("Download path: " + downloadPath); + } catch (IOException e) { + throw new RuntimeException(e); + } + String browser = TestProperties.BROWSER; if (TestProperties.BROWSER_FIREFOX.equals(browser)) { System.out.println("Using Firefox with driver path: " + TestProperties.GECKODRIVER_PATH); @@ -126,15 +141,28 @@ private WebDriver createWebDriver() { } System.setProperty("webdriver.gecko.driver", TestProperties.GECKODRIVER_PATH); + FirefoxProfile profile; + if (TestProperties.isDevServer()) { + profile = new FirefoxProfile(); + profile.setPreference("browser.private.browsing.autostart", true); + } else { + // Get user data from browser to bypass google blocking automated log in. + // Log in manually to teammates to use that log in data for e2e tests. + ProfilesIni profileIni = new ProfilesIni(); + profile = profileIni.getProfile(TestProperties.FIREFOX_PROFILE_NAME); + if (profile == null) { + throw new RuntimeException("Firefox profile not found. Failed to create webdriver."); + } + } + // Allow CSV files to be download automatically, without a download popup. // This method is used because Selenium cannot directly interact with the download dialog. // Taken from http://stackoverflow.com/questions/24852709 - FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("browser.download.panel.shown", false); profile.setPreference("browser.helperApps.neverAsk.openFile", "text/csv,application/vnd.ms-excel"); profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv,application/vnd.ms-excel"); profile.setPreference("browser.download.folderList", 2); - profile.setPreference("browser.download.dir", System.getProperty("java.io.tmpdir")); + profile.setPreference("browser.download.dir", downloadPath); FirefoxOptions options = new FirefoxOptions().setProfile(profile); return new FirefoxDriver(options); @@ -144,8 +172,24 @@ private WebDriver createWebDriver() { System.out.println("Using Chrome with driver path: " + TestProperties.CHROMEDRIVER_PATH); System.setProperty("webdriver.chrome.driver", TestProperties.CHROMEDRIVER_PATH); + Map chromePrefs = new HashMap<>(); + chromePrefs.put("download.default_directory", downloadPath); + chromePrefs.put("profile.default_content_settings.popups", 0); ChromeOptions options = new ChromeOptions(); + options.setExperimentalOption("prefs", chromePrefs); options.addArguments("--allow-file-access-from-files"); + if (TestProperties.isDevServer()) { + options.addArguments("incognito"); + } else { + // Get user data from browser to bypass google blocking automated log in. + // Log in manually to teammates to use that log in data for e2e tests. + if (TestProperties.CHROME_USER_DATA_PATH.isEmpty() + || !Files.exists(Paths.get(TestProperties.CHROME_USER_DATA_PATH))) { + throw new RuntimeException("Chrome user data path not found. Failed to create webdriver."); + } + options.addArguments("user-data-dir=" + TestProperties.CHROME_USER_DATA_PATH); + } + return new ChromeDriver(options); } diff --git a/src/e2e/java/teammates/e2e/pageobjects/BrowserPool.java b/src/e2e/java/teammates/e2e/pageobjects/BrowserPool.java deleted file mode 100644 index 7c0e9b4b23b..00000000000 --- a/src/e2e/java/teammates/e2e/pageobjects/BrowserPool.java +++ /dev/null @@ -1,88 +0,0 @@ -package teammates.e2e.pageobjects; - -import java.util.ArrayList; -import java.util.List; - -/** - * Manage the pool of {@link Browser} instances. - * This class is thread-safe. - */ -public final class BrowserPool { - - // This class is implemented as a Singleton class. - // The reason we're not implementing this class as static because we want to use wait() and notify(). - - /** - * Maximum number of browsers in the pool. - * - *

Ideally, should be equal to the number of threads used for testing. - */ - private static final int CAPACITY = System.getenv("CI") == null ? 9 + 1 : 2; - // +1 in case a sequential ui test uses a browser other than the first in pool - - private static BrowserPool instance; - private List pool; - - private BrowserPool() { - pool = new ArrayList<>(CAPACITY); - } - - private static BrowserPool getInstance() { - synchronized (BrowserPool.class) { - if (instance == null) { - instance = new BrowserPool(); - } - return instance; - } - } - - /** - * Returns a Browser object ready to be used. - */ - public static Browser getBrowser() { - return getInstance().requestInstance(); - } - - /** - * Releases a Browser instance back to the pool, ready to be reused. - */ - public static void release(Browser browser) { - BrowserPool pool = getInstance(); - // Synchronized to ensure thread-safety - synchronized (pool) { - browser.isInUse = false; - pool.notifyAll(); - } - } - - private Browser requestInstance() { - while (true) { - // Synchronized to ensure thread-safety - synchronized (this) { - // Look for instantiated and available object. - for (Browser browser : pool) { - if (!browser.isInUse) { - browser.isInUse = true; - return browser; - } - } - - // If less than capacity, create new object - if (pool.size() < CAPACITY) { - Browser browser = new Browser(); - browser.isInUse = true; - pool.add(browser); - return browser; - } - - // Wait if no more free objects and no more capacity. - try { - wait(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - } - } - -} diff --git a/src/e2e/java/teammates/e2e/pageobjects/CourseJoinConfirmationPage.java b/src/e2e/java/teammates/e2e/pageobjects/CourseJoinConfirmationPage.java new file mode 100644 index 00000000000..eb12a509047 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/CourseJoinConfirmationPage.java @@ -0,0 +1,34 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +/** + * Page Object Model for the course join confirmation page. + */ +public class CourseJoinConfirmationPage extends AppPage { + @FindBy(id = "btn-confirm") + private WebElement confirmButton; + + public CourseJoinConfirmationPage(Browser browser) { + super(browser); + } + + @Override + public boolean containsExpectedPageContents() { + return waitForElementPresence(By.tagName("h3")).getText().contains("Confirm your Google account"); + } + + public void verifyJoiningUser(String googleId) { + assertEquals(browser.driver.findElement(By.id("user-id")).getText(), googleId); + } + + public T confirmJoinCourse(Class typeOfPage) { + click(confirmButton); + waitForPageToLoad(); + return changePageType(typeOfPage); + } +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/DevServerLoginPage.java b/src/e2e/java/teammates/e2e/pageobjects/DevServerLoginPage.java index 965da92e9b6..182add39193 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/DevServerLoginPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/DevServerLoginPage.java @@ -33,7 +33,7 @@ public void loginAsAdmin(String adminUsername, String adminPassword) { fillTextBox(emailTextBox, adminUsername); click(isAdminCheckBox); click(loginButton); - waitForElementVisibility(By.tagName("h1")); + waitForPageToLoad(); browser.isAdminLoggedIn = true; } @@ -46,7 +46,7 @@ public StudentHomePage loginAsStudent(String username, String password) { public T loginAsStudent(String username, String password, Class typeOfPage) { fillTextBox(emailTextBox, username); click(loginButton); - waitForElementVisibility(By.tagName("h1")); + waitForPageToLoad(); browser.isAdminLoggedIn = false; return changePageType(typeOfPage); } diff --git a/src/e2e/java/teammates/e2e/pageobjects/ErrorReportingModal.java b/src/e2e/java/teammates/e2e/pageobjects/ErrorReportingModal.java new file mode 100644 index 00000000000..0dbd67eba73 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/ErrorReportingModal.java @@ -0,0 +1,25 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import org.openqa.selenium.By; + +/** + * Page Object Model for the error reporting modal. + */ +public class ErrorReportingModal extends AppPage { + + public ErrorReportingModal(Browser browser) { + super(browser); + } + + @Override + public boolean containsExpectedPageContents() { + return waitForElementPresence(By.tagName("h2")).getText().contains("Uh oh! Something went wrong."); + } + + public void verifyErrorMessage(String message) { + assertEquals(browser.driver.findElement(By.id("error-message")).getText(), + "The server returns the following error message: \"" + message + "\"."); + } +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/FeedbackSubmitPage.java b/src/e2e/java/teammates/e2e/pageobjects/FeedbackSubmitPage.java new file mode 100644 index 00000000000..8b3c4d717ec --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/FeedbackSubmitPage.java @@ -0,0 +1,894 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.Collections; +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.TimeoutException; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.FeedbackParticipantType; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.questions.FeedbackConstantSumQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackConstantSumResponseDetails; +import teammates.common.datatransfer.questions.FeedbackContributionQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackContributionResponseDetails; +import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMcqResponseDetails; +import teammates.common.datatransfer.questions.FeedbackMsqQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMsqResponseDetails; +import teammates.common.datatransfer.questions.FeedbackNumericalScaleQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackNumericalScaleResponseDetails; +import teammates.common.datatransfer.questions.FeedbackRankOptionsQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRankOptionsResponseDetails; +import teammates.common.datatransfer.questions.FeedbackRankQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRankRecipientsResponseDetails; +import teammates.common.datatransfer.questions.FeedbackRubricQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRubricResponseDetails; +import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; +import teammates.common.util.Const; + +/** + * Represents the feedback submission page of the website. + */ +public class FeedbackSubmitPage extends AppPage { + + @FindBy(id = "confirmation-email-checkbox") + private WebElement confirmationEmailCheckbox; + + public FeedbackSubmitPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + if (isElementPresent(By.className("modal-content"))) { + waitForConfirmationModalAndClickOk(); + } + reloadPageIfStuckLoading(); + return getPageTitle().contains("Submit Feedback"); + } + + public void verifyFeedbackSessionDetails(FeedbackSessionAttributes feedbackSession) { + assertEquals(getCourseId(), feedbackSession.getCourseId()); + assertEquals(getFeedbackSessionName(), feedbackSession.getFeedbackSessionName()); + assertDateEquals(getOpeningTime(), feedbackSession.getStartTime(), feedbackSession.getTimeZone()); + assertDateEquals(getClosingTime(), feedbackSession.getEndTime(), feedbackSession.getTimeZone()); + assertEquals(getInstructions(), feedbackSession.getInstructions()); + } + + public void verifyNumQuestions(int expected) { + assertEquals(browser.driver.findElements(By.id("question-submission-form")).size(), expected); + } + + public void verifyQuestionDetails(int qnNumber, FeedbackQuestionAttributes questionAttributes) { + assertEquals(getQuestionBrief(qnNumber), questionAttributes.getQuestionDetails().getQuestionText()); + verifyVisibilityList(qnNumber, questionAttributes); + if (questionAttributes.getQuestionDescription() != null) { + assertEquals(getQuestionDescription(qnNumber), questionAttributes.getQuestionDescription()); + } + } + + public void verifyLimitedRecipients(int qnNumber, int numRecipients, List recipientNames) { + List recipientDropdowns = getQuestionForm(qnNumber).findElements(By.id("recipient-dropdown")); + assertEquals(numRecipients, recipientDropdowns.size()); + List recipients = recipientDropdowns.get(0).findElements(By.tagName("option")); + assertEquals(recipientNames.size(), recipients.size() - 1); + Collections.sort(recipientNames); + for (int i = 0; i < recipientNames.size(); i++) { + assertEquals(recipientNames.get(i), recipients.get(i + 1).getText()); + } + } + + public void verifyRecipients(int qnNumber, List recipientNames, String role) { + WebElement questionForm = getQuestionForm(qnNumber); + Collections.sort(recipientNames); + for (int i = 0; i < recipientNames.size(); i++) { + assertEquals(recipientNames.get(i) + " (" + role + ")", + questionForm.findElement(By.id("recipient-name-" + i)).getText()); + } + } + + public void verifyWarningMessageForPartialResponse(int[] unansweredQuestions) { + click(getSubmitButton()); + StringBuilder expectedSb = new StringBuilder(); + for (int unansweredQuestion : unansweredQuestions) { + expectedSb.append(unansweredQuestion).append(", "); + } + String expectedString = expectedSb.toString().substring(0, expectedSb.length() - 2) + "."; + String warningString = waitForElementPresence(By.id("not-answered-questions")).getText(); + assertEquals(warningString.split(": ")[1], expectedString); + waitForConfirmationModalAndClickOk(); + } + + public void verifyCannotSubmit() { + assertFalse(getSubmitButton().isEnabled()); + } + + public void markWithConfirmationEmail() { + markOptionAsSelected(confirmationEmailCheckbox); + } + + public void addComment(int qnNumber, String recipient, String newComment) { + WebElement commentSection = getCommentSection(qnNumber, recipient); + click(commentSection.findElement(By.id("btn-add-comment"))); + writeToCommentEditor(commentSection, newComment); + clickSubmitButton(); + } + + public void editComment(int qnNumber, String recipient, String editedComment) { + WebElement commentSection = getCommentSection(qnNumber, recipient); + click(commentSection.findElement(By.id("btn-edit-comment"))); + writeToCommentEditor(commentSection, editedComment); + clickSubmitButton(); + } + + public void deleteComment(int qnNumber, String recipient) { + clickAndConfirm(getCommentSection(qnNumber, recipient).findElement(By.id("btn-delete-comment"))); + } + + public void verifyComment(int qnNumber, String recipient, String expectedComment) { + WebElement commentSection = getCommentSection(qnNumber, recipient); + String actualComment = commentSection.findElement(By.id("comment-text")).getAttribute("innerHTML"); + assertEquals(expectedComment, actualComment); + } + + public void verifyNoCommentPresent(int qnNumber, String recipient) { + int numComments = getCommentSection(qnNumber, recipient).findElements(By.id("comment-text")).size(); + assertEquals(numComments, 0); + } + + public void verifyTextQuestion(int qnNumber, FeedbackTextQuestionDetails questionDetails) { + String recommendedLengthText = getQuestionForm(qnNumber).findElement(By.id("recommended-length")).getText(); + assertEquals(recommendedLengthText, "Recommended length for the answer: " + + questionDetails.getRecommendedLength() + " words"); + } + + public void submitTextResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackTextResponseDetails responseDetails = (FeedbackTextResponseDetails) response.getResponseDetails(); + writeToRichTextEditor(getTextResponseEditor(qnNumber, recipient), responseDetails.getAnswer()); + clickSubmitButton(); + } + + public void verifyTextResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackTextResponseDetails responseDetails = (FeedbackTextResponseDetails) response.getResponseDetails(); + int responseLength = responseDetails.getAnswer().split(" ").length; + assertEquals(getEditorRichText(getTextResponseEditor(qnNumber, recipient)), responseDetails.getAnswer()); + assertEquals(getResponseLengthText(qnNumber, recipient), "Response length: " + responseLength + + " words"); + } + + public void verifyMcqQuestion(int qnNumber, String recipient, FeedbackMcqQuestionDetails questionDetails) { + List mcqChoices = questionDetails.getMcqChoices(); + List optionTexts = getMcqOptions(qnNumber, recipient); + + for (int i = 0; i < mcqChoices.size(); i++) { + assertEquals(mcqChoices.get(i), optionTexts.get(i).getText()); + } + + if (questionDetails.isOtherEnabled()) { + assertEquals("Other", getMcqSection(qnNumber, recipient).findElement(By.id("other-option")).getText()); + } + } + + public void verifyGeneratedMcqQuestion(int qnNumber, String recipient, List options) { + List optionTexts = getMcqOptions(qnNumber, recipient); + for (int i = 0; i < options.size(); i++) { + assertEquals(options.get(i), optionTexts.get(i).getText()); + } + } + + public void submitMcqResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackMcqResponseDetails responseDetails = (FeedbackMcqResponseDetails) response.getResponseDetails(); + if (responseDetails.isOther()) { + markOptionAsSelected(getMcqOtherOptionRadioBtn(qnNumber, recipient)); + fillTextBox(getMcqOtherOptionTextbox(qnNumber, recipient), responseDetails.getOtherFieldContent()); + } else { + List optionTexts = getMcqOptions(qnNumber, recipient); + for (int i = 0; i < optionTexts.size(); i++) { + if (optionTexts.get(i).getText().equals(responseDetails.getAnswer())) { + markOptionAsSelected(getMcqRadioBtns(qnNumber, recipient).get(i)); + break; + } + } + } + clickSubmitButton(); + } + + public void verifyMcqResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackMcqResponseDetails responseDetails = (FeedbackMcqResponseDetails) response.getResponseDetails(); + if (responseDetails.isOther()) { + assertTrue(getMcqOtherOptionRadioBtn(qnNumber, recipient).isSelected()); + assertEquals(getMcqOtherOptionTextbox(qnNumber, recipient).getAttribute("value"), + responseDetails.getOtherFieldContent()); + } else { + List optionTexts = getMcqOptions(qnNumber, recipient); + List radioBtns = getMcqRadioBtns(qnNumber, recipient); + for (int i = 0; i < optionTexts.size(); i++) { + if (optionTexts.get(i).getText().equals(responseDetails.getAnswer())) { + assertTrue(radioBtns.get(i).isSelected()); + break; + } + assertFalse(radioBtns.get(i).isSelected()); + } + } + } + + public void verifyMsqQuestion(int qnNumber, String recipient, FeedbackMsqQuestionDetails questionDetails) { + List msqChoices = questionDetails.getMsqChoices(); + if (questionDetails.isOtherEnabled()) { + msqChoices.add("Other"); + } + if (questionDetails.getMinSelectableChoices() == Integer.MIN_VALUE) { + msqChoices.add("None of the above"); + } + List optionTexts = getMsqOptions(qnNumber, recipient); + for (int i = 0; i < msqChoices.size(); i++) { + assertEquals(msqChoices.get(i), optionTexts.get(i).getText()); + } + verifyMsqSelectableOptionsMessage(qnNumber, questionDetails); + } + + private void verifyMsqSelectableOptionsMessage(int qnNumber, FeedbackMsqQuestionDetails questionDetails) { + if (questionDetails.getMinSelectableChoices() > Integer.MIN_VALUE) { + assertEquals(getQuestionForm(qnNumber).findElement(By.id("min-options-message")).getText(), + "Choose at least " + questionDetails.getMinSelectableChoices() + " options."); + } + if (questionDetails.getMaxSelectableChoices() > Integer.MIN_VALUE) { + assertEquals(getQuestionForm(qnNumber).findElement(By.id("max-options-message")).getText(), + "Choose no more than " + questionDetails.getMaxSelectableChoices() + " options."); + } + } + + public void verifyGeneratedMsqQuestion(int qnNumber, String recipient, FeedbackMsqQuestionDetails questionDetails, + List options) { + List optionTexts = getMsqOptions(qnNumber, recipient); + for (int i = 0; i < options.size(); i++) { + assertEquals(options.get(i), optionTexts.get(i).getText()); + } + verifyMsqSelectableOptionsMessage(qnNumber, questionDetails); + } + + public void submitMsqResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackMsqResponseDetails responseDetails = (FeedbackMsqResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswers(); + if (answers.get(0).isEmpty()) { + answers.add("None of the above"); + } + List optionTexts = getMsqOptions(qnNumber, recipient); + List checkboxes = getMsqCheckboxes(qnNumber, recipient); + for (int i = 0; i < optionTexts.size(); i++) { + if (answers.contains(optionTexts.get(i).getText())) { + markOptionAsSelected(checkboxes.get(i)); + } else { + markOptionAsUnselected(checkboxes.get(i)); + } + } + if (responseDetails.isOther()) { + markOptionAsSelected(getMsqOtherOptionCheckbox(qnNumber, recipient)); + fillTextBox(getMsqOtherOptionTextbox(qnNumber, recipient), responseDetails.getOtherFieldContent()); + } + clickSubmitButton(); + } + + public void verifyMsqResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackMsqResponseDetails responseDetails = (FeedbackMsqResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswers(); + if (answers.get(0).isEmpty()) { + answers.add("None of the above"); + } + List optionTexts = getMsqOptions(qnNumber, recipient); + List checkboxes = getMsqCheckboxes(qnNumber, recipient); + for (int i = 0; i < optionTexts.size(); i++) { + if (answers.contains(optionTexts.get(i).getText())) { + assertTrue(checkboxes.get(i).isSelected()); + } else if (optionTexts.get(i).getText().equals("Other")) { + assertEquals(checkboxes.get(i).isSelected(), responseDetails.isOther()); + } else { + assertFalse(checkboxes.get(i).isSelected()); + } + } + if (responseDetails.isOther()) { + assertEquals(getMsqOtherOptionTextbox(qnNumber, recipient).getAttribute("value"), + responseDetails.getOtherFieldContent()); + } + } + + public void verifyNumScaleQuestion(int qnNumber, String recipient, + FeedbackNumericalScaleQuestionDetails questionDetails) { + double step = questionDetails.getStep(); + double twoSteps = 2 * step; + double min = questionDetails.getMinScale(); + double max = questionDetails.getMaxScale(); + String possibleValues = String.format("Possible values: [%s, %s, %s, ..., %s, %s, %s]", + getDoubleString(min), getDoubleString(min + step), getDoubleString(min + twoSteps), + getDoubleString(max - twoSteps), getDoubleString(max - step), getDoubleString(max)); + String actualValues = getNumScaleSection(qnNumber, recipient).findElement(By.id("possible-values")).getText(); + assertEquals(actualValues, possibleValues); + } + + public void submitNumScaleResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackNumericalScaleResponseDetails responseDetails = + (FeedbackNumericalScaleResponseDetails) response.getResponseDetails(); + fillTextBox(getNumScaleInput(qnNumber, recipient), Double.toString(responseDetails.getAnswer())); + clickSubmitButton(); + } + + public void verifyNumScaleResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackNumericalScaleResponseDetails responseDetails = + (FeedbackNumericalScaleResponseDetails) response.getResponseDetails(); + assertEquals(getNumScaleInput(qnNumber, recipient).getAttribute("value"), + getDoubleString(responseDetails.getAnswer())); + } + + public void verifyConstSumQuestion(int qnNumber, String recipient, + FeedbackConstantSumQuestionDetails questionDetails) { + if (!questionDetails.isDistributeToRecipients()) { + List constSumOptions = questionDetails.getConstSumOptions(); + List optionTexts = getConstSumOptions(qnNumber, recipient); + for (int i = 0; i < constSumOptions.size(); i++) { + assertEquals(constSumOptions.get(i), optionTexts.get(i).getText()); + } + } + + int totalPoints = questionDetails.getPoints(); + if (questionDetails.isPointsPerOption()) { + totalPoints *= questionDetails.getNumOfConstSumOptions(); + } + assertEquals(getQuestionForm(qnNumber).findElement(By.id("total-points-message")).getText(), + "Total points distributed should add up to " + totalPoints + "."); + + if (questionDetails.isForceUnevenDistribution()) { + String entityType = questionDetails.isDistributeToRecipients() ? "recipient" : "option"; + if (questionDetails.getDistributePointsFor().equals("All options")) { + assertEquals(getQuestionForm(qnNumber).findElement(By.id("all-uneven-message")).getText(), + "Every " + entityType + " should be allocated different number of points."); + } else { + assertEquals(getQuestionForm(qnNumber).findElement(By.id("one-uneven-message")).getText(), + "At least one " + entityType + " should be allocated different number of points."); + } + } + } + + public void submitConstSumOptionResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackConstantSumResponseDetails responseDetails = + (FeedbackConstantSumResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswers(); + List constSumInputs = getConstSumInputs(qnNumber, recipient); + for (int i = 0; i < answers.size(); i++) { + fillTextBox(constSumInputs.get(i), Integer.toString(answers.get(i))); + } + clickSubmitButton(); + } + + public void verifyConstSumOptionResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackConstantSumResponseDetails responseDetails = + (FeedbackConstantSumResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswers(); + List constSumInputs = getConstSumInputs(qnNumber, recipient); + for (int i = 0; i < answers.size(); i++) { + assertEquals(constSumInputs.get(i).getAttribute("value"), Integer.toString(answers.get(i))); + } + } + + public void submitConstSumRecipientResponse(int qnNumber, List responses) { + List recipientInputs = getConstSumRecipientInputs(qnNumber); + for (int i = 0; i < responses.size(); i++) { + FeedbackConstantSumResponseDetails response = + (FeedbackConstantSumResponseDetails) responses.get(i).getResponseDetails(); + fillTextBox(recipientInputs.get(i), Integer.toString(response.getAnswers().get(0))); + } + clickSubmitButton(); + } + + public void verifyConstSumRecipientResponse(int qnNumber, List responses) { + List recipientInputs = getConstSumRecipientInputs(qnNumber); + for (int i = 0; i < responses.size(); i++) { + FeedbackConstantSumResponseDetails response = + (FeedbackConstantSumResponseDetails) responses.get(i).getResponseDetails(); + assertEquals(recipientInputs.get(i).getAttribute("value"), + Integer.toString(response.getAnswers().get(0))); + } + } + + public void verifyContributionQuestion(int qnNumber, FeedbackContributionQuestionDetails questionDetails) { + try { + selectDropdownOptionByText(getContributionDropdowns(qnNumber).get(0), "Not Sure"); + assertTrue(questionDetails.isNotSureAllowed()); + } catch (NoSuchElementException e) { + assertFalse(questionDetails.isNotSureAllowed()); + } + } + + public void submitContributionResponse(int qnNumber, List responses) { + List dropdowns = getContributionDropdowns(qnNumber); + for (int i = 0; i < responses.size(); i++) { + FeedbackContributionResponseDetails response = + (FeedbackContributionResponseDetails) responses.get(i).getResponseDetails(); + selectDropdownOptionByText(dropdowns.get(i), getContributionString(response.getAnswer())); + } + clickSubmitButton(); + } + + public void verifyContributionResponse(int qnNumber, List responses) { + List dropdowns = getContributionDropdowns(qnNumber); + for (int i = 0; i < responses.size(); i++) { + FeedbackContributionResponseDetails response = + (FeedbackContributionResponseDetails) responses.get(i).getResponseDetails(); + assertEquals(getSelectedDropdownOptionText(dropdowns.get(i)), getContributionString(response.getAnswer())); + } + } + + public void verifyRubricQuestion(int qnNumber, String recipient, FeedbackRubricQuestionDetails questionDetails) { + List choices = questionDetails.getRubricChoices(); + List subQuestions = questionDetails.getRubricSubQuestions(); + List> descriptions = questionDetails.getRubricDescriptions(); + + String[][] expectedTable = new String[subQuestions.size() + 1][choices.size() + 1]; + expectedTable[0][0] = ""; + for (int i = 1; i <= choices.size(); i++) { + expectedTable[0][i] = choices.get(i - 1); + } + for (int i = 1; i <= subQuestions.size(); i++) { + expectedTable[i][0] = subQuestions.get(i - 1); + } + for (int i = 1; i <= descriptions.size(); i++) { + List description = descriptions.get(i - 1); + for (int j = 1; j <= description.size(); j++) { + expectedTable[i][j] = description.get(j - 1); + } + } + verifyTableBodyValues(getRubricTable(qnNumber, recipient), expectedTable); + } + + public void submitRubricResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackRubricResponseDetails responseDetails = + (FeedbackRubricResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswer(); + for (int i = 0; i < answers.size(); i++) { + click(getRubricInputs(qnNumber, recipient, i + 2).get(answers.get(i))); + } + clickSubmitButton(); + } + + public void verifyRubricResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackRubricResponseDetails responseDetails = + (FeedbackRubricResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswer(); + for (int i = 0; i < answers.size(); i++) { + assertTrue(getRubricInputs(qnNumber, recipient, i + 2).get(answers.get(i)).isSelected()); + } + } + + public void verifyRankQuestion(int qnNumber, String recipient, FeedbackRankQuestionDetails questionDetails) { + if (questionDetails.getMaxOptionsToBeRanked() != Integer.MIN_VALUE) { + assertEquals(getQuestionForm(qnNumber).findElement(By.id("max-options-message")).getText(), + "Rank no more than " + questionDetails.getMaxOptionsToBeRanked() + " options."); + } + if (questionDetails.getMinOptionsToBeRanked() != Integer.MIN_VALUE) { + assertEquals(getQuestionForm(qnNumber).findElement(By.id("min-options-message")).getText(), + "Rank at least " + questionDetails.getMinOptionsToBeRanked() + " options."); + } + if (questionDetails instanceof FeedbackRankOptionsQuestionDetails) { + FeedbackRankOptionsQuestionDetails optionDetails = (FeedbackRankOptionsQuestionDetails) questionDetails; + List options = optionDetails.getOptions(); + List optionTexts = getRankOptions(qnNumber, recipient); + for (int i = 0; i < options.size(); i++) { + assertEquals(options.get(i), optionTexts.get(i).getText()); + } + } + } + + public void submitRankOptionResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackRankOptionsResponseDetails responseDetails = + (FeedbackRankOptionsResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswers(); + for (int i = 0; i < answers.size(); i++) { + if (answers.get(i) == Const.POINTS_NOT_SUBMITTED) { + selectDropdownOptionByText(getRankOptionsDropdowns(qnNumber, recipient).get(i), ""); + } else { + selectDropdownOptionByText(getRankOptionsDropdowns(qnNumber, recipient).get(i), + Integer.toString(answers.get(i))); + } + } + clickSubmitButton(); + } + + public void verifyRankOptionResponse(int qnNumber, String recipient, FeedbackResponseAttributes response) { + FeedbackRankOptionsResponseDetails responseDetails = + (FeedbackRankOptionsResponseDetails) response.getResponseDetails(); + List answers = responseDetails.getAnswers(); + for (int i = 0; i < answers.size(); i++) { + if (answers.get(i) == Const.POINTS_NOT_SUBMITTED) { + assertEquals(getSelectedDropdownOptionText(getRankOptionsDropdowns(qnNumber, recipient).get(i)), + ""); + } else { + assertEquals(getSelectedDropdownOptionText(getRankOptionsDropdowns(qnNumber, recipient).get(i)), + Integer.toString(answers.get(i))); + } + } + } + + public void submitRankRecipientResponse(int qnNumber, List responses) { + List recipientDropdowns = getRankRecipientDropdowns(qnNumber); + for (int i = 0; i < responses.size(); i++) { + FeedbackRankRecipientsResponseDetails response = + (FeedbackRankRecipientsResponseDetails) responses.get(i).getResponseDetails(); + if (response.getAnswer() == Const.POINTS_NOT_SUBMITTED) { + selectDropdownOptionByText(recipientDropdowns.get(i), ""); + } else { + selectDropdownOptionByText(recipientDropdowns.get(i), Integer.toString(response.getAnswer())); + } + } + clickSubmitButton(); + } + + public void verifyRankRecipientResponse(int qnNumber, List responses) { + List recipientDropdowns = getRankRecipientDropdowns(qnNumber); + for (int i = 0; i < responses.size(); i++) { + FeedbackRankRecipientsResponseDetails response = + (FeedbackRankRecipientsResponseDetails) responses.get(i).getResponseDetails(); + if (response.getAnswer() == Const.POINTS_NOT_SUBMITTED) { + assertEquals(getSelectedDropdownOptionText(recipientDropdowns.get(i)), ""); + } else { + assertEquals(getSelectedDropdownOptionText(recipientDropdowns.get(i)), + Integer.toString(response.getAnswer())); + } + } + } + + private String getCourseId() { + return browser.driver.findElement(By.id("course-id")).getText(); + } + + private String getFeedbackSessionName() { + return browser.driver.findElement(By.id("fs-name")).getText(); + } + + private String getOpeningTime() { + return browser.driver.findElement(By.id("opening-time")).getText(); + } + + private String getClosingTime() { + return browser.driver.findElement(By.id("closing-time")).getText(); + } + + private String getInstructions() { + return browser.driver.findElement(By.id("instructions")).getAttribute("innerHTML"); + } + + private void assertDateEquals(String actual, Instant instant, ZoneId timeZone) { + String dateStrWithAbbr = getDateStringWithAbbr(instant, timeZone); + String dateStrWithOffset = getDateStringWithOffset(instant, timeZone); + + boolean isExpected = actual.equals(dateStrWithAbbr) || actual.equals(dateStrWithOffset); + assertTrue(isExpected); + } + + private String getDateStringWithAbbr(Instant instant, ZoneId timeZone) { + return DateTimeFormatter + .ofPattern("EE, dd MMM, yyyy, hh:mm a z") + .format(instant.atZone(timeZone)); + } + + private String getDateStringWithOffset(Instant instant, ZoneId timeZone) { + return DateTimeFormatter + .ofPattern("EE, dd MMM, yyyy, hh:mm a X") + .format(instant.atZone(timeZone)); + } + + private WebElement getQuestionForm(int qnNumber) { + By questionFormId = By.id("question-submission-form"); + waitForElementPresence(questionFormId); + return browser.driver.findElements(questionFormId).get(qnNumber - 1); + } + + private String getQuestionBrief(int qnNumber) { + String questionDetails = getQuestionForm(qnNumber).findElement(By.id("question-details")).getText(); + return questionDetails.split(": ")[1]; + } + + private void verifyVisibilityList(int qnNumber, FeedbackQuestionAttributes questionAttributes) { + if (questionAttributes.showResponsesTo.isEmpty()) { + verifyVisibilityStringPresent(qnNumber, "No-one can see your responses"); + } + if (questionAttributes.recipientType.equals(FeedbackParticipantType.SELF)) { + verifyVisibilityStringPresent(qnNumber, "You can see your own feedback in the results page later on."); + } + for (FeedbackParticipantType viewerType : questionAttributes.showResponsesTo) { + verifyVisibilityStringPresent(qnNumber, getVisibilityString(questionAttributes, viewerType)); + } + } + + private void verifyVisibilityStringPresent(int qnNumber, String expectedString) { + List visibilityStrings = getQuestionForm(qnNumber).findElement(By.id("visibility-list")) + .findElements(By.tagName("li")); + for (WebElement visibilityString : visibilityStrings) { + if (visibilityString.getText().equals(expectedString)) { + return; + } + } + fail("Expected visibility string not found: " + qnNumber + ": " + expectedString); + } + + private String getVisibilityString(FeedbackQuestionAttributes questionAttributes, + FeedbackParticipantType viewerType) { + if (!questionAttributes.showResponsesTo.contains(viewerType)) { + return ""; + } + + StringBuilder message = new StringBuilder(getViewerString(viewerType, questionAttributes.recipientType)); + message.append(" can see your response"); + if (questionAttributes.showRecipientNameTo.contains(viewerType)) { + message.append(", the name of the recipient"); + if (questionAttributes.showGiverNameTo.contains(viewerType)) { + message.append(", and your name"); + } else { + message.append(", but not your name"); + } + } else { + if (questionAttributes.showGiverNameTo.contains(viewerType)) { + message.append(", and your name, but not the name of the recipient"); + } else { + message.append(", but not the name of the recipient, or your name"); + } + } + return message.toString(); + } + + private String getViewerString(FeedbackParticipantType viewerType, FeedbackParticipantType recipientType) { + switch(viewerType) { + case RECEIVER: + return "The receiving " + getRecipientString(recipientType); + case OWN_TEAM_MEMBERS: + return "Your team members"; + case STUDENTS: + return "Other students in the course"; + case INSTRUCTORS: + return "Instructors in this course"; + default: + throw new RuntimeException("Unknown viewer type"); + } + } + + private String getRecipientString(FeedbackParticipantType recipientType) { + switch(recipientType) { + case TEAMS: + return "teams"; + case OWN_TEAM_MEMBERS: + return "student"; + case STUDENTS: + return "students"; + case INSTRUCTORS: + return "instructors"; + default: + throw new RuntimeException("Unknown recipientType"); + } + } + + private void clickSubmitButton() { + clickAndConfirm(getSubmitButton()); + } + + private void reloadPageIfStuckLoading() { + By loadingContainer = By.className("loading-container"); + try { + if (isElementPresent(loadingContainer)) { + waitForElementStaleness(browser.driver.findElement(loadingContainer)); + } + } catch (TimeoutException e) { + reloadPage(); + } + } + + private WebElement getSubmitButton() { + return waitForElementPresence(By.id("btn-submit")); + } + + private String getQuestionDescription(int qnNumber) { + return getQuestionForm(qnNumber).findElement(By.id("question-description")).getAttribute("innerHTML"); + } + + private WebElement getCommentSection(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + return getQuestionForm(qnNumber).findElements(By.id("comment-section")).get(recipientIndex); + } + + private void writeToCommentEditor(WebElement commentSection, String comment) { + scrollElementToCenter(commentSection); + waitForElementPresence(By.tagName("editor")); + writeToRichTextEditor(commentSection.findElement(By.tagName("editor")), comment); + } + + private int getRecipientIndex(int qnNumber, String recipient) { + // For questions with recipient none or self. + if (recipient.isEmpty()) { + return 0; + } + WebElement questionForm = getQuestionForm(qnNumber); + // For questions with flexible recipient. + try { + List recipientDropdowns = questionForm.findElements(By.id("recipient-dropdown")); + for (int i = 0; i < recipientDropdowns.size(); i++) { + String dropdownText = getSelectedDropdownOptionText(recipientDropdowns.get(i)); + if (dropdownText.isEmpty()) { + selectDropdownOptionByText(recipientDropdowns.get(i), recipient); + return i; + } else if (dropdownText.equals(recipient)) { + return i; + } + } + } catch (NoSuchElementException e) { + // continue + } + int i = 0; + while (true) { + if (questionForm.findElement(By.id("recipient-name-" + i)).getText().contains(recipient)) { + return i; + } + i++; + } + } + + private WebElement getTextResponseEditor(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + WebElement questionForm = getQuestionForm(qnNumber); + WebElement editor = questionForm.findElements(By.tagName("tm-rich-text-editor")).get(recipientIndex); + scrollElementToCenter(editor); + return editor; + } + + private String getResponseLengthText(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + return getQuestionForm(qnNumber).findElements(By.id("response-length")).get(recipientIndex).getText(); + } + + private String getDoubleString(Double value) { + return value % 1 == 0 ? Integer.toString(value.intValue()) : Double.toString(value); + } + + private WebElement getMcqSection(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + WebElement questionForm = getQuestionForm(qnNumber); + return questionForm.findElements(By.tagName("tm-mcq-question-edit-answer-form")).get(recipientIndex); + } + + private WebElement getMcqOtherOptionRadioBtn(int qnNumber, String recipient) { + WebElement mcqSection = getMcqSection(qnNumber, recipient); + return mcqSection.findElement(By.cssSelector("#other-option input[type=radio]")); + } + + private WebElement getMcqOtherOptionTextbox(int qnNumber, String recipient) { + WebElement mcqSection = getMcqSection(qnNumber, recipient); + return mcqSection.findElement(By.cssSelector("#other-option input[type=text]")); + } + + private List getMcqOptions(int qnNumber, String recipient) { + WebElement mcqSection = getMcqSection(qnNumber, recipient); + return mcqSection.findElements(By.className("option-text")); + } + + private List getMcqRadioBtns(int qnNumber, String recipient) { + WebElement mcqSection = getMcqSection(qnNumber, recipient); + return mcqSection.findElements(By.cssSelector("input[type=radio]")); + } + + private WebElement getMsqSection(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + WebElement questionForm = getQuestionForm(qnNumber); + return questionForm.findElements(By.tagName("tm-msq-question-edit-answer-form")).get(recipientIndex); + } + + private WebElement getMsqOtherOptionCheckbox(int qnNumber, String recipient) { + WebElement msqSection = getMsqSection(qnNumber, recipient); + return msqSection.findElement(By.cssSelector("#other-option input[type=checkbox]")); + } + + private WebElement getMsqOtherOptionTextbox(int qnNumber, String recipient) { + WebElement msqSection = getMsqSection(qnNumber, recipient); + return msqSection.findElement(By.cssSelector("#other-option input[type=text]")); + } + + private List getMsqOptions(int qnNumber, String recipient) { + WebElement msqSection = getMsqSection(qnNumber, recipient); + return msqSection.findElements(By.tagName("strong")); + } + + private List getMsqCheckboxes(int qnNumber, String recipient) { + WebElement msqSection = getMsqSection(qnNumber, recipient); + return msqSection.findElements(By.cssSelector("input[type=checkbox]")); + } + + private WebElement getNumScaleSection(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + WebElement questionForm = getQuestionForm(qnNumber); + return questionForm.findElements(By.tagName("tm-num-scale-question-edit-answer-form")).get(recipientIndex); + } + + private WebElement getNumScaleInput(int qnNumber, String recipient) { + WebElement numScaleSection = getNumScaleSection(qnNumber, recipient); + return numScaleSection.findElement(By.tagName("input")); + } + + private WebElement getConstSumOptionsSection(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + WebElement questionForm = getQuestionForm(qnNumber); + return questionForm.findElements(By.tagName("tm-constsum-options-question-edit-answer-form")).get(recipientIndex); + } + + private List getConstSumOptions(int qnNumber, String recipient) { + WebElement constSumOptionSection = getConstSumOptionsSection(qnNumber, recipient); + return constSumOptionSection.findElements(By.tagName("strong")); + } + + private List getConstSumInputs(int qnNumber, String recipient) { + WebElement constSumOptionSection = getConstSumOptionsSection(qnNumber, recipient); + return constSumOptionSection.findElements(By.cssSelector("input[type=number]")); + } + + private List getConstSumRecipientInputs(int qnNumber) { + return getQuestionForm(qnNumber).findElements(By.cssSelector("input[type=number]")); + } + + private List getContributionDropdowns(int questionNum) { + return getQuestionForm(questionNum).findElements(By.tagName("select")); + } + + private String getContributionString(int answer) { + if (answer == Const.POINTS_NOT_SURE) { + return "Not Sure"; + } else if (answer == Const.POINTS_EQUAL_SHARE) { + return "Equal share"; + } else { + return "Equal share" + (answer > 100 ? " + " : " - ") + Math.abs(answer - 100) + "%"; + } + } + + private WebElement getRubricSection(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + WebElement questionForm = getQuestionForm(qnNumber); + return questionForm.findElements(By.tagName("tm-rubric-question-edit-answer-form")).get(recipientIndex); + } + + private WebElement getRubricTable(int qnNumber, String recipient) { + return getRubricSection(qnNumber, recipient).findElement(By.tagName("table")); + } + + private List getRubricInputs(int qnNumber, String recipient, int rowNumber) { + WebElement rubricRow = getRubricSection(qnNumber, recipient).findElements(By.tagName("tr")).get(rowNumber - 1); + return rubricRow.findElements(By.tagName("input")); + } + + private WebElement getRankOptionsSection(int qnNumber, String recipient) { + int recipientIndex = getRecipientIndex(qnNumber, recipient); + WebElement questionForm = getQuestionForm(qnNumber); + return questionForm.findElements(By.tagName("tm-rank-options-question-edit-answer-form")).get(recipientIndex); + } + + private List getRankOptions(int questionNum, String recipient) { + WebElement rankSection = getRankOptionsSection(questionNum, recipient); + return rankSection.findElements(By.tagName("strong")); + } + + private List getRankOptionsDropdowns(int questionNum, String recipient) { + WebElement rankSection = getRankOptionsSection(questionNum, recipient); + return rankSection.findElements(By.tagName("select")); + } + + private List getRankRecipientDropdowns(int questionNum) { + return getQuestionForm(questionNum).findElements(By.tagName("select")); + } +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/GoogleLoginPage.java b/src/e2e/java/teammates/e2e/pageobjects/GoogleLoginPage.java index b03856df8db..13f96da0ed0 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/GoogleLoginPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/GoogleLoginPage.java @@ -1,38 +1,15 @@ package teammates.e2e.pageobjects; -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.ExpectedConditions; - -import com.google.common.base.Preconditions; - -import teammates.e2e.util.TestProperties; - /** * Page Object Model for the official Google Accounts login page. */ public class GoogleLoginPage extends LoginPage { private static final String EXPECTED_SNIPPET_SIGN_IN = "Sign in – Google accounts"; - private static final String EXPECTED_SNIPPET_APPROVAL = "requesting permission to access your Google Account"; - - @FindBy(id = "initialView") - private WebElement loginPanel; - - @FindBy(id = "identifierId") - private WebElement identifierTextBox; - - @FindBy(id = "identifierNext") - private WebElement identifierNextButton; - - @FindBy(css = "input[type=password]") - private WebElement passwordTextBox; - - @FindBy(id = "passwordNext") - private WebElement passwordNextButton; + private static final String ERROR_CANNOT_LOGIN = "Automated login not allowed on Google login page."; + // Google blocks log in by automation. + // This AppPage is for testing correct navigation and not for actual login. public GoogleLoginPage(Browser browser) { super(browser); } @@ -44,88 +21,16 @@ protected boolean containsExpectedPageContents() { @Override public void loginAsAdmin(String adminUsername, String adminPassword) { - completeGoogleLoginSteps(adminUsername, adminPassword); - browser.isAdminLoggedIn = true; + throw new RuntimeException(ERROR_CANNOT_LOGIN); } @Override public StudentHomePage loginAsStudent(String username, String password) { - return loginAsStudent(username, password, StudentHomePage.class); + throw new RuntimeException(ERROR_CANNOT_LOGIN); } @Override public T loginAsStudent(String username, String password, Class typeOfPage) { - completeGoogleLoginSteps(username, password); - browser.isAdminLoggedIn = false; - return changePageType(typeOfPage); - } - - private void completeGoogleLoginSteps(String username, String password) { - submitCredentials(username, password); - dealWithSignIntoChromePage(); - handleApprovalPageIfAny(); - } - - private void dealWithSignIntoChromePage() { - try { - click(By.id("no-button")); - waitForPageToLoad(); - } catch (NoSuchElementException e) { - System.out.println("No 'sign into chrome' option"); - } - } - - private void handleApprovalPageIfAny() { - waitForPageToLoad(); - waitForRedirectIfAny(); - boolean isPageRequestingAccessApproval = getPageSource().contains(EXPECTED_SNIPPET_APPROVAL); - if (isPageRequestingAccessApproval) { - markCheckBoxAsChecked(browser.driver.findElement(By.id("persist_checkbox"))); - click(By.id("approve_button")); - waitForPageToLoad(); - } - } - - private void waitForRedirectIfAny() { - String loginRedirectUrl = TestProperties.TEAMMATES_URL + "/_ah/conflogin"; - waitFor(d -> { - String url = Preconditions.checkNotNull(d).getCurrentUrl(); - boolean isTeammatesPage = url.startsWith(TestProperties.TEAMMATES_URL) && !url.startsWith(loginRedirectUrl); - boolean isApprovalPage = d.getPageSource().contains(EXPECTED_SNIPPET_APPROVAL); - return isTeammatesPage || isApprovalPage; - }); - } - - private void waitForLoginPanelAnimationToComplete() { - // the login panel will have attribute `aria-busy="true"` while in animation - waitFor(ExpectedConditions.attributeToBe(loginPanel, "aria-busy", "")); - } - - private void submitCredentials(String username, String password) { - completeFillIdentifierSteps(username); - click(identifierNextButton); - - waitForLoginPanelAnimationToComplete(); - fillTextBox(passwordTextBox, password); - - click(passwordNextButton); - waitForPageToLoad(); - } - - private void completeFillIdentifierSteps(String identifier) { - By switchAccountButtonBy = By.cssSelector("div[aria-label='Switch account']"); - By useAnotherAccountButtonBy = By.xpath("//div[contains(text(), 'Use another account')]"); - - if (isElementPresent(switchAccountButtonBy)) { - click(switchAccountButtonBy); - waitForLoginPanelAnimationToComplete(); - } - - if (isElementPresent(useAnotherAccountButtonBy)) { - click(useAnotherAccountButtonBy); - waitForLoginPanelAnimationToComplete(); - } - - fillTextBox(identifierTextBox, identifier); + throw new RuntimeException(ERROR_CANNOT_LOGIN); } } diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseDetailsPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseDetailsPage.java new file mode 100644 index 00000000000..75956fb5723 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseDetailsPage.java @@ -0,0 +1,183 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import java.util.List; +import java.util.StringJoiner; + +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.ThreadHelper; + +/** + * Represents the instructor course details page of the website. + */ +public class InstructorCourseDetailsPage extends AppPage { + @FindBy(id = "course-id") + private WebElement courseIdField; + + @FindBy(id = "course-name") + private WebElement courseNameField; + + @FindBy(id = "num-sections") + private WebElement numSectionsField; + + @FindBy(id = "num-teams") + private WebElement numTeamsField; + + @FindBy(id = "num-students") + private WebElement numStudentsField; + + @FindBy(id = "instructors") + private WebElement instructorsField; + + public InstructorCourseDetailsPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageTitle().contains("Course Details"); + } + + public void verifyCourseDetails(CourseAttributes course, InstructorAttributes[] instructors, + int numSections, int numTeams, int numStudents) { + assertEquals(course.getId(), courseIdField.getText()); + assertEquals(course.getName(), courseNameField.getText()); + assertEquals(Integer.toString(numSections), numSectionsField.getText()); + assertEquals(Integer.toString(numTeams), numTeamsField.getText()); + assertEquals(Integer.toString(numStudents), numStudentsField.getText()); + assertEquals(getExpectedInstructorString(instructors), instructorsField.getText()); + } + + public void verifyStudentDetails(StudentAttributes[] students) { + verifyTableBodyValues(getStudentList(), getExpectedStudentValues(students)); + } + + public void verifyNumStudents(int expected) { + assertEquals(expected, getNumStudents()); + } + + public void sendInvite(StudentAttributes student) { + clickAndConfirm(getSendInviteButton(student)); + } + + public void remindAllToJoin() { + clickAndConfirm(waitForElementPresence(By.id("btn-remind-all"))); + } + + public void downloadStudentList() { + click(waitForElementPresence(By.id("btn-download"))); + } + + public void sortByName() { + click(browser.driver.findElement(By.id("sort-by-name"))); + waitUntilAnimationFinish(); + } + + public void sortByStatus() { + click(browser.driver.findElement(By.id("sort-by-status"))); + waitUntilAnimationFinish(); + } + + public void deleteStudent(StudentAttributes student) { + clickAndConfirm(getDeleteButton(student)); + } + + public void deleteAllStudents() { + clickAndConfirm(waitForElementPresence(By.id("btn-delete-all"))); + } + + private String getExpectedInstructorString(InstructorAttributes[] instructors) { + StringJoiner expected = new StringJoiner(System.lineSeparator()); + for (InstructorAttributes instructor : instructors) { + expected.add(instructor.getRole() + ": " + instructor.getName() + " (" + instructor.getEmail() + ")"); + } + return expected.toString(); + } + + private WebElement getStudentList() { + return browser.driver.findElement(By.cssSelector("#student-list table")); + } + + private String[][] getExpectedStudentValues(StudentAttributes[] students) { + String[][] expected = new String[students.length][6]; + for (int i = 0; i < students.length; i++) { + StudentAttributes student = students[i]; + expected[i][0] = "View Photo"; + expected[i][1] = student.getSection(); + expected[i][2] = student.getTeam(); + expected[i][3] = student.getName(); + expected[i][4] = student.getGoogleId().isEmpty() ? "Yet to Join" : "Joined"; + expected[i][5] = student.getEmail(); + } + return expected; + } + + private WebElement getSendInviteButton(StudentAttributes student) { + WebElement studentRow = getStudentRow(student); + return studentRow.findElement(By.id("btn-send-invite")); + } + + private WebElement getDeleteButton(StudentAttributes student) { + WebElement studentRow = getStudentRow(student); + return studentRow.findElement(By.id("btn-delete")); + } + + private List getAllStudentRows() { + return getStudentList().findElements(By.cssSelector("tbody tr")); + } + + private int getNumStudents() { + try { + return getAllStudentRows().size(); + } catch (NoSuchElementException e) { + return 0; + } + } + + private WebElement getStudentRow(StudentAttributes student) { + List studentRows = getAllStudentRows(); + for (WebElement studentRow : studentRows) { + List studentCells = studentRow.findElements(By.tagName("td")); + if (studentCells.get(5).getText().equals(student.getEmail())) { + return studentRow; + } + } + return null; + } + + public InstructorCourseStudentDetailsViewPage clickViewStudent(StudentAttributes student) { + WebElement studentRow = getStudentRow(student); + WebElement viewButton = studentRow.findElement(By.id("btn-view-details")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorCourseStudentDetailsViewPage.class); + } + + public InstructorCourseStudentDetailsEditPage clickEditStudent(StudentAttributes student) { + WebElement studentRow = getStudentRow(student); + WebElement viewButton = studentRow.findElement(By.id("btn-edit-details")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorCourseStudentDetailsEditPage.class); + } + + public InstructorStudentRecordsPage clickViewAllRecords(StudentAttributes student) { + WebElement studentRow = getStudentRow(student); + WebElement viewButton = studentRow.findElement(By.id("btn-view-records")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorStudentRecordsPage.class); + } + +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEditPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEditPage.java index 53f0c2c38a4..e4621310ed5 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEditPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEditPage.java @@ -16,6 +16,7 @@ import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; +import teammates.common.util.ThreadHelper; /** * Represents the instructor course edit page of the website. @@ -94,7 +95,7 @@ public void verifyInstructorDetails(InstructorAttributes instructor) { } else { assertEquals("(This instructor will NOT be displayed to students)", getInstructorDisplayName(instrNum)); } - assertEquals(getRoleIndex(instructor.role), getInstructorAccessLevel(instrNum)); + assertEquals(instructor.role, getInstructorRole(instrNum)); if (instructor.role.equals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_CUSTOM) && getEditInstructorButton(instrNum).isEnabled()) { verifyCustomPrivileges(instrNum, instructor.privileges); @@ -200,10 +201,10 @@ public void addInstructor(InstructorAttributes newInstructor) { fillTextBox(getNameField(instructorIndex), newInstructor.name); fillTextBox(getEmailField(instructorIndex), newInstructor.email); if (newInstructor.isDisplayedToStudents) { - markCheckBoxAsChecked(getDisplayedToStudentCheckBox(instructorIndex)); + markOptionAsSelected(getDisplayedToStudentCheckBox(instructorIndex)); fillTextBox(getDisplayNameField(instructorIndex), newInstructor.displayedName); } else { - markCheckBoxAsUnchecked(getDisplayedToStudentCheckBox(instructorIndex)); + markOptionAsUnselected(getDisplayedToStudentCheckBox(instructorIndex)); } selectRoleForInstructor(instructorIndex, getRoleIndex(newInstructor.role)); clickSaveInstructorButton(instructorIndex); @@ -225,17 +226,17 @@ public void editInstructor(int instrNum, InstructorAttributes instructor) { fillTextBox(getNameField(instrNum), instructor.name); fillTextBox(getEmailField(instrNum), instructor.email); if (instructor.isDisplayedToStudents) { - markCheckBoxAsChecked(getDisplayedToStudentCheckBox(instrNum)); + markOptionAsSelected(getDisplayedToStudentCheckBox(instrNum)); fillTextBox(getDisplayNameField(instrNum), instructor.displayedName); } else { - markCheckBoxAsUnchecked(getDisplayedToStudentCheckBox(instrNum)); + markOptionAsUnselected(getDisplayedToStudentCheckBox(instrNum)); } selectRoleForInstructor(instrNum, getRoleIndex(instructor.role)); clickSaveInstructorButton(instrNum); } public void toggleCustomCourseLevelPrivilege(int instrNum, String privilege) { - if (getInstructorAccessLevel(instrNum) != INSTRUCTOR_TYPE_CUSTOM) { + if (!getInstructorRole(instrNum).equals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_CUSTOM)) { return; } @@ -246,7 +247,7 @@ public void toggleCustomCourseLevelPrivilege(int instrNum, String privilege) { public void toggleCustomSectionLevelPrivilege(int instrNum, int panelNum, String section, String privilege) { - if (getInstructorAccessLevel(instrNum) != INSTRUCTOR_TYPE_CUSTOM) { + if (!getInstructorRole(instrNum).equals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_CUSTOM)) { return; } @@ -260,7 +261,7 @@ public void toggleCustomSectionLevelPrivilege(int instrNum, int panelNum, String public void toggleCustomSessionLevelPrivilege(int instrNum, int panelNum, String section, String session, String privilege) { - if (getInstructorAccessLevel(instrNum) != INSTRUCTOR_TYPE_CUSTOM) { + if (!getInstructorRole(instrNum).equals(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_CUSTOM)) { return; } @@ -307,7 +308,7 @@ private void clickCancelInstructorButton(int instrNum) { private void clickSaveInstructorButton(int instrNum) { click(getSaveInstructorButton(instrNum)); - waitForPageToLoad(true); + ThreadHelper.waitFor(1000); } private void clickAddSectionPrivilegeLink(int instrNum) { @@ -388,15 +389,9 @@ public String getInstructorDisplayName(int instrNum) { return browser.driver.findElement(By.id("displayed-name-instructor-" + instrNum)).getAttribute("value"); } - public int getInstructorAccessLevel(int instrNum) { - List accessLevelCheckboxes = browser.driver.findElements( - By.cssSelector("#access-levels-instructor-" + instrNum + " input")); - for (int i = 0; i < accessLevelCheckboxes.size(); i++) { - if (accessLevelCheckboxes.get(i).isSelected()) { - return i; - } - } - return -1; + public String getInstructorRole(int instrNum) { + String roleAndDescription = browser.driver.findElement(By.id("role-instructor-" + instrNum)).getText(); + return roleAndDescription.split(":")[0]; } private WebElement getAccessLevels(int instrNum) { diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEnrollPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEnrollPage.java index 5f8fd3d9040..8f0bd6211a4 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEnrollPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseEnrollPage.java @@ -19,6 +19,9 @@ public class InstructorCourseEnrollPage extends AppPage { private static final int SPREADSHEET_NUM_STARTING_ROWS = 20; private static final int NUM_ENROLLMENT_ATTRIBUTES = 5; + @FindBy(id = "enroll-header") + private WebElement enrollHeader; + @FindBy(id = "toggle-existing-students") private WebElement toggleExistingStudentsHeader; @@ -49,8 +52,13 @@ protected boolean containsExpectedPageContents() { return getPageTitle().contains("Enroll Students for"); } + public void verifyIsCorrectPage(String courseId) { + assertEquals("Enroll Students for " + courseId, enrollHeader.getText()); + } + public void clickToggleExistingStudentsHeader() { click(toggleExistingStudentsHeader); + waitUntilAnimationFinish(); } public void clickEnrollButton() { diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseStudentDetailsEditPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseStudentDetailsEditPage.java new file mode 100644 index 00000000000..a34c01f030c --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseStudentDetailsEditPage.java @@ -0,0 +1,81 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.StudentAttributes; + +/** + * Represents the instructor course student details edit page of the website. + */ +public class InstructorCourseStudentDetailsEditPage extends AppPage { + + @FindBy (id = "courseid") + private WebElement courseId; + + @FindBy (id = "studentname") + private WebElement studentNameTextbox; + + @FindBy (id = "sectionname") + private WebElement sectionNameTextbox; + + @FindBy (id = "teamname") + private WebElement teamNameTextbox; + + @FindBy (id = "newstudentemail") + private WebElement studentEmailTextbox; + + @FindBy (id = "comments") + private WebElement commentsTextbox; + + @FindBy (id = "btn-submit") + private WebElement submitButton; + + public InstructorCourseStudentDetailsEditPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageTitle().contains("Edit Student Details"); + } + + public void verifyIsCorrectPage(String expectedCourseId, String expectedStudentEmail) { + assertEquals(expectedCourseId, courseId.getText()); + assertEquals(expectedStudentEmail, studentEmailTextbox.getAttribute("value")); + } + + public void verifyStudentDetails(StudentAttributes studentDetails) { + assertEquals(studentDetails.getCourse(), courseId.getText()); + assertEquals(studentDetails.getName(), studentNameTextbox.getAttribute("value")); + if (studentDetails.getSection() == null) { + assertEquals("None", sectionNameTextbox.getAttribute("value")); + } else { + assertEquals(studentDetails.getSection(), sectionNameTextbox.getAttribute("value")); + } + assertEquals(studentDetails.getTeam(), teamNameTextbox.getAttribute("value")); + assertEquals(studentDetails.getEmail(), studentEmailTextbox.getAttribute("value")); + if (studentDetails.getComments() != null) { + assertEquals(studentDetails.getComments(), commentsTextbox.getAttribute("value")); + } + } + + public void editStudentDetails(StudentAttributes newStudentDetails) { + fillTextBox(studentNameTextbox, newStudentDetails.getName()); + fillTextBox(sectionNameTextbox, newStudentDetails.getSection()); + fillTextBox(teamNameTextbox, newStudentDetails.getTeam()); + if (newStudentDetails.getComments() != null) { + fillTextBox(commentsTextbox, newStudentDetails.getComments()); + } + clickAndConfirm(submitButton); + } + + public void editStudentEmailAndResendLinks(String newEmail) { + fillTextBox(studentEmailTextbox, newEmail); + click(submitButton); + click(waitForElementPresence(By.id("btn-resend-links"))); + } +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseStudentDetailsViewPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseStudentDetailsViewPage.java new file mode 100644 index 00000000000..ce283ddefc2 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorCourseStudentDetailsViewPage.java @@ -0,0 +1,105 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.attributes.StudentProfileAttributes; + +/** + * Represents the instructor course student details view page of the website. + */ +public class InstructorCourseStudentDetailsViewPage extends AppPage { + private static final String NOT_SPECIFIED_LABEL = "Not Specified"; + + @FindBy (id = "student-name") + private WebElement studentName; + + @FindBy (id = "name-with-gender") + private WebElement studentNameWithGender; + + @FindBy (id = "personal-email") + private WebElement studentPersonalEmail; + + @FindBy (id = "institution") + private WebElement studentInstitution; + + @FindBy (id = "nationality") + private WebElement studentNationality; + + @FindBy (id = "course-id") + private WebElement courseId; + + @FindBy (id = "section-name") + private WebElement studentSectionName; + + @FindBy (id = "team-name") + private WebElement studentTeamName; + + @FindBy (id = "email") + private WebElement studentOfficialEmail; + + @FindBy (id = "comments") + private WebElement studentComments; + + @FindBy (id = "more-info") + private WebElement moreInformation; + + public InstructorCourseStudentDetailsViewPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageSource().contains("Enrollment Details"); + } + + public void verifyIsCorrectPage(String expectedCourseId, String expectedStudentEmail) { + verifyDetail(expectedCourseId, courseId); + verifyDetail(expectedStudentEmail, studentOfficialEmail); + } + + public void verifyStudentDetails(StudentProfileAttributes studentProfile, StudentAttributes student) { + verifyDetail(student.getName(), studentName); + + StudentProfileAttributes profileToTest = studentProfile; + if (studentProfile == null) { + profileToTest = StudentProfileAttributes.builder(student.getGoogleId()).build(); + } + verifyDetail(getExpectedNameWithGender(profileToTest), studentNameWithGender); + verifyDetail(profileToTest.getEmail(), studentPersonalEmail); + verifyDetail(profileToTest.getInstitute(), studentInstitution); + verifyDetail(profileToTest.getNationality(), studentNationality); + + verifyDetail(student.getCourse(), courseId); + verifyDetail(student.getSection(), studentSectionName); + verifyDetail(student.getTeam(), studentTeamName); + verifyDetail(student.getEmail(), studentOfficialEmail); + verifyDetail(student.getComments(), studentComments); + + verifyDetail(profileToTest.getMoreInfo(), moreInformation); + } + + private void verifyDetail(String expected, WebElement detailField) { + if (expected.isEmpty()) { + assertEquals(NOT_SPECIFIED_LABEL, detailField.getText()); + } else { + assertEquals(expected, detailField.getText()); + } + } + + private String getExpectedNameWithGender(StudentProfileAttributes profile) { + String name = profile.getShortName(); + StudentProfileAttributes.Gender gender = profile.getGender(); + String expectedName = name.isEmpty() + ? NOT_SPECIFIED_LABEL + : name; + String expectedGender = gender.equals(StudentProfileAttributes.Gender.OTHER) + ? NOT_SPECIFIED_LABEL + : gender.toString(); + + return expectedName + " (" + expectedGender + ")"; + } +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java index 07f6d5b98de..2eb795198c1 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorCoursesPage.java @@ -15,6 +15,7 @@ import org.openqa.selenium.support.ui.Select; import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.util.TimeHelper; /** * Represents the "Courses" page for Instructors. @@ -78,13 +79,15 @@ public void verifyActiveCoursesDetails(CourseAttributes[] courses) { public void verifyActiveCourseStatistics(CourseAttributes course, String numSections, String numTeams, String numStudents, String numUnregistered) { showStatistics(course.getId()); - String[] courseDetail = { course.getId(), course.getName(), course.getCreatedAtDateString(), + String[] courseDetail = { course.getId(), course.getName(), + TimeHelper.formatInstant(course.getCreatedAt(), course.getTimeZone(), "d MMM yyyy"), numSections, numTeams, numStudents, numUnregistered }; verifyTableRowValues(getActiveTableRow(course.getId()), courseDetail); } public void verifyArchivedCoursesDetails(CourseAttributes[] courses) { showArchiveTable(); + this.waitUntilAnimationFinish(); String[][] courseDetails = getCourseDetails(courses); for (int i = 0; i < courses.length; i++) { // use verifyTableRowValues as archive courses are not sorted @@ -94,6 +97,7 @@ public void verifyArchivedCoursesDetails(CourseAttributes[] courses) { public void verifyDeletedCoursesDetails(CourseAttributes[] courses) { showDeleteTable(); + this.waitUntilAnimationFinish(); String[][] courseDetails = getDeletedCourseDetails(courses); for (int i = 0; i < courses.length; i++) { // use verifyTableRowValues as deleted courses are not sorted @@ -150,7 +154,7 @@ public void archiveCourse(String courseId) { click(otherActionButton); click(getArchiveButton(courseId)); - waitForElementStaleness(otherActionButton); + waitUntilAnimationFinish(); } public void moveCourseToRecycleBin(String courseId) { @@ -158,21 +162,21 @@ public void moveCourseToRecycleBin(String courseId) { click(otherActionButton); clickAndConfirm(getMoveToRecycleBinButton(courseId)); - waitForElementStaleness(otherActionButton); + waitUntilAnimationFinish(); } public void unarchiveCourse(String courseId) { WebElement unarchiveButton = getUnarchiveButton(courseId); click(unarchiveButton); - waitForElementStaleness(unarchiveButton); + waitUntilAnimationFinish(); } public void moveArchivedCourseToRecycleBin(String courseId) { WebElement moveArchivedToRecycleBinButton = getMoveArchivedToRecycleBinButton(courseId); clickAndConfirm(moveArchivedToRecycleBinButton); - waitForElementStaleness(moveArchivedToRecycleBinButton); + waitUntilAnimationFinish(); } public void showDeleteTable() { @@ -191,28 +195,28 @@ public void restoreCourse(String courseId) { WebElement restoreButton = getRestoreButton(courseId); click(restoreButton); - waitForElementStaleness(restoreButton); + waitUntilAnimationFinish(); } public void deleteCourse(String courseId) { WebElement deleteButton = getDeleteButton(courseId); clickAndConfirm(deleteButton); - waitForElementStaleness(deleteButton); + waitUntilAnimationFinish(); } public void restoreAllCourses() { WebElement restoreAllButton = getRestoreAllButton(); click(restoreAllButton); - waitForElementStaleness(restoreAllButton); + waitUntilAnimationFinish(); } public void deleteAllCourses() { WebElement deleteAllButton = getDeleteAllButton(); clickAndConfirm(deleteAllButton); - waitForElementStaleness(deleteAllButton); + waitUntilAnimationFinish(); } public void sortByCourseName() { diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java new file mode 100644 index 00000000000..a786e4c8d3a --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java @@ -0,0 +1,1582 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.FeedbackParticipantType; +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackConstantSumQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackContributionQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMsqQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackNumericalScaleQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackQuestionType; +import teammates.common.datatransfer.questions.FeedbackRankOptionsQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRankQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackRubricQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; +import teammates.common.util.Const; +import teammates.common.util.ThreadHelper; + +/** + * Represents the instructor feedback edit page of the website. + */ +public class InstructorFeedbackEditPage extends AppPage { + private static final String CUSTOM_FEEDBACK_PATH_OPTION = "Custom feedback path"; + private static final String FEEDBACK_PATH_SEPARATOR = " will give feedback on "; + private static final String CUSTOM_VISIBILITY_OPTION = "Custom visibility options"; + + @FindBy(id = "btn-fs-edit") + private WebElement fsEditButton; + + @FindBy(id = "btn-fs-save") + private WebElement fsSaveButton; + + @FindBy(id = "btn-fs-delete") + private WebElement fsDeleteButton; + + @FindBy(id = "btn-fs-copy") + private WebElement fsCopyButton; + + @FindBy(id = "edit-course-id") + private WebElement courseIdTextBox; + + @FindBy(id = "time-zone") + private WebElement timezoneDropDown; + + @FindBy(id = "course-name") + private WebElement courseNameTextBox; + + @FindBy(id = "edit-session-name") + private WebElement sessionNameTextBox; + + @FindBy(id = "instructions") + private WebElement instructionsEditor; + + @FindBy(id = "submission-start-date") + private WebElement startDateBox; + + @FindBy(id = "submission-start-time") + private WebElement startTimeDropdown; + + @FindBy(id = "submission-end-date") + private WebElement endDateBox; + + @FindBy(id = "submission-end-time") + private WebElement endTimeDropdown; + + @FindBy(id = "grace-period") + private WebElement gracePeriodDropdown; + + @FindBy(id = "submission-status") + private WebElement submissionStatusTextBox; + + @FindBy(id = "published-status") + private WebElement publishStatusTextBox; + + @FindBy(id = "btn-change-visibility") + private WebElement changeVisibilityButton; + + @FindBy(id = "session-visibility-custom") + private WebElement customSessionVisibleTimeButton; + + @FindBy(id = "session-visibility-date") + private WebElement sessionVisibilityDateBox; + + @FindBy(id = "session-visibility-time") + private WebElement sessionVisibilityTimeDropdown; + + @FindBy(id = "session-visibility-at-open") + private WebElement openSessionVisibleTimeButton; + + @FindBy(id = "response-visibility-custom") + private WebElement customResponseVisibleTimeButton; + + @FindBy(id = "response-visibility-date") + private WebElement responseVisibilityDateBox; + + @FindBy(id = "response-visibility-time") + private WebElement responseVisibilityTimeDropdown; + + @FindBy(id = "response-visibility-immediately") + private WebElement immediateResponseVisibleTimeButton; + + @FindBy(id = "response-visibility-manually") + private WebElement manualResponseVisibleTimeButton; + + @FindBy(id = "btn-change-email") + private WebElement changeEmailButton; + + @FindBy(id = "email-opening") + private WebElement openingSessionEmailCheckbox; + + @FindBy(id = "email-closing") + private WebElement closingSessionEmailCheckbox; + + @FindBy(id = "email-published") + private WebElement publishedSessionEmailCheckbox; + + @FindBy(id = "btn-new-question") + private WebElement addNewQuestionButton; + + @FindBy(id = "btn-copy-question") + private WebElement copyQuestionButton; + + @FindBy(id = "preview-student") + private WebElement previewAsStudentDropdown; + + @FindBy(id = "btn-preview-student") + private WebElement previewAsStudentButton; + + @FindBy(id = "preview-instructor") + private WebElement previewAsInstructorDropdown; + + @FindBy(id = "btn-preview-instructor") + private WebElement previewAsInstructorButton; + + public InstructorFeedbackEditPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageTitle().contains("Edit Feedback Session"); + } + + public void verifySessionDetails(CourseAttributes course, FeedbackSessionAttributes feedbackSession) { + waitForElementPresence(By.id("instructions")); + assertEquals(getCourseId(), course.getId()); + assertEquals(getCourseName(), course.getName()); + assertEquals(getTimeZone(), feedbackSession.getTimeZone().toString()); + assertEquals(getFeedbackSessionName(), feedbackSession.getFeedbackSessionName()); + assertEquals(getInstructions(), feedbackSession.getInstructions()); + assertEquals(getStartDate(), getDateString(feedbackSession.getStartTime(), feedbackSession.getTimeZone())); + assertEquals(getStartTime(), getTimeString(feedbackSession.getStartTime(), feedbackSession.getTimeZone())); + assertEquals(getEndDate(), getDateString(feedbackSession.getEndTime(), feedbackSession.getTimeZone())); + assertEquals(getEndTime(), getTimeString(feedbackSession.getEndTime(), feedbackSession.getTimeZone())); + assertEquals(getGracePeriod(), feedbackSession.getGracePeriodMinutes() + " min"); + verifySubmissionStatus(feedbackSession); + verifyPublishedStatus(feedbackSession); + verifyVisibilitySettings(feedbackSession); + verifyEmailSettings(feedbackSession); + } + + private void verifySubmissionStatus(FeedbackSessionAttributes feedbackSession) { + String submissionStatus = getSubmissionStatus(); + if (feedbackSession.isClosed()) { + assertEquals(submissionStatus, "Closed"); + } else if (feedbackSession.isVisible() && (feedbackSession.isOpened() || feedbackSession.isInGracePeriod())) { + assertEquals(submissionStatus, "Open"); + } else { + assertEquals(submissionStatus, "Awaiting"); + } + } + + private void verifyPublishedStatus(FeedbackSessionAttributes feedbackSession) { + String publishedStatus = getPublishedStatus(); + if (feedbackSession.isPublished()) { + assertEquals(publishedStatus, "Published"); + } else { + assertEquals(publishedStatus, "Not Published"); + } + } + + private void verifyVisibilitySettings(FeedbackSessionAttributes feedbackSession) { + Instant sessionVisibleTime = feedbackSession.getSessionVisibleFromTime(); + Instant responseVisibleTime = feedbackSession.getResultsVisibleFromTime(); + + // Default settings, assert setting section not expanded + if (sessionVisibleTime.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING) + && responseVisibleTime.equals(Const.TIME_REPRESENTS_LATER)) { + assertTrue(isElementPresent("btn-change-visibility")); + return; + } + verifySessionVisibilitySettings(sessionVisibleTime, feedbackSession); + verifyResponseVisibilitySettings(responseVisibleTime, feedbackSession); + } + + private void verifySessionVisibilitySettings(Instant sessionVisibleTime, + FeedbackSessionAttributes feedbackSession) { + if (sessionVisibleTime.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING)) { + assertTrue(openSessionVisibleTimeButton.isSelected()); + } else { + assertTrue(customSessionVisibleTimeButton.isSelected()); + assertEquals(getSessionVisibilityDate(), getDateString(feedbackSession.getSessionVisibleFromTime(), + feedbackSession.getTimeZone())); + assertEquals(getSessionVisibilityTime(), getTimeString(feedbackSession.getSessionVisibleFromTime(), + feedbackSession.getTimeZone())); + } + } + + private void verifyResponseVisibilitySettings(Instant responseVisibleTime, + FeedbackSessionAttributes feedbackSession) { + if (responseVisibleTime.equals(Const.TIME_REPRESENTS_FOLLOW_VISIBLE)) { + assertTrue(immediateResponseVisibleTimeButton.isSelected()); + } else if (responseVisibleTime.equals(Const.TIME_REPRESENTS_LATER)) { + assertTrue(manualResponseVisibleTimeButton.isSelected()); + } else { + assertTrue(customSessionVisibleTimeButton.isSelected()); + assertEquals(getResponseVisibilityDate(), getDateString(feedbackSession.getResultsVisibleFromTime(), + feedbackSession.getTimeZone())); + assertEquals(getResponseVisibilityTime(), getTimeString(feedbackSession.getResultsVisibleFromTime(), + feedbackSession.getTimeZone())); + } + } + + private void verifyEmailSettings(FeedbackSessionAttributes feedbackSession) { + boolean isOpeningEmailEnabled = feedbackSession.isOpeningEmailEnabled(); + boolean isClosingEmailEnabled = feedbackSession.isClosingEmailEnabled(); + boolean isPublishedEmailEnabled = feedbackSession.isPublishedEmailEnabled(); + + // Default settings, assert setting section not expanded + if (isOpeningEmailEnabled && isClosingEmailEnabled && isPublishedEmailEnabled) { + assertTrue(isElementPresent("btn-change-email")); + return; + } + if (isOpeningEmailEnabled) { + assertTrue(openingSessionEmailCheckbox.isSelected()); + } + if (isClosingEmailEnabled) { + assertTrue(closingSessionEmailCheckbox.isSelected()); + } + if (isPublishedEmailEnabled) { + assertTrue(publishedSessionEmailCheckbox.isSelected()); + } + } + + public void editSessionDetails(FeedbackSessionAttributes newFeedbackSessionDetails) { + click(fsEditButton); + setInstructions(newFeedbackSessionDetails.getInstructions()); + setSessionStartDateTime(newFeedbackSessionDetails.getStartTime(), newFeedbackSessionDetails.getTimeZone()); + setSessionEndDateTime(newFeedbackSessionDetails.getEndTime(), newFeedbackSessionDetails.getTimeZone()); + selectGracePeriod(newFeedbackSessionDetails.getGracePeriodMinutes()); + setVisibilitySettings(newFeedbackSessionDetails); + setEmailSettings(newFeedbackSessionDetails); + click(fsSaveButton); + } + + public void copySessionToOtherCourse(CourseAttributes otherCourse, String sessionName) { + click(fsCopyButton); + WebElement copyFsModal = waitForElementPresence(By.id("copy-course-modal")); + + fillTextBox(copyFsModal.findElement(By.id("copy-session-name")), sessionName); + List options = copyFsModal.findElements(By.className("form-check")); + for (WebElement option : options) { + String courseId = option.findElement(By.cssSelector("label span")).getText(); + if (courseId.equals(otherCourse.getId())) { + click(option.findElement(By.tagName("input"))); + break; + } + } + click(browser.driver.findElement(By.id("btn-confirm-copy-course"))); + } + + public void deleteSession() { + clickAndConfirm(fsDeleteButton); + } + + public FeedbackSubmitPage previewAsStudent(StudentAttributes student) { + selectDropdownOptionByText(previewAsStudentDropdown, String.format("[%s] %s", student.team, student.name)); + click(previewAsStudentButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(FeedbackSubmitPage.class); + } + + public FeedbackSubmitPage previewAsInstructor(InstructorAttributes instructor) { + selectDropdownOptionByText(previewAsInstructorDropdown, instructor.name); + click(previewAsInstructorButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(FeedbackSubmitPage.class); + } + + public void verifyNumQuestions(int expected) { + assertEquals(getNumQuestions(), expected); + } + + public void verifyQuestionDetails(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + scrollElementToCenter(getQuestionForm(questionNum)); + assertEquals(feedbackQuestion.getQuestionType(), getQuestionType(questionNum)); + assertEquals(feedbackQuestion.getQuestionNumber(), getQuestionNumber(questionNum)); + assertEquals(feedbackQuestion.getQuestionDetails().getQuestionText(), getQuestionBrief(questionNum)); + assertEquals(getQuestionDescription(questionNum), feedbackQuestion.getQuestionDescription()); + verifyFeedbackPathSettings(questionNum, feedbackQuestion); + verifyQuestionVisibilitySettings(questionNum, feedbackQuestion); + } + + private void verifyFeedbackPathSettings(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + assertEquals(feedbackQuestion.getGiverType().toDisplayGiverName(), getFeedbackGiver(questionNum)); + String feedbackReceiver = getFeedbackReceiver(questionNum); + assertEquals(feedbackQuestion.getRecipientType().toDisplayRecipientName(), feedbackReceiver); + + if (feedbackReceiver.equals(FeedbackParticipantType.INSTRUCTORS.toDisplayRecipientName()) + || feedbackReceiver.equals(FeedbackParticipantType.STUDENTS_EXCLUDING_SELF.toDisplayRecipientName()) + || feedbackReceiver.equals(FeedbackParticipantType.TEAMS_EXCLUDING_SELF.toDisplayRecipientName())) { + verifyNumberOfEntitiesToGiveFeedbackTo(questionNum, feedbackQuestion.getNumberOfEntitiesToGiveFeedbackTo()); + } + } + + private void verifyNumberOfEntitiesToGiveFeedbackTo(int questionNum, int numberOfEntitiesToGiveFeedbackTo) { + WebElement questionForm = getQuestionForm(questionNum); + if (numberOfEntitiesToGiveFeedbackTo == Const.MAX_POSSIBLE_RECIPIENTS) { + assertTrue(questionForm.findElement(By.id("unlimited-recipients")).isSelected()); + } else { + assertTrue(questionForm.findElement(By.id("custom-recipients")).isSelected()); + assertEquals(questionForm.findElement(By.id("custom-recipients-number")).getAttribute("value"), + Integer.toString(numberOfEntitiesToGiveFeedbackTo)); + } + } + + private void verifyQuestionVisibilitySettings(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + WebElement questionForm = getQuestionForm(questionNum); + String visibility = questionForm.findElement(By.cssSelector("#btn-question-visibility span")).getText(); + List showResponsesTo = feedbackQuestion.getShowResponsesTo(); + List showGiverNameTo = feedbackQuestion.getShowGiverNameTo(); + List showRecipientNameTo = feedbackQuestion.getShowRecipientNameTo(); + + switch (visibility) { + case "Shown anonymously to recipient and giver's team members, visible to instructors": + assertTrue(showResponsesTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.RECEIVER)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.OWN_TEAM_MEMBERS)); + assertEquals(showResponsesTo.size(), 3); + + assertTrue(showGiverNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertEquals(showGiverNameTo.size(), 1); + + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showRecipientNameTo.size(), 2); + break; + + case "Visible to instructors only": + assertTrue(showResponsesTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertEquals(showResponsesTo.size(), 1); + + assertTrue(showGiverNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertEquals(showGiverNameTo.size(), 1); + + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertEquals(showRecipientNameTo.size(), 1); + break; + + case "Shown anonymously to recipient and instructors": + assertTrue(showResponsesTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showResponsesTo.size(), 2); + + assertEquals(showGiverNameTo.size(), 0); + + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showRecipientNameTo.size(), 2); + break; + + case "Shown anonymously to recipient, visible to instructors": + assertTrue(showResponsesTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showResponsesTo.size(), 2); + + assertTrue(showGiverNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertEquals(showGiverNameTo.size(), 1); + + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showRecipientNameTo.size(), 2); + break; + + case "Shown anonymously to recipient and giver/recipient's team members, visible to instructors": + assertTrue(showResponsesTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.RECEIVER)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.OWN_TEAM_MEMBERS)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS)); + assertEquals(showResponsesTo.size(), 4); + + assertTrue(showGiverNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertEquals(showGiverNameTo.size(), 1); + + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showRecipientNameTo.size(), 2); + break; + + case "Visible to recipient and instructors": + assertTrue(showResponsesTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showResponsesTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showResponsesTo.size(), 2); + + assertTrue(showGiverNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showGiverNameTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showGiverNameTo.size(), 2); + + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.INSTRUCTORS)); + assertTrue(showRecipientNameTo.contains(FeedbackParticipantType.RECEIVER)); + assertEquals(showRecipientNameTo.size(), 2); + break; + + default: + verifyCustomQuestionVisibility(questionNum, feedbackQuestion); + break; + } + } + + private void verifyCustomQuestionVisibility(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + WebElement questionForm = getQuestionForm(questionNum); + String visibility = questionForm.findElement(By.cssSelector("#btn-question-visibility span")).getText(); + assertEquals(visibility, CUSTOM_VISIBILITY_OPTION); + + FeedbackParticipantType giver = feedbackQuestion.getGiverType(); + FeedbackParticipantType receiver = feedbackQuestion.getRecipientType(); + WebElement customVisibilityTable = questionForm.findElement(By.id("custom-visibility-table")); + assertVisibilityBoxesSelected(customVisibilityTable, giver, receiver, feedbackQuestion.getShowResponsesTo(), 1); + assertVisibilityBoxesSelected(customVisibilityTable, giver, receiver, feedbackQuestion.getShowGiverNameTo(), 2); + assertVisibilityBoxesSelected(customVisibilityTable, giver, receiver, feedbackQuestion.getShowRecipientNameTo(), 3); + } + + private void assertVisibilityBoxesSelected(WebElement table, FeedbackParticipantType giver, + FeedbackParticipantType receiver, List participants, + int colNum) { + List possibleTypes = new ArrayList(Arrays.asList(FeedbackParticipantType.RECEIVER, + FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.RECEIVER_TEAM_MEMBERS, + FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS)); + if (!giver.equals(FeedbackParticipantType.STUDENTS)) { + possibleTypes.remove(FeedbackParticipantType.OWN_TEAM_MEMBERS); + } + if (!receiver.equals(FeedbackParticipantType.STUDENTS)) { + possibleTypes.remove(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS); + } + if (receiver.equals(FeedbackParticipantType.NONE) + || receiver.equals(FeedbackParticipantType.SELF) + || receiver.equals(FeedbackParticipantType.OWN_TEAM)) { + possibleTypes.remove(FeedbackParticipantType.RECEIVER); + possibleTypes.remove(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS); + } + + List rows = table.findElements(By.tagName("tr")); + int index = colNum - 1; + for (FeedbackParticipantType participant : participants) { + assertTrue(rows.get(possibleTypes.indexOf(participant)).findElements(By.tagName("input")).get(index) + .isSelected()); + } + } + + public void addTemplateQuestion(int optionNum) { + addNewQuestion(1); + WebElement templateQuestionModal = waitForElementPresence(By.id("template-question-modal")); + + click(templateQuestionModal.findElements(By.tagName("input")).get(optionNum - 1)); + clickAndWaitForNewQuestion(browser.driver.findElement(By.id("btn-confirm-template"))); + } + + public void copyQuestion(String courseId, String questionText) { + click(copyQuestionButton); + WebElement copyQuestionModal = waitForElementPresence(By.id("copy-question-modal")); + + List rows = copyQuestionModal.findElements(By.cssSelector("tbody tr")); + for (WebElement row : rows) { + List cells = row.findElements(By.tagName("td")); + if (cells.get(1).getText().equals(courseId) && cells.get(4).getText().equals(questionText)) { + markOptionAsSelected(cells.get(0).findElement(By.tagName("input"))); + } + } + clickAndWaitForNewQuestion(browser.driver.findElement(By.id("btn-confirm-copy-question"))); + } + + public void editQuestionNumber(int questionNum, int newQuestionNumber) { + clickEditQuestionButton(questionNum); + selectDropdownOptionByText(getQuestionForm(questionNum).findElement(By.id("question-number-dropdown")), + Integer.toString(newQuestionNumber)); + clickSaveQuestionButton(questionNum); + } + + public void editQuestionDetails(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + clickEditQuestionButton(questionNum); + inputQuestionDetails(questionNum, feedbackQuestion); + clickSaveQuestionButton(questionNum); + } + + private void inputQuestionDetails(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + setQuestionBrief(questionNum, feedbackQuestion.getQuestionDetails().getQuestionText()); + setQuestionDescription(questionNum, feedbackQuestion.getQuestionDescription()); + FeedbackQuestionType questionType = feedbackQuestion.getQuestionType(); + if (!questionType.equals(FeedbackQuestionType.CONTRIB)) { + setFeedbackPath(questionNum, feedbackQuestion); + setQuestionVisibility(questionNum, feedbackQuestion); + } + } + + public void duplicateQuestion(int questionNum) { + clickAndWaitForNewQuestion(getQuestionForm(questionNum).findElement(By.id("btn-duplicate-question"))); + } + + public void deleteQuestion(int questionNum) { + clickAndConfirm(getQuestionForm(questionNum).findElement(By.id("btn-delete-question"))); + } + + public void verifyTextQuestionDetails(int questionNum, FeedbackTextQuestionDetails questionDetails) { + String recommendLength = getRecommendedTextLengthField(questionNum).getAttribute("value"); + assertEquals(recommendLength, questionDetails.getRecommendedLength().toString()); + } + + public void addTextQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(2); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackTextQuestionDetails questionDetails = (FeedbackTextQuestionDetails) feedbackQuestion.getQuestionDetails(); + fillTextBox(getRecommendedTextLengthField(questionNum), questionDetails.getRecommendedLength().toString()); + clickSaveNewQuestionButton(); + } + + public void editTextQuestion(int questionNum, FeedbackTextQuestionDetails textQuestionDetails) { + clickEditQuestionButton(questionNum); + WebElement recommendedTextLengthField = getRecommendedTextLengthField(questionNum); + waitForElementToBeClickable(recommendedTextLengthField); + fillTextBox(recommendedTextLengthField, textQuestionDetails.getRecommendedLength().toString()); + clickSaveQuestionButton(questionNum); + } + + public void verifyMcqQuestionDetails(int questionNum, FeedbackMcqQuestionDetails questionDetails) { + if (verifyGeneratedOptions(questionNum, questionDetails.getGenerateOptionsFor())) { + return; + } + verifyOptions(questionNum, questionDetails.getMcqChoices()); + verifyOptionWeights(questionNum, questionDetails.hasAssignedWeights(), questionDetails.getMcqWeights()); + verifyOtherOption(questionNum, questionDetails.isOtherEnabled(), questionDetails.getMcqOtherWeight()); + } + + public void addMcqQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(3); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackMcqQuestionDetails questionDetails = (FeedbackMcqQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputMcqDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void editMcqQuestion(int questionNum, FeedbackMcqQuestionDetails questionDetails) { + clickEditQuestionButton(questionNum); + inputMcqDetails(questionNum, questionDetails); + clickSaveQuestionButton(questionNum); + } + + public void verifyMsqQuestionDetails(int questionNum, FeedbackMsqQuestionDetails questionDetails) { + verifyMaxOptions(questionNum, questionDetails.getMaxSelectableChoices()); + verifyMinOptions(questionNum, questionDetails.getMinSelectableChoices()); + if (verifyGeneratedOptions(questionNum, questionDetails.getGenerateOptionsFor())) { + return; + } + verifyOptions(questionNum, questionDetails.getMsqChoices()); + verifyOptionWeights(questionNum, questionDetails.hasAssignedWeights(), questionDetails.getMsqWeights()); + verifyOtherOption(questionNum, questionDetails.isOtherEnabled(), questionDetails.getMsqOtherWeight()); + } + + public void addMsqQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(4); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackMsqQuestionDetails questionDetails = (FeedbackMsqQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputMsqDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void editMsqQuestion(int questionNum, FeedbackMsqQuestionDetails msqQuestionDetails) { + clickEditQuestionButton(questionNum); + inputMsqDetails(questionNum, msqQuestionDetails); + clickSaveQuestionButton(questionNum); + } + + public void verifyNumScaleQuestionDetails(int questionNum, FeedbackNumericalScaleQuestionDetails questionDetails) { + assertEquals(getMinNumscaleInput(questionNum).getAttribute("value"), + Integer.toString(questionDetails.getMinScale())); + assertEquals(getNumScaleIncrementInput(questionNum).getAttribute("value"), + getDoubleString(questionDetails.getStep())); + assertEquals(getMaxNumscaleInput(questionNum).getAttribute("value"), + Integer.toString(questionDetails.getMaxScale())); + } + + public void addNumScaleQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(5); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackNumericalScaleQuestionDetails questionDetails = + (FeedbackNumericalScaleQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputNumScaleDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void editNumScaleQuestion(int questionNum, FeedbackNumericalScaleQuestionDetails questionDetails) { + clickEditQuestionButton(questionNum); + inputNumScaleDetails(questionNum, questionDetails); + clickSaveQuestionButton(questionNum); + } + + public void verifyConstSumQuestionDetails(int questionNum, FeedbackConstantSumQuestionDetails questionDetails) { + if (!questionDetails.isDistributeToRecipients()) { + verifyOptions(questionNum, questionDetails.getConstSumOptions()); + } + + if (questionDetails.isPointsPerOption()) { + assertTrue(getConstSumPerOptionPointsRadioBtn(questionNum).isSelected()); + assertEquals(getConstSumPerOptionPointsInput(questionNum).getAttribute("value"), + Integer.toString(questionDetails.getPoints())); + assertFalse(getConstSumTotalPointsRadioBtn(questionNum).isSelected()); + } else { + assertTrue(getConstSumTotalPointsRadioBtn(questionNum).isSelected()); + assertEquals(getConstSumTotalPointsInput(questionNum).getAttribute("value"), + Integer.toString(questionDetails.getPoints())); + assertFalse(getConstSumPerOptionPointsRadioBtn(questionNum).isSelected()); + } + + if (questionDetails.isForceUnevenDistribution()) { + String distributeFor = questionDetails.getDistributePointsFor(); + assertTrue(getConstSumUnevenDistributionCheckbox(questionNum).isSelected()); + assertEquals(getSelectedDropdownOptionText(getConstSumUnevenDistributionDropdown(questionNum)).trim(), + "All options".equals(distributeFor) ? "Every option" : distributeFor); + } else { + assertFalse(getConstSumUnevenDistributionCheckbox(questionNum).isSelected()); + } + } + + public void addConstSumOptionQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(6); + addConstSumQuestion(feedbackQuestion); + } + + public void addConstSumRecipientQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(7); + addConstSumQuestion(feedbackQuestion); + } + + public void addConstSumQuestion(FeedbackQuestionAttributes feedbackQuestion) { + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackConstantSumQuestionDetails questionDetails = + (FeedbackConstantSumQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputConstSumDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void editConstSumQuestion(int questionNum, FeedbackConstantSumQuestionDetails csQuestionDetails) { + clickEditQuestionButton(questionNum); + inputConstSumDetails(questionNum, csQuestionDetails); + clickSaveQuestionButton(questionNum); + } + + public void verifyContributionQuestionDetails(int questionNum, FeedbackContributionQuestionDetails questionDetails) { + assertEquals(questionDetails.isNotSureAllowed(), getAllowNotSureContributionCheckbox(questionNum).isSelected()); + } + + public void addContributionQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(8); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackContributionQuestionDetails questionDetails = + (FeedbackContributionQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputContributionDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void editContributionQuestion(int questionNum, FeedbackContributionQuestionDetails questionDetails) { + clickEditQuestionButton(questionNum); + inputContributionDetails(questionNum, questionDetails); + clickSaveQuestionButton(questionNum); + } + + public void verifyRubricQuestionDetails(int questionNum, FeedbackRubricQuestionDetails questionDetails) { + int numChoices = questionDetails.getNumOfRubricChoices(); + List choices = questionDetails.getRubricChoices(); + for (int i = 0; i < numChoices; i++) { + assertEquals(choices.get(i), getRubricChoiceInputs(questionNum).get(i).getAttribute("value")); + } + + int numSubQn = questionDetails.getNumOfRubricSubQuestions(); + List subQuestions = questionDetails.getRubricSubQuestions(); + List> descriptions = questionDetails.getRubricDescriptions(); + for (int i = 0; i < numSubQn; i++) { + List textAreas = getRubricTextareas(questionNum, i + 2); + assertEquals(subQuestions.get(i), textAreas.get(0).getAttribute("value")); + for (int j = 0; j < numChoices; j++) { + assertEquals(descriptions.get(i).get(j), textAreas.get(j + 1).getAttribute("value")); + } + } + + if (questionDetails.hasAssignedWeights()) { + assertTrue(getWeightCheckbox(questionNum).isSelected()); + List> weights = questionDetails.getRubricWeights(); + for (int i = 0; i < numSubQn; i++) { + List rubricWeights = getRubricWeights(questionNum, i + 2); + for (int j = 0; j < numChoices; j++) { + assertEquals(rubricWeights.get(j).getAttribute("value"), + getDoubleString(weights.get(i).get(j))); + } + } + } else { + assertFalse(getWeightCheckbox(questionNum).isSelected()); + } + } + + public void addRubricQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(9); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackRubricQuestionDetails questionDetails = + (FeedbackRubricQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputRubricDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void editRubricQuestion(int questionNum, FeedbackRubricQuestionDetails questionDetails) { + clickEditQuestionButton(questionNum); + inputRubricDetails(questionNum, questionDetails); + clickSaveQuestionButton(questionNum); + } + + public void verifyRankQuestionDetails(int questionNum, FeedbackRankQuestionDetails questionDetails) { + if (questionDetails instanceof FeedbackRankOptionsQuestionDetails) { + FeedbackRankOptionsQuestionDetails optionDetails = (FeedbackRankOptionsQuestionDetails) questionDetails; + verifyOptions(questionNum, optionDetails.getOptions()); + } + assertEquals(getAllowDuplicateRankCheckbox(questionNum).isSelected(), questionDetails.areDuplicatesAllowed()); + verifyMaxOptions(questionNum, questionDetails.getMaxOptionsToBeRanked()); + verifyMinOptions(questionNum, questionDetails.getMinOptionsToBeRanked()); + } + + public void addRankOptionsQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(10); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackRankOptionsQuestionDetails questionDetails = + (FeedbackRankOptionsQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputRankDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void addRankRecipientsQuestion(FeedbackQuestionAttributes feedbackQuestion) { + addNewQuestion(11); + int questionNum = getNumQuestions(); + inputQuestionDetails(questionNum, feedbackQuestion); + FeedbackRankQuestionDetails questionDetails = + (FeedbackRankQuestionDetails) feedbackQuestion.getQuestionDetails(); + inputRankDetails(questionNum, questionDetails); + clickSaveNewQuestionButton(); + } + + public void editRankQuestion(int questionNum, FeedbackRankQuestionDetails questionDetails) { + clickEditQuestionButton(questionNum); + inputRankDetails(questionNum, questionDetails); + clickSaveQuestionButton(questionNum); + } + + private String getCourseId() { + return courseIdTextBox.getText(); + } + + private String getCourseName() { + return courseNameTextBox.getText(); + } + + private String getTimeZone() { + return timezoneDropDown.getText(); + } + + private String getFeedbackSessionName() { + return sessionNameTextBox.getText(); + } + + private String getInstructions() { + return getEditorRichText(instructionsEditor.findElement(By.tagName("editor"))); + } + + private String getStartDate() { + return startDateBox.getAttribute("value"); + } + + private String getStartTime() { + return getSelectedDropdownOptionText(startTimeDropdown.findElement(By.tagName("select"))); + } + + private String getEndDate() { + return endDateBox.getAttribute("value"); + } + + private String getEndTime() { + return getSelectedDropdownOptionText(endTimeDropdown.findElement(By.tagName("select"))); + } + + private String getSessionVisibilityDate() { + return sessionVisibilityDateBox.getAttribute("value"); + } + + private String getSessionVisibilityTime() { + return getSelectedDropdownOptionText(sessionVisibilityTimeDropdown.findElement(By.tagName("select"))); + } + + private String getResponseVisibilityDate() { + return responseVisibilityDateBox.getAttribute("value"); + } + + private String getResponseVisibilityTime() { + return getSelectedDropdownOptionText(responseVisibilityTimeDropdown.findElement(By.tagName("select"))); + } + + private String getGracePeriod() { + return getSelectedDropdownOptionText(gracePeriodDropdown); + } + + private String getSubmissionStatus() { + return submissionStatusTextBox.getText(); + } + + private String getPublishedStatus() { + return publishStatusTextBox.getText(); + } + + private String getDateString(Instant instant, ZoneId timeZone) { + return DateTimeFormatter + .ofPattern("EE, dd MMM, yyyy") + .format(instant.atZone(timeZone)); + } + + private String getTimeString(Instant instant, ZoneId timeZone) { + ZonedDateTime dateTime = instant.atZone(timeZone); + if (dateTime.getHour() == 23 && dateTime.getMinute() == 59) { + return "23:59H"; + } + return DateTimeFormatter + .ofPattern("HH:00") + .format(instant.atZone(timeZone)) + "H"; + } + + private void setInstructions(String newInstructions) { + writeToRichTextEditor(instructionsEditor.findElement(By.tagName("editor")), newInstructions); + } + + private void setSessionStartDateTime(Instant startInstant, ZoneId timeZone) { + setDateTime(startDateBox, startTimeDropdown, startInstant, timeZone); + } + + private void setSessionEndDateTime(Instant endInstant, ZoneId timeZone) { + setDateTime(endDateBox, endTimeDropdown, endInstant, timeZone); + } + + private void setVisibilityDateTime(Instant startInstant, ZoneId timeZone) { + setDateTime(sessionVisibilityDateBox, sessionVisibilityTimeDropdown, startInstant, timeZone); + } + + private void setResponseDateTime(Instant endInstant, ZoneId timeZone) { + setDateTime(responseVisibilityDateBox, responseVisibilityTimeDropdown, endInstant, timeZone); + } + + private void setDateTime(WebElement dateBox, WebElement timeBox, Instant startInstant, ZoneId timeZone) { + fillTextBox(dateBox, getDateString(startInstant, timeZone)); + + selectDropdownOptionByText(timeBox.findElement(By.tagName("select")), getTimeString(startInstant, timeZone)); + } + + private void selectGracePeriod(long gracePeriodMinutes) { + selectDropdownOptionByText(gracePeriodDropdown, gracePeriodMinutes + " min"); + } + + private void setVisibilitySettings(FeedbackSessionAttributes newFeedbackSession) { + showVisibilitySettings(); + + setSessionVisibilitySettings(newFeedbackSession); + setResponseVisibilitySettings(newFeedbackSession); + } + + private void setSessionVisibilitySettings(FeedbackSessionAttributes newFeedbackSession) { + Instant sessionDateTime = newFeedbackSession.getSessionVisibleFromTime(); + if (sessionDateTime.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING)) { + click(openSessionVisibleTimeButton); + } else { + click(customSessionVisibleTimeButton); + setVisibilityDateTime(sessionDateTime, newFeedbackSession.getTimeZone()); + } + } + + private void setResponseVisibilitySettings(FeedbackSessionAttributes newFeedbackSession) { + Instant responseDateTime = newFeedbackSession.getResultsVisibleFromTime(); + if (responseDateTime.equals(Const.TIME_REPRESENTS_FOLLOW_VISIBLE)) { + click(immediateResponseVisibleTimeButton); + } else if (responseDateTime.equals(Const.TIME_REPRESENTS_LATER)) { + click(manualResponseVisibleTimeButton); + } else { + click(customResponseVisibleTimeButton); + setResponseDateTime(responseDateTime, newFeedbackSession.getTimeZone()); + } + } + + private void setEmailSettings(FeedbackSessionAttributes newFeedbackSessionDetails) { + showEmailSettings(); + if (newFeedbackSessionDetails.isOpeningEmailEnabled() != openingSessionEmailCheckbox.isSelected()) { + click(openingSessionEmailCheckbox); + } + if (newFeedbackSessionDetails.isClosingEmailEnabled() != closingSessionEmailCheckbox.isSelected()) { + click(closingSessionEmailCheckbox); + } + if (newFeedbackSessionDetails.isPublishedEmailEnabled() != publishedSessionEmailCheckbox.isSelected()) { + click(publishedSessionEmailCheckbox); + } + } + + private void showVisibilitySettings() { + if (isElementPresent(By.id("btn-change-visibility"))) { + click(changeVisibilityButton); + } + } + + private void showEmailSettings() { + if (isElementPresent(By.id("btn-change-email"))) { + click(changeEmailButton); + } + } + + private int getNumQuestions() { + return browser.driver.findElements(By.tagName("tm-question-edit-form")).size(); + } + + private WebElement getQuestionForm(int questionNum) { + return browser.driver.findElements(By.tagName("tm-question-edit-form")).get(questionNum - 1); + } + + private FeedbackQuestionType getQuestionType(int questionNum) { + String questionDetails = getQuestionForm(questionNum).findElement(By.id("question-header")).getText(); + String questionType = questionDetails.split(" \\d+ ")[1].trim(); + + switch (questionType) { + case "Essay question": + return FeedbackQuestionType.TEXT; + case "Multiple-Choice (single answer) question": + return FeedbackQuestionType.MCQ; + case "Multiple-choice (multiple answers) question": + return FeedbackQuestionType.MSQ; + case "Numerical Scale Question": + return FeedbackQuestionType.NUMSCALE; + case "Distribute points (among options) question": + return FeedbackQuestionType.CONSTSUM_OPTIONS; + case "Distribute points (among recipients) question": + return FeedbackQuestionType.CONSTSUM_RECIPIENTS; + case "Team contribution question": + return FeedbackQuestionType.CONTRIB; + case "Rubric question": + return FeedbackQuestionType.RUBRIC; + case "Rank (options) question": + return FeedbackQuestionType.RANK_OPTIONS; + case "Rank (recipients) question": + return FeedbackQuestionType.RANK_RECIPIENTS; + default: + throw new IllegalArgumentException("Unknown FeedbackQuestionType"); + } + } + + private int getQuestionNumber(int questionNum) { + return Integer.parseInt(getQuestionForm(questionNum).findElement(By.id("question-number")).getText()); + } + + private String getQuestionBrief(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("question-brief")).getAttribute("value"); + } + + private String getQuestionDescription(int questionNum) { + WebElement editor = waitForElementPresence(By.cssSelector("#question-form-" + questionNum + " editor")); + return getEditorRichText(editor); + } + + private String getFeedbackGiver(int questionNum) { + String feedbackPath = getFeedbackPath(questionNum); + if (feedbackPath.equals(CUSTOM_FEEDBACK_PATH_OPTION)) { + return getSelectedDropdownOptionText(getQuestionForm(questionNum).findElement(By.id("giver-type"))); + } + return feedbackPath.split(FEEDBACK_PATH_SEPARATOR)[0]; + } + + private String getFeedbackReceiver(int questionNum) { + String feedbackPath = getFeedbackPath(questionNum); + if (feedbackPath.equals(CUSTOM_FEEDBACK_PATH_OPTION)) { + return getSelectedDropdownOptionText(getQuestionForm(questionNum).findElement(By.id("receiver-type"))); + } + return feedbackPath.split(FEEDBACK_PATH_SEPARATOR)[1]; + } + + private String getFeedbackPath(int questionNum) { + WebElement questionForm = getQuestionForm(questionNum); + return questionForm.findElement(By.cssSelector("#btn-feedback-path span")).getText(); + } + + private void setQuestionBrief(int questionNum, String newBrief) { + fillTextBox(getQuestionForm(questionNum).findElement(By.id("question-brief")), newBrief); + } + + private void setQuestionDescription(int questionNum, String newDescription) { + WebElement editor = waitForElementPresence(By.cssSelector("#question-form-" + questionNum + " editor")); + writeToRichTextEditor(editor, newDescription); + } + + private void setFeedbackPath(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + FeedbackParticipantType newGiver = feedbackQuestion.getGiverType(); + FeedbackParticipantType newRecipient = feedbackQuestion.getRecipientType(); + String feedbackPath = getFeedbackPath(questionNum); + WebElement questionForm = getQuestionForm(questionNum); + if (!feedbackPath.equals(CUSTOM_FEEDBACK_PATH_OPTION)) { + selectFeedbackPathDropdownOption(questionNum, CUSTOM_FEEDBACK_PATH_OPTION + "..."); + } + // Set to type STUDENT first to adjust NumberOfEntitiesToGiveFeedbackTo + selectDropdownOptionByText(questionForm.findElement(By.id("giver-type")), + FeedbackParticipantType.STUDENTS.toDisplayGiverName()); + selectDropdownOptionByText(questionForm.findElement(By.id("receiver-type")), + FeedbackParticipantType.STUDENTS.toDisplayRecipientName()); + if (feedbackQuestion.getNumberOfEntitiesToGiveFeedbackTo() == Const.MAX_POSSIBLE_RECIPIENTS) { + click(questionForm.findElement(By.id("unlimited-recipients"))); + } else { + click(questionForm.findElement(By.id("custom-recipients"))); + fillTextBox(questionForm.findElement(By.id("custom-recipients-number")), + Integer.toString(feedbackQuestion.getNumberOfEntitiesToGiveFeedbackTo())); + } + + selectDropdownOptionByText(questionForm.findElement(By.id("giver-type")), newGiver.toDisplayGiverName()); + selectDropdownOptionByText(questionForm.findElement(By.id("receiver-type")), + newRecipient.toDisplayRecipientName()); + } + + private void selectFeedbackPathDropdownOption(int questionNum, String text) { + WebElement questionForm = getQuestionForm(questionNum); + click(questionForm.findElement(By.id("btn-feedback-path"))); + WebElement dropdown = questionForm.findElement(By.id("feedback-path-dropdown")); + List options = dropdown.findElements(By.className("dropdown-item")); + for (WebElement option : options) { + if (option.getText().equals(text)) { + click(option); + return; + } + } + } + + private void clickEditQuestionButton(int questionNum) { + click(getQuestionForm(questionNum).findElement(By.id("btn-edit-question"))); + } + + private void clickSaveQuestionButton(int questionNum) { + WebElement saveButton = getQuestionForm(questionNum).findElement(By.id("btn-save-question")); + click(saveButton); + ThreadHelper.waitFor(1000); + } + + private void setQuestionVisibility(int questionNum, FeedbackQuestionAttributes feedbackQuestion) { + WebElement questionForm = getQuestionForm(questionNum); + String visibility = questionForm.findElement(By.cssSelector("#btn-question-visibility span")).getText(); + if (!visibility.equals(CUSTOM_VISIBILITY_OPTION)) { + selectVisibilityDropdownOption(questionNum, CUSTOM_VISIBILITY_OPTION + "..."); + } + + FeedbackParticipantType giver = feedbackQuestion.getGiverType(); + FeedbackParticipantType receiver = feedbackQuestion.getRecipientType(); + WebElement customVisibilityTable = questionForm.findElement(By.id("custom-visibility-table")); + selectVisibilityBoxes(customVisibilityTable, giver, receiver, feedbackQuestion.getShowResponsesTo(), 1); + selectVisibilityBoxes(customVisibilityTable, giver, receiver, feedbackQuestion.getShowGiverNameTo(), 2); + selectVisibilityBoxes(customVisibilityTable, giver, receiver, feedbackQuestion.getShowRecipientNameTo(), 3); + } + + private void selectVisibilityBoxes(WebElement table, FeedbackParticipantType giver, + FeedbackParticipantType receiver, List participants, + int colNum) { + List possibleTypes = new ArrayList(Arrays.asList(FeedbackParticipantType.RECEIVER, + FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.RECEIVER_TEAM_MEMBERS, + FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS)); + if (!giver.equals(FeedbackParticipantType.STUDENTS)) { + possibleTypes.remove(FeedbackParticipantType.OWN_TEAM_MEMBERS); + } + if (!receiver.equals(FeedbackParticipantType.STUDENTS)) { + possibleTypes.remove(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS); + } + if (receiver.equals(FeedbackParticipantType.NONE) + || receiver.equals(FeedbackParticipantType.SELF) + || receiver.equals(FeedbackParticipantType.OWN_TEAM)) { + possibleTypes.remove(FeedbackParticipantType.RECEIVER); + possibleTypes.remove(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS); + } + + List rows = table.findElements(By.tagName("tr")); + int index = colNum - 1; + for (FeedbackParticipantType participant : participants) { + markOptionAsSelected(rows.get(possibleTypes.indexOf(participant)).findElements(By.tagName("input")).get(index)); + } + } + + private void selectVisibilityDropdownOption(int questionNum, String text) { + WebElement questionForm = getQuestionForm(questionNum); + click(questionForm.findElement(By.id("btn-question-visibility"))); + WebElement dropdown = questionForm.findElement(By.id("question-visibility-dropdown")); + List options = dropdown.findElements(By.className("dropdown-item")); + for (WebElement option : options) { + if (option.getText().equals(text)) { + click(option); + return; + } + } + } + + private void clickAndWaitForNewQuestion(WebElement button) { + int newQuestionNum = getNumQuestions() + 1; + click(button); + waitForElementPresence(By.id("question-form-" + newQuestionNum)); + } + + private void addNewQuestion(int optionNumber) { + click(addNewQuestionButton); + WebElement newQuestionDropdown = waitForElementPresence(By.id("new-question-dropdown")); + click(newQuestionDropdown.findElements(By.tagName("button")).get(optionNumber - 1)); + } + + private void clickSaveNewQuestionButton() { + WebElement saveButton = browser.driver.findElement(By.id("btn-save-new")); + click(saveButton); + waitForElementStaleness(saveButton); + } + + private WebElement getRecommendedTextLengthField(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("recommended-length")); + } + + private WebElement getGenerateOptionsCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("generate-checkbox")); + } + + private WebElement getGenerateOptionsDropdown(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("generate-dropdown")); + } + + private WebElement getWeightCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("weights-checkbox")); + } + + private WebElement getOtherOptionCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("other-checkbox")); + } + + private String getGeneratedOptionString(FeedbackParticipantType type) { + switch (type) { + case STUDENTS: + return "students"; + case STUDENTS_EXCLUDING_SELF: + return "students (excluding self)"; + case TEAMS: + return "teams"; + case TEAMS_EXCLUDING_SELF: + return "teams (excluding own team)"; + case INSTRUCTORS: + return "instructors"; + default: + return "unknown"; + } + } + + private String getDoubleString(Double value) { + return value % 1 == 0 ? Integer.toString(value.intValue()) : Double.toString(value); + } + + private WebElement getOptionsSection(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("options-section")); + } + + private List getOptionInputs(int questionNum) { + WebElement optionsSection = getOptionsSection(questionNum); + return optionsSection.findElements(By.cssSelector("input[type='text']")); + } + + private List getOptionWeightInputs(int questionNum) { + WebElement optionsSection = getOptionsSection(questionNum); + return optionsSection.findElements(By.cssSelector("tm-weight-field input")); + } + + private WebElement getOtherWeightInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("other-weight")); + } + + private boolean verifyGeneratedOptions(int questionNum, FeedbackParticipantType participantType) { + if (!participantType.equals(FeedbackParticipantType.NONE)) { + assertTrue(getGenerateOptionsCheckbox(questionNum).isSelected()); + assertEquals(getSelectedDropdownOptionText(getGenerateOptionsDropdown(questionNum)), + getGeneratedOptionString(participantType)); + return true; + } + assertFalse(getGenerateOptionsCheckbox(questionNum).isSelected()); + return false; + } + + private void verifyOptions(int questionNum, List options) { + List inputs = getOptionInputs(questionNum); + for (int i = 0; i < options.size(); i++) { + assertEquals(options.get(i), inputs.get(i).getAttribute("value")); + } + } + + private void verifyOptionWeights(int questionNum, boolean hasWeights, List weights) { + if (hasWeights) { + assertTrue(getWeightCheckbox(questionNum).isSelected()); + List weightInputs = getOptionWeightInputs(questionNum); + for (int i = 0; i < weights.size(); i++) { + assertEquals(getDoubleString(weights.get(i)), weightInputs.get(i).getAttribute("value")); + } + } else { + assertFalse(getWeightCheckbox(questionNum).isSelected()); + } + } + + private void verifyOtherOption(int questionNum, boolean hasOther, Double weight) { + if (hasOther) { + assertTrue(getOtherOptionCheckbox(questionNum).isSelected()); + if (weight > 0) { + String otherWeight = getOtherWeightInput(questionNum).getAttribute("value"); + assertEquals(getDoubleString(weight), otherWeight); + } + } else { + assertFalse(getOtherOptionCheckbox(questionNum).isSelected()); + } + } + + private void inputMcqDetails(int questionNum, FeedbackMcqQuestionDetails questionDetails) { + if (inputGenerateOptions(questionNum, questionDetails.getGenerateOptionsFor())) { + return; + } + + inputOptions(questionNum, questionDetails.getMcqChoices()); + inputOptionWeights(questionNum, questionDetails.hasAssignedWeights(), questionDetails.getMcqWeights()); + inputOtherChoice(questionNum, questionDetails.isOtherEnabled(), questionDetails.getMcqOtherWeight()); + } + + private boolean inputGenerateOptions(int questionNum, FeedbackParticipantType participantType) { + if (!participantType.equals(FeedbackParticipantType.NONE)) { + markOptionAsSelected(getGenerateOptionsCheckbox(questionNum)); + selectDropdownOptionByText(getGenerateOptionsDropdown(questionNum), + getGeneratedOptionString(participantType)); + clickSaveQuestionButton(questionNum); + return true; + } + markOptionAsUnselected(getGenerateOptionsCheckbox(questionNum)); + return false; + } + + private void inputOptions(int questionNum, List options) { + List inputs = getOptionInputs(questionNum); + int numInputsNeeded = options.size() - inputs.size(); + if (numInputsNeeded > 0) { + for (int i = 0; i < numInputsNeeded; i++) { + click(getQuestionForm(questionNum).findElement(By.id("btn-add-option"))); + } + inputs = getOptionInputs(questionNum); + } + if (numInputsNeeded < 0) { + for (int i = 0; i < -numInputsNeeded; i++) { + click(getOptionsSection(questionNum).findElement(By.tagName("button"))); + } + inputs = getOptionInputs(questionNum); + } + + for (int i = 0; i < options.size(); i++) { + fillTextBox(inputs.get(i), options.get(i)); + } + } + + private void inputOptionWeights(int questionNum, boolean hasWeights, List weights) { + if (hasWeights) { + markOptionAsSelected(getWeightCheckbox(questionNum)); + List weightInputs = getOptionWeightInputs(questionNum); + for (int i = 0; i < weights.size(); i++) { + fillTextBox(weightInputs.get(i), getDoubleString(weights.get(i))); + } + } else { + markOptionAsUnselected(getWeightCheckbox(questionNum)); + } + } + + private void inputOtherChoice(int questionNum, boolean hasOther, Double otherWeight) { + if (hasOther) { + markOptionAsSelected(getOtherOptionCheckbox(questionNum)); + if (otherWeight > 0) { + fillTextBox(getOtherWeightInput(questionNum), getDoubleString(otherWeight)); + } + } else { + markOptionAsUnselected(getOtherOptionCheckbox(questionNum)); + } + } + + private WebElement getMaxOptionsCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("max-options-checkbox")); + } + + private WebElement getMaxOptionsInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("max-options")); + } + + private WebElement getMinOptionsCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("min-options-checkbox")); + } + + private WebElement getMinOptionsInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("min-options")); + } + + private void verifyMaxOptions(int questionNum, int maxOptions) { + if (maxOptions == Integer.MIN_VALUE) { + assertFalse(getMaxOptionsCheckbox(questionNum).isSelected()); + } else { + assertTrue(getMaxOptionsCheckbox(questionNum).isSelected()); + assertEquals(getMaxOptionsInput(questionNum).getAttribute("value"), + Integer.toString(maxOptions)); + } + } + + private void verifyMinOptions(int questionNum, int minOptions) { + if (minOptions == Integer.MIN_VALUE) { + assertFalse(getMinOptionsCheckbox(questionNum).isSelected()); + } else { + assertTrue(getMinOptionsCheckbox(questionNum).isSelected()); + assertEquals(getMinOptionsInput(questionNum).getAttribute("value"), + Integer.toString(minOptions)); + } + } + + private void inputMsqDetails(int questionNum, FeedbackMsqQuestionDetails questionDetails) { + if (inputGenerateOptions(questionNum, questionDetails.getGenerateOptionsFor())) { + return; + } + + inputOptions(questionNum, questionDetails.getMsqChoices()); + inputOptionWeights(questionNum, questionDetails.hasAssignedWeights(), questionDetails.getMsqWeights()); + inputOtherChoice(questionNum, questionDetails.isOtherEnabled(), questionDetails.getMsqOtherWeight()); + inputMaxOptions(questionNum, questionDetails.getMaxSelectableChoices()); + inputMinOptions(questionNum, questionDetails.getMinSelectableChoices()); + } + + private void inputMaxOptions(int questionNum, int maxOptions) { + if (maxOptions == Integer.MIN_VALUE) { + markOptionAsUnselected(getMaxOptionsCheckbox(questionNum)); + } else { + markOptionAsSelected(getMaxOptionsCheckbox(questionNum)); + fillTextBox(getMaxOptionsInput(questionNum), Integer.toString(maxOptions)); + } + } + + private void inputMinOptions(int questionNum, int minOptions) { + if (minOptions == Integer.MIN_VALUE) { + markOptionAsUnselected(getMinOptionsCheckbox(questionNum)); + } else { + markOptionAsSelected(getMinOptionsCheckbox(questionNum)); + fillTextBox(getMinOptionsInput(questionNum), Integer.toString(minOptions)); + } + } + + private WebElement getMinNumscaleInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("min-value")); + } + + private WebElement getMaxNumscaleInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("max-value")); + } + + private WebElement getNumScaleIncrementInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("increment-value")); + } + + private void inputNumScaleDetails(int questionNum, FeedbackNumericalScaleQuestionDetails questionDetails) { + inputNumScaleValue(getMinNumscaleInput(questionNum), Integer.toString(questionDetails.getMinScale())); + inputNumScaleValue(getNumScaleIncrementInput(questionNum), getDoubleString(questionDetails.getStep())); + inputNumScaleValue(getMaxNumscaleInput(questionNum), Integer.toString(questionDetails.getMaxScale())); + } + + private void inputNumScaleValue(WebElement input, String value) { + input.clear(); + input.sendKeys(value); + } + + private WebElement getConstSumTotalPointsRadioBtn(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("total-points-radio")); + } + + private WebElement getConstSumTotalPointsInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("total-points")); + } + + private WebElement getConstSumPerOptionPointsRadioBtn(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("per-option-points-radio")); + } + + private WebElement getConstSumPerOptionPointsInput(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("per-option-points")); + } + + private WebElement getConstSumUnevenDistributionCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("uneven-distribution-checkbox")); + } + + private WebElement getConstSumUnevenDistributionDropdown(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("uneven-distribution-dropdown")); + } + + private void inputConstSumDetails(int questionNum, FeedbackConstantSumQuestionDetails questionDetails) { + if (!questionDetails.isDistributeToRecipients()) { + inputOptions(questionNum, questionDetails.getConstSumOptions()); + } + if (questionDetails.isPointsPerOption()) { + click(getConstSumPerOptionPointsRadioBtn(questionNum)); + fillTextBox(getConstSumPerOptionPointsInput(questionNum), Integer.toString(questionDetails.getPoints())); + } else { + click(getConstSumTotalPointsRadioBtn(questionNum)); + fillTextBox(getConstSumTotalPointsInput(questionNum), Integer.toString(questionDetails.getPoints())); + } + String distributeFor = questionDetails.getDistributePointsFor(); + if (questionDetails.isForceUnevenDistribution()) { + markOptionAsSelected(getConstSumUnevenDistributionCheckbox(questionNum)); + selectDropdownOptionByText(getConstSumUnevenDistributionDropdown(questionNum), + "All options".equals(distributeFor) ? "Every option" : distributeFor); + } else { + markOptionAsUnselected(getConstSumUnevenDistributionCheckbox(questionNum)); + } + } + + private WebElement getAllowNotSureContributionCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("not-sure-checkbox")); + } + + private void inputContributionDetails(int questionNum, FeedbackContributionQuestionDetails questionDetails) { + if (questionDetails.isNotSureAllowed()) { + markOptionAsSelected(getAllowNotSureContributionCheckbox(questionNum)); + } else { + markOptionAsUnselected(getAllowNotSureContributionCheckbox(questionNum)); + } + } + + private WebElement getRubricRow(int questionNum, int rowNumber) { + return getQuestionForm(questionNum).findElements(By.cssSelector("tm-rubric-question-edit-details-form tr")) + .get(rowNumber - 1); + } + + private List getRubricChoiceInputs(int questionNum) { + return getRubricRow(questionNum, 1).findElements(By.tagName("input")); + } + + private List getRubricTextareas(int questionNum, int rowNum) { + return getRubricRow(questionNum, rowNum).findElements(By.tagName("textarea")); + } + + private List getRubricWeights(int questionNum, int rowNum) { + return getRubricRow(questionNum, rowNum).findElements(By.tagName("input")); + } + + private WebElement getRubricDeleteSubQnBtn(int questionNum, int rowNum) { + return getRubricRow(questionNum, rowNum).findElement(By.id("btn-delete-subquestion")); + } + + private WebElement getRubricDeleteChoiceBtn(int questionNum, int colNum) { + return getRubricRow(questionNum, getNumRubricRows(questionNum)).findElements(By.id("btn-delete-choice")).get(colNum); + } + + private int getNumRubricRows(int questionNum) { + return getQuestionForm(questionNum).findElements(By.cssSelector("#rubric-table tr")).size(); + } + + private int getNumRubricCols(int questionNum) { + return getRubricRow(questionNum, 1).findElements(By.tagName("td")).size(); + } + + private void inputRubricDetails(int questionNum, FeedbackRubricQuestionDetails questionDetails) { + int numSubQn = questionDetails.getNumOfRubricSubQuestions(); + int numChoices = questionDetails.getNumOfRubricChoices(); + adjustNumRubricFields(questionNum, numSubQn, numChoices); + + List choices = questionDetails.getRubricChoices(); + for (int i = 0; i < numChoices; i++) { + fillTextBox(getRubricChoiceInputs(questionNum).get(i), choices.get(i)); + } + + List subQuestions = questionDetails.getRubricSubQuestions(); + List> descriptions = questionDetails.getRubricDescriptions(); + for (int i = 0; i < numSubQn; i++) { + List textAreas = getRubricTextareas(questionNum, i + 2); + fillTextBox(textAreas.get(0), subQuestions.get(i)); + for (int j = 0; j < numChoices; j++) { + if (descriptions.get(i).get(j).isEmpty()) { + // using clear does not work here + textAreas.get(j + 1).sendKeys(Keys.chord(Keys.CONTROL, "a")); + textAreas.get(j + 1).sendKeys(Keys.DELETE); + } else { + fillTextBox(textAreas.get(j + 1), descriptions.get(i).get(j)); + } + } + } + + if (questionDetails.hasAssignedWeights()) { + markOptionAsSelected(getWeightCheckbox(questionNum)); + List> weights = questionDetails.getRubricWeights(); + for (int i = 0; i < numSubQn; i++) { + for (int j = 0; j < numChoices; j++) { + fillTextBox(getRubricWeights(questionNum, i + 2).get(j), getDoubleString(weights.get(i).get(j))); + } + } + } else { + markOptionAsUnselected(getWeightCheckbox(questionNum)); + } + } + + private void adjustNumRubricFields(int questionNum, int numSubQn, int numChoices) { + int numSubQnsNeeded = numSubQn - (getNumRubricRows(questionNum) - 2); + int numChoicesNeeded = numChoices - (getNumRubricCols(questionNum) - 1); + if (numSubQnsNeeded > 0) { + for (int i = 0; i < numSubQnsNeeded; i++) { + click(getQuestionForm(questionNum).findElement(By.id("btn-add-row"))); + } + } + if (numChoicesNeeded > 0) { + for (int i = 0; i < numChoicesNeeded; i++) { + click(getQuestionForm(questionNum).findElement(By.id("btn-add-col"))); + } + } + if (numSubQnsNeeded < 0) { + for (int i = 0; i < -numSubQnsNeeded; i++) { + click(getRubricDeleteSubQnBtn(questionNum, 2)); + } + } + if (numChoicesNeeded < 0) { + for (int i = 0; i < -numChoicesNeeded; i++) { + clickAndConfirm(getRubricDeleteChoiceBtn(questionNum, 2)); + } + } + } + + private WebElement getAllowDuplicateRankCheckbox(int questionNum) { + return getQuestionForm(questionNum).findElement(By.id("duplicate-rank-checkbox")); + } + + private void inputRankDetails(int questionNum, FeedbackRankQuestionDetails questionDetails) { + if (questionDetails instanceof FeedbackRankOptionsQuestionDetails) { + FeedbackRankOptionsQuestionDetails optionDetails = (FeedbackRankOptionsQuestionDetails) questionDetails; + inputOptions(questionNum, optionDetails.getOptions()); + } + if (questionDetails.areDuplicatesAllowed()) { + markOptionAsSelected(getAllowDuplicateRankCheckbox(questionNum)); + } else { + markOptionAsUnselected(getAllowDuplicateRankCheckbox(questionNum)); + } + inputMaxOptions(questionNum, questionDetails.getMaxOptionsToBeRanked()); + inputMinOptions(questionNum, questionDetails.getMinOptionsToBeRanked()); + } +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackSessionsPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackSessionsPage.java new file mode 100644 index 00000000000..06f4f36918e --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackSessionsPage.java @@ -0,0 +1,550 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.Const; + +/** + * Represents the "Sessions" page for Instructors. + */ +public class InstructorFeedbackSessionsPage extends AppPage { + + @FindBy(id = "btn-add-session") + private WebElement addSessionButton; + + @FindBy(id = "session-type") + private WebElement sessionTypeDropdown; + + @FindBy(id = "add-course-id") + private WebElement courseIdDropdown; + + @FindBy(id = "add-session-name") + private WebElement sessionNameTextBox; + + @FindBy(id = "instructions") + private WebElement instructionsEditor; + + @FindBy(id = "submission-start-date") + private WebElement startDateBox; + + @FindBy(id = "submission-start-time") + private WebElement startTimeDropdown; + + @FindBy(id = "submission-end-date") + private WebElement endDateBox; + + @FindBy(id = "submission-end-time") + private WebElement endTimeDropdown; + + @FindBy(id = "grace-period") + private WebElement gracePeriodDropdown; + + @FindBy(id = "btn-change-visibility") + private WebElement changeVisibilityButton; + + @FindBy(id = "session-visibility-custom") + private WebElement customSessionVisibleTimeButton; + + @FindBy(id = "session-visibility-date") + private WebElement sessionVisibilityDateBox; + + @FindBy(id = "session-visibility-time") + private WebElement sessionVisibilityTimeDropdown; + + @FindBy(id = "session-visibility-at-open") + private WebElement openSessionVisibleTimeButton; + + @FindBy(id = "response-visibility-custom") + private WebElement customResponseVisibleTimeButton; + + @FindBy(id = "response-visibility-date") + private WebElement responseVisibilityDateBox; + + @FindBy(id = "response-visibility-time") + private WebElement responseVisibilityTimeDropdown; + + @FindBy(id = "response-visibility-immediately") + private WebElement immediateResponseVisibleTimeButton; + + @FindBy(id = "response-visibility-manually") + private WebElement manualResponseVisibleTimeButton; + + @FindBy(id = "btn-change-email") + private WebElement changeEmailButton; + + @FindBy(id = "email-opening") + private WebElement openingSessionEmailCheckbox; + + @FindBy(id = "email-closing") + private WebElement closingSessionEmailCheckbox; + + @FindBy(id = "email-published") + private WebElement publishedSessionEmailCheckbox; + + @FindBy(id = "btn-create-session") + private WebElement createSessionButton; + + @FindBy(id = "sessions-table") + private WebElement sessionsTable; + + @FindBy(id = "deleted-sessions-heading") + private WebElement deleteTableHeading; + + @FindBy(id = "btn-restore-all") + private WebElement restoreAllButton; + + @FindBy(id = "btn-delete-all") + private WebElement deleteAllButton; + + @FindBy(id = "deleted-sessions-table") + private WebElement deletedSessionsTable; + + public InstructorFeedbackSessionsPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageTitle().contains("Feedback Sessions"); + } + + public void verifySessionsTable(FeedbackSessionAttributes[] sessions) { + String[][] expectedValues = new String[sessions.length][4]; + for (int i = 0; i < sessions.length; i++) { + expectedValues[i] = getSessionDetails(sessions[i]); + } + verifyTableBodyValues(sessionsTable, expectedValues); + } + + public void verifySessionDetails(FeedbackSessionAttributes session) { + String[] expectedValues = getSessionDetails(session); + int rowId = getFeedbackSessionRowId(session.getCourseId(), session.getFeedbackSessionName()); + verifyTableRowValues(sessionsTable.findElements(By.cssSelector("tbody tr")).get(rowId), expectedValues); + } + + public void verifySoftDeletedSessionsTable(FeedbackSessionAttributes[] sessions) { + showDeleteTable(); + String[][] expectedValues = new String[sessions.length][4]; + for (int i = 0; i < sessions.length; i++) { + expectedValues[i] = getSoftDeletedSessionDetails(sessions[i]); + } + verifyTableBodyValues(deletedSessionsTable, expectedValues); + } + + public void verifyNumSoftDeleted(int expected) { + assertEquals(getNumSoftDeletedFeedbackSessions(), expected); + } + + public void verifyResponseRate(FeedbackSessionAttributes session, String expectedResponseRate) { + int rowId = getFeedbackSessionRowId(session.getCourseId(), session.getFeedbackSessionName()); + assertEquals(expectedResponseRate, getResponseRate(rowId)); + } + + public void addFeedbackSession(FeedbackSessionAttributes newSession, boolean isUsingTemplate) { + clickAddSessionButton(); + waitForElementPresence(By.cssSelector("#instructions iframe")); + + if (isUsingTemplate) { + selectDropdownOptionByText(sessionTypeDropdown, "session using template: team peer evaluation"); + } else { + selectDropdownOptionByText(sessionTypeDropdown, "session with my own questions"); + } + selectDropdownOptionByText(courseIdDropdown, newSession.getCourseId()); + fillTextBox(sessionNameTextBox, newSession.getFeedbackSessionName()); + setInstructions(newSession.getInstructions()); + setSessionStartDateTime(newSession.getStartTime(), newSession.getTimeZone()); + setSessionEndDateTime(newSession.getEndTime(), newSession.getTimeZone()); + selectGracePeriod(newSession.getGracePeriodMinutes()); + setVisibilitySettings(newSession); + setEmailSettings(newSession); + + clickCreateSessionButton(); + waitForSessionEditPage(); + } + + public void addCopyOfSession(FeedbackSessionAttributes sessionToCopy, CourseAttributes copyToCourse, + String newSessionName) { + clickAddSessionButton(); + click(browser.driver.findElement(By.id("btn-copy-session"))); + + selectCourseToCopy(copyToCourse.getId()); + fillTextBox(browser.driver.findElement(By.id("copy-session-name")), newSessionName); + selectSessionToCopy(sessionToCopy.getCourseId(), sessionToCopy.getFeedbackSessionName()); + + clickConfirmCopySessionButton(); + waitForSessionEditPage(); + } + + public void copySession(FeedbackSessionAttributes sessionToCopy, CourseAttributes copyToCourse, + String newSessionName) { + String copyFromCourse = sessionToCopy.getCourseId(); + String sessionName = sessionToCopy.getFeedbackSessionName(); + WebElement copyFsModal = clickCopyButtonInTable(copyFromCourse, sessionName); + + fillTextBox(copyFsModal.findElement(By.id("copy-session-name")), newSessionName); + selectCourseToCopyToInModal(copyFsModal, copyToCourse.getId()); + + click(browser.driver.findElement(By.id("btn-confirm-copy-course"))); + } + + public void moveToRecycleBin(FeedbackSessionAttributes sessionToDelete) { + int rowId = getFeedbackSessionRowId(sessionToDelete.getCourseId(), sessionToDelete.getFeedbackSessionName()); + clickAndConfirm(browser.driver.findElement(By.id("btn-soft-delete-" + rowId))); + waitUntilAnimationFinish(); + } + + public void restoreSession(FeedbackSessionAttributes sessionToRestore) { + showDeleteTable(); + int rowId = getSoftDeletedFeedbackSessionRowId(sessionToRestore.getCourseId(), + sessionToRestore.getFeedbackSessionName()); + click(browser.driver.findElement(By.id("btn-restore-" + rowId))); + waitUntilAnimationFinish(); + } + + public void deleteSession(FeedbackSessionAttributes sessionToRestore) { + showDeleteTable(); + int rowId = getSoftDeletedFeedbackSessionRowId(sessionToRestore.getCourseId(), + sessionToRestore.getFeedbackSessionName()); + clickAndConfirm(browser.driver.findElement(By.id("btn-delete-" + rowId))); + waitUntilAnimationFinish(); + } + + public void restoreAllSessions() { + click(restoreAllButton); + waitUntilAnimationFinish(); + } + + public void deleteAllSessions() { + clickAndConfirm(deleteAllButton); + waitUntilAnimationFinish(); + } + + public void showDeleteTable() { + if (!isElementVisible(By.id("sort-deleted-course-id"))) { + click(deleteTableHeading); + waitUntilAnimationFinish(); + } + } + + public void sendReminderEmail(FeedbackSessionAttributes session, StudentAttributes student) { + int rowId = getFeedbackSessionRowId(session.getCourseId(), session.getFeedbackSessionName()); + + click(browser.driver.findElement(By.id("btn-remind-" + rowId))); + selectStudentToEmail(student.email); + + click(browser.driver.findElement(By.id("btn-confirm-send-reminder"))); + } + + public void resendResultsLink(FeedbackSessionAttributes session, StudentAttributes student) { + int rowId = getFeedbackSessionRowId(session.getCourseId(), session.getFeedbackSessionName()); + + click(browser.driver.findElement(By.id("btn-results-" + rowId))); + click(waitForElementPresence(By.id("btn-resend-" + rowId))); + selectStudentToEmail(student.email); + + click(browser.driver.findElement(By.id("btn-confirm-resend-results"))); + } + + public void publishSessionResults(FeedbackSessionAttributes sessionToPublish) { + int rowId = getFeedbackSessionRowId(sessionToPublish.getCourseId(), sessionToPublish.getFeedbackSessionName()); + click(browser.driver.findElement(By.id("btn-results-" + rowId))); + clickAndConfirm(waitForElementPresence(By.id("btn-publish-" + rowId))); + } + + public void unpublishSessionResults(FeedbackSessionAttributes sessionToPublish) { + int rowId = getFeedbackSessionRowId(sessionToPublish.getCourseId(), sessionToPublish.getFeedbackSessionName()); + click(browser.driver.findElement(By.id("btn-results-" + rowId))); + clickAndConfirm(waitForElementPresence(By.id("btn-unpublish-" + rowId))); + } + + public void downloadResults(FeedbackSessionAttributes session) { + int rowId = getFeedbackSessionRowId(session.getCourseId(), session.getFeedbackSessionName()); + click(browser.driver.findElement(By.id("btn-results-" + rowId))); + click(waitForElementPresence(By.id("btn-download-" + rowId))); + } + + public void sortBySessionsName() { + click(waitForElementPresence(By.id("sort-session-name"))); + } + + public void sortByCourseId() { + click(waitForElementPresence(By.id("sort-course-id"))); + } + + private String[] getSessionDetails(FeedbackSessionAttributes session) { + String[] details = new String[4]; + details[0] = session.getCourseId(); + details[1] = session.getFeedbackSessionName(); + if (session.isClosed()) { + details[2] = "Closed"; + } else if (session.isVisible() && (session.isOpened() || session.isInGracePeriod())) { + details[2] = "Open"; + } else { + details[2] = "Awaiting"; + } + details[3] = session.isPublished() ? "Published" : "Not Published"; + return details; + } + + private String[] getSoftDeletedSessionDetails(FeedbackSessionAttributes session) { + String[] details = new String[4]; + details[0] = session.getCourseId(); + details[1] = session.getFeedbackSessionName(); + details[2] = getSimpleDateString(session.getCreatedTime(), session.getTimeZone()); + details[3] = getSimpleDateString(session.getDeletedTime(), session.getTimeZone()); + return details; + } + + private String getDateString(Instant instant, ZoneId timeZone) { + return DateTimeFormatter + .ofPattern("EE, dd MMM, yyyy") + .format(instant.atZone(timeZone)); + } + + private String getSimpleDateString(Instant instant, ZoneId timeZone) { + return DateTimeFormatter + .ofPattern("dd MMM, yyyy") + .format(instant.atZone(timeZone)); + } + + private String getTimeString(Instant instant, ZoneId timeZone) { + ZonedDateTime dateTime = instant.atZone(timeZone); + if (dateTime.getHour() == 23 && dateTime.getMinute() == 59) { + return "23:59H"; + } + return DateTimeFormatter + .ofPattern("HH:00") + .format(instant.atZone(timeZone)) + "H"; + } + + private String getResponseRate(int rowId) { + By showButtonId = By.id("show-response-rate-" + rowId); + if (isElementPresent(showButtonId)) { + click(showButtonId); + } + return waitForElementPresence(By.id("response-rate-" + rowId)).getText(); + } + + private void clickAddSessionButton() { + click(addSessionButton); + } + + private void setInstructions(String newInstructions) { + writeToRichTextEditor(instructionsEditor, newInstructions); + } + + private void setSessionStartDateTime(Instant startInstant, ZoneId timeZone) { + setDateTime(startDateBox, startTimeDropdown, startInstant, timeZone); + } + + private void setSessionEndDateTime(Instant endInstant, ZoneId timeZone) { + setDateTime(endDateBox, endTimeDropdown, endInstant, timeZone); + } + + private void setVisibilityDateTime(Instant startInstant, ZoneId timeZone) { + setDateTime(sessionVisibilityDateBox, sessionVisibilityTimeDropdown, startInstant, timeZone); + } + + private void setResponseDateTime(Instant endInstant, ZoneId timeZone) { + setDateTime(responseVisibilityDateBox, responseVisibilityTimeDropdown, endInstant, timeZone); + } + + private void setDateTime(WebElement dateBox, WebElement timeBox, Instant startInstant, ZoneId timeZone) { + fillTextBox(dateBox, getDateString(startInstant, timeZone)); + + selectDropdownOptionByText(timeBox.findElement(By.tagName("select")), getTimeString(startInstant, timeZone)); + } + + private void selectGracePeriod(long gracePeriodMinutes) { + selectDropdownOptionByText(gracePeriodDropdown, gracePeriodMinutes + " min"); + } + + private void setVisibilitySettings(FeedbackSessionAttributes newFeedbackSession) { + showVisibilitySettings(); + + setSessionVisibilitySettings(newFeedbackSession); + setResponseVisibilitySettings(newFeedbackSession); + } + + private void setSessionVisibilitySettings(FeedbackSessionAttributes newFeedbackSession) { + Instant sessionDateTime = newFeedbackSession.getSessionVisibleFromTime(); + if (sessionDateTime.equals(Const.TIME_REPRESENTS_FOLLOW_OPENING)) { + click(openSessionVisibleTimeButton); + } else { + click(customSessionVisibleTimeButton); + setVisibilityDateTime(sessionDateTime, newFeedbackSession.getTimeZone()); + } + } + + private void setResponseVisibilitySettings(FeedbackSessionAttributes newFeedbackSession) { + Instant responseDateTime = newFeedbackSession.getResultsVisibleFromTime(); + if (responseDateTime.equals(Const.TIME_REPRESENTS_FOLLOW_VISIBLE)) { + click(immediateResponseVisibleTimeButton); + } else if (responseDateTime.equals(Const.TIME_REPRESENTS_LATER)) { + click(manualResponseVisibleTimeButton); + } else { + click(customResponseVisibleTimeButton); + setResponseDateTime(responseDateTime, newFeedbackSession.getTimeZone()); + } + } + + private void setEmailSettings(FeedbackSessionAttributes newFeedbackSessionDetails) { + showEmailSettings(); + if (newFeedbackSessionDetails.isOpeningEmailEnabled() != openingSessionEmailCheckbox.isSelected()) { + click(openingSessionEmailCheckbox); + } + if (newFeedbackSessionDetails.isClosingEmailEnabled() != closingSessionEmailCheckbox.isSelected()) { + click(closingSessionEmailCheckbox); + } + if (newFeedbackSessionDetails.isPublishedEmailEnabled() != publishedSessionEmailCheckbox.isSelected()) { + click(publishedSessionEmailCheckbox); + } + } + + private void showVisibilitySettings() { + if (isElementPresent(By.id("btn-change-visibility"))) { + click(changeVisibilityButton); + } + } + + private void showEmailSettings() { + if (isElementPresent(By.id("btn-change-email"))) { + click(changeEmailButton); + } + } + + private void clickCreateSessionButton() { + click(createSessionButton); + } + + private void selectCourseToCopy(String courseToCopyId) { + WebElement courseIdDropdown = waitForElementPresence(By.id("copy-course-id")); + selectDropdownOptionByText(courseIdDropdown, courseToCopyId); + } + + private void selectSessionToCopy(String copyFromCourse, String sessionNameToCopy) { + WebElement table = browser.driver.findElement(By.id("copy-selection-table")); + List rows = table.findElements(By.tagName("tr")); + + for (WebElement row : rows) { + List cells = row.findElements(By.tagName("td")); + if (cells.isEmpty()) { + continue; + } + if (cells.get(1).getText().equals(copyFromCourse) && cells.get(2).getText().equals(sessionNameToCopy)) { + click(cells.get(0).findElement(By.tagName("input"))); + break; + } + } + } + + private void clickConfirmCopySessionButton() { + click(browser.driver.findElement(By.id("btn-confirm-copy"))); + } + + private WebElement clickCopyButtonInTable(String courseId, String sessionName) { + int rowId = getFeedbackSessionRowId(courseId, sessionName); + click(browser.driver.findElement(By.id("btn-copy-" + rowId))); + return waitForElementPresence(By.id("copy-course-modal")); + } + + private void selectCourseToCopyToInModal(WebElement copyFsModal, String courseToCopyId) { + List options = copyFsModal.findElements(By.className("form-check")); + for (WebElement option : options) { + String courseId = option.findElement(By.cssSelector("label span")).getText(); + if (courseId.equals(courseToCopyId)) { + click(option.findElement(By.tagName("input"))); + break; + } + } + } + + private void selectStudentToEmail(String studentEmail) { + WebElement studentList = waitForElementPresence(By.id("student-list-table")); + + List rows = studentList.findElements(By.tagName("tr")); + for (WebElement row : rows) { + List cells = row.findElements(By.cssSelector("td")); + if (cells.isEmpty()) { + continue; + } + if (cells.get(4).getText().equals(studentEmail)) { + click(cells.get(0).findElement(By.tagName("input"))); + break; + } + } + } + + private int getFeedbackSessionRowId(String courseId, String sessionName) { + int i = 0; + while (i < getNumFeedbackSessions()) { + if (getFeedbackSessionCourseId(i).equals(courseId) + && getFeedbackSessionName(i).equals(sessionName)) { + return i; + } + i++; + } + return -1; + } + + private int getSoftDeletedFeedbackSessionRowId(String courseId, String sessionName) { + int i = 0; + + while (i < getNumSoftDeletedFeedbackSessions()) { + if (getSoftDeletedFeedbackSessionCourseId(i).equals(courseId) + && getSoftDeletedFeedbackSessionName(i).equals(sessionName)) { + return i; + } + i++; + } + return -1; + } + + private int getNumFeedbackSessions() { + return sessionsTable.findElements(By.cssSelector("tbody tr")).size(); + } + + private int getNumSoftDeletedFeedbackSessions() { + if (!isElementPresent(By.id("deleted-sessions-table"))) { + return 0; + } + return deletedSessionsTable.findElements(By.cssSelector("tbody tr")).size(); + } + + private String getFeedbackSessionCourseId(int rowId) { + WebElement row = sessionsTable.findElements(By.cssSelector("tbody tr")).get(rowId); + return row.findElements(By.tagName("td")).get(0).getText(); + } + + private String getSoftDeletedFeedbackSessionCourseId(int rowId) { + WebElement row = deletedSessionsTable.findElements(By.cssSelector("tbody tr")).get(rowId); + return row.findElements(By.tagName("td")).get(0).getText(); + } + + private String getFeedbackSessionName(int rowId) { + WebElement row = sessionsTable.findElements(By.cssSelector("tbody tr")).get(rowId); + return row.findElements(By.tagName("td")).get(1).getText(); + } + + private String getSoftDeletedFeedbackSessionName(int rowId) { + WebElement row = deletedSessionsTable.findElements(By.cssSelector("tbody tr")).get(rowId); + return row.findElements(By.tagName("td")).get(1).getText(); + } + + private void waitForSessionEditPage() { + waitForElementPresence(By.id("btn-fs-edit")); + } +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java index 9d3193f81d7..46c4c02e4ac 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorHomePage.java @@ -1,9 +1,32 @@ package teammates.e2e.pageobjects; +import static org.junit.Assert.assertEquals; + +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; + /** * Represents the instructor home page. */ public class InstructorHomePage extends AppPage { + + @FindBy(id = "search-input") + private WebElement searchBar; + + @FindBy(id = "btn-search") + private WebElement searchButton; + public InstructorHomePage(Browser browser) { super(browser); } @@ -12,4 +35,196 @@ public InstructorHomePage(Browser browser) { protected boolean containsExpectedPageContents() { return getPageTitle().contains("Home"); } + + public InstructorSearchPage searchKeyword(String keyword) { + fillTextBox(searchBar, keyword); + click(searchButton); + waitForPageToLoad(true); + return changePageType(InstructorSearchPage.class); + } + + public void verifyCourseTabDetails(int courseTabIndex, CourseAttributes course, FeedbackSessionAttributes[] sessions) { + String expectedDetails = "[" + course.getId() + "]: " + course.getName(); + assertEquals(getCourseDetails(courseTabIndex), expectedDetails); + + String[][] expectedValues = new String[sessions.length][5]; + for (int i = 0; i < sessions.length; i++) { + expectedValues[i] = getExpectedSessionDetails(sessions[i]); + } + verifyTableBodyValues(getSessionsTable(courseTabIndex), expectedValues); + } + + public void verifySessionDetails(int courseTabIndex, int sessionIndex, FeedbackSessionAttributes session) { + String[] expectedValues = getExpectedSessionDetails(session); + WebElement sessionRow = getSessionsTable(courseTabIndex).findElements(By.cssSelector("tbody tr")).get(sessionIndex); + verifyTableRowValues(sessionRow, expectedValues); + } + + public void verifyNumCourses(int expectedNum) { + assertEquals(getNumCourses(), expectedNum); + } + + public void verifyResponseRate(int courseTabIndex, int sessionIndex, String expectedResponseRate) { + assertEquals(expectedResponseRate, getResponseRate(courseTabIndex, sessionIndex)); + } + + public void copySession(int courseTabIndex, int sessionIndex, CourseAttributes copyToCourse, String newSessionName) { + WebElement copyFsModal = clickCopyButtonInTable(courseTabIndex, sessionIndex); + fillTextBox(copyFsModal.findElement(By.id("copy-session-name")), newSessionName); + selectCourseToCopyToInModal(copyFsModal, copyToCourse.getId()); + click(browser.driver.findElement(By.id("btn-confirm-copy-course"))); + } + + public void publishSessionResults(int courseTabIndex, int sessionIndex) { + WebElement courseTab = getCourseTab(courseTabIndex); + click(courseTab.findElement(By.id("btn-results-" + sessionIndex))); + clickAndConfirm(courseTab.findElement(By.id("btn-publish-" + sessionIndex))); + } + + public void unpublishSessionResults(int courseTabIndex, int sessionIndex) { + WebElement courseTab = getCourseTab(courseTabIndex); + click(courseTab.findElement(By.id("btn-results-" + sessionIndex))); + clickAndConfirm(courseTab.findElement(By.id("btn-unpublish-" + sessionIndex))); + } + + public void sendReminderEmail(int courseTabIndex, int sessionIndex, StudentAttributes student) { + WebElement courseTab = getCourseTab(courseTabIndex); + click(courseTab.findElement(By.id("btn-remind-" + sessionIndex))); + selectStudentToEmail(student.email); + click(browser.driver.findElement(By.id("btn-confirm-send-reminder"))); + } + + public void resendResultsLink(int courseTabIndex, int sessionIndex, StudentAttributes student) { + WebElement courseTab = getCourseTab(courseTabIndex); + click(courseTab.findElement(By.id("btn-results-" + sessionIndex))); + click(waitForElementPresence(By.id("btn-resend-" + sessionIndex))); + selectStudentToEmail(student.email); + click(browser.driver.findElement(By.id("btn-confirm-resend-results"))); + } + + public void downloadResults(int courseTabIndex, int sessionIndex) { + WebElement courseTab = getCourseTab(courseTabIndex); + click(courseTab.findElement(By.id("btn-results-" + sessionIndex))); + click(waitForElementPresence(By.id("btn-download-" + sessionIndex))); + } + + public void deleteSession(int courseTabIndex, int sessionIndex) { + WebElement courseTab = getCourseTab(courseTabIndex); + clickAndConfirm(courseTab.findElement(By.id("btn-soft-delete-" + sessionIndex))); + waitUntilAnimationFinish(); + } + + public void archiveCourse(int courseTabIndex) { + WebElement courseTab = getCourseTab(courseTabIndex); + click(courseTab.findElement(By.id("btn-course"))); + clickAndConfirm(courseTab.findElement(By.id("btn-archive-course"))); + waitUntilAnimationFinish(); + } + + public void deleteCourse(int courseTabIndex) { + WebElement courseTab = getCourseTab(courseTabIndex); + click(courseTab.findElement(By.id("btn-course"))); + clickAndConfirm(courseTab.findElement(By.id("btn-delete-course"))); + waitUntilAnimationFinish(); + } + + public void sortCoursesById() { + click(browser.driver.findElement(By.id("sort-course-id"))); + waitUntilAnimationFinish(); + } + + public void sortCoursesByName() { + click(browser.driver.findElement(By.id("sort-course-name"))); + waitUntilAnimationFinish(); + } + + public void sortCoursesByCreationDate() { + click(browser.driver.findElement(By.id("sort-course-date"))); + waitUntilAnimationFinish(); + } + + private int getNumCourses() { + return browser.driver.findElements(By.id("course-tab")).size(); + } + + private WebElement getCourseTab(int courseTabIndex) { + return browser.driver.findElements(By.id("course-tab")).get(courseTabIndex); + } + + private String getCourseDetails(int courseTabIndex) { + WebElement courseTab = getCourseTab(courseTabIndex); + return courseTab.findElement(By.id("course-details")).getText(); + } + + private WebElement getSessionsTable(int courseTabIndex) { + return getCourseTab(courseTabIndex).findElement(By.id("sessions-table")); + } + + private String getDateString(Instant instant, ZoneId timeZone) { + return DateTimeFormatter + .ofPattern("d MMM h:mm a") + .format(instant.atZone(timeZone)); + } + + private String[] getExpectedSessionDetails(FeedbackSessionAttributes session) { + String[] details = new String[5]; + details[0] = session.getFeedbackSessionName(); + details[1] = getDateString(session.getStartTime(), session.getTimeZone()); + details[2] = getDateString(session.getEndTime(), session.getTimeZone()); + + if (session.isClosed()) { + details[3] = "Closed"; + } else if (session.isVisible() && (session.isOpened() || session.isInGracePeriod())) { + details[3] = "Open"; + } else { + details[3] = "Awaiting"; + } + details[4] = session.isPublished() ? "Published" : "Not Published"; + return details; + } + + private String getResponseRate(int courseTabIndex, int sessionIndex) { + WebElement showButton = null; + try { + showButton = getCourseTab(courseTabIndex).findElement(By.id("show-response-rate-" + sessionIndex)); + } catch (NoSuchElementException e) { + // continue + } + if (showButton != null) { + click(showButton); + } + return waitForElementPresence(By.id("response-rate-" + sessionIndex)).getText(); + } + + private WebElement clickCopyButtonInTable(int courseTabIndex, int sessionIndex) { + click(getCourseTab(courseTabIndex).findElement(By.id("btn-copy-" + sessionIndex))); + return waitForElementPresence(By.id("copy-course-modal")); + } + + private void selectCourseToCopyToInModal(WebElement copyFsModal, String courseToCopyId) { + List options = copyFsModal.findElements(By.className("form-check")); + for (WebElement option : options) { + String courseId = option.findElement(By.cssSelector("label span")).getText(); + if (courseId.equals(courseToCopyId)) { + click(option.findElement(By.tagName("input"))); + break; + } + } + } + + private void selectStudentToEmail(String studentEmail) { + WebElement studentList = waitForElementPresence(By.id("student-list-table")); + + List rows = studentList.findElements(By.tagName("tr")); + for (WebElement row : rows) { + List cells = row.findElements(By.cssSelector("td")); + if (cells.isEmpty()) { + continue; + } + if (cells.get(4).getText().equals(studentEmail)) { + click(cells.get(0).findElement(By.tagName("input"))); + break; + } + } + } } diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorSearchPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorSearchPage.java new file mode 100644 index 00000000000..f6d71608b76 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorSearchPage.java @@ -0,0 +1,173 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.util.List; +import java.util.Map; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.ThreadHelper; + +/** + * Represents the instructor search page. + */ +public class InstructorSearchPage extends AppPage { + + @FindBy(id = "search-keyword") + private WebElement searchKeyword; + + @FindBy(id = "btn-search") + private WebElement searchButton; + + @FindBy(id = "students-checkbox") + private WebElement studentsCheckbox; + + @FindBy(id = "comment-checkbox") + private WebElement commentCheckbox; + + public InstructorSearchPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageTitle().contains("Search"); + } + + public void verifyNumCoursesInStudentResults(int expectedNum) { + List studentCoursesResult = getStudentCoursesResult(); + assertEquals(expectedNum, studentCoursesResult.size()); + } + + public void search(boolean searchForStudents, boolean searchForComments, String searchTerm) { + if (searchForStudents && !studentsCheckbox.isSelected() + || !searchForStudents && studentsCheckbox.isSelected()) { + click(studentsCheckbox); + } + + if (searchForComments && !commentCheckbox.isSelected() + || !searchForComments && commentCheckbox.isSelected()) { + click(commentCheckbox); + } + + if (searchForStudents || searchForComments) { + searchKeyword.clear(); + searchKeyword.sendKeys(searchTerm); + click(searchButton); + waitForPageToLoad(true); + waitUntilAnimationFinish(); + } else { + verifyUnclickable(searchButton); + } + } + + private List getStudentCoursesResult() { + return browser.driver.findElements(By.className("student-course-table")); + } + + private String createHeaderText(CourseAttributes course) { + return "[" + course.getId() + "]"; + } + + public void verifyStudentDetails(Map courses, Map students) { + List studentCoursesResult = getStudentCoursesResult(); + assertEquals(students.size(), courses.size()); + assertEquals(students.size(), studentCoursesResult.size()); + + students.forEach((courseId, studentsForCourse) -> verifyStudentDetails(courses.get(courseId), studentsForCourse)); + } + + public void verifyStudentDetails(CourseAttributes course, StudentAttributes[] students) { + WebElement targetCourse = getStudentTableForHeader(course); + if (targetCourse == null) { + fail("Course with ID " + course.getId() + " is not found"); + } + + WebElement studentList = targetCourse.findElement(By.tagName("table")); + verifyTableBodyValues(studentList, getExpectedStudentValues(students)); + } + + private WebElement getStudentTableForHeader(CourseAttributes course) { + String targetHeader = createHeaderText(course); + List studentCoursesResult = getStudentCoursesResult(); + + return studentCoursesResult.stream().filter(studentCourse -> { + String courseHeader = studentCourse.findElement(By.className("card-header")).getText(); + return targetHeader.equals(courseHeader); + }).findFirst().orElse(null); + } + + private String[][] getExpectedStudentValues(StudentAttributes[] students) { + String[][] expected = new String[students.length][6]; + for (int i = 0; i < students.length; i++) { + StudentAttributes student = students[i]; + expected[i][0] = "View Photo"; + expected[i][1] = student.getSection(); + expected[i][2] = student.getTeam(); + expected[i][3] = student.getName(); + expected[i][4] = student.getGoogleId().isEmpty() ? "Yet to Join" : "Joined"; + expected[i][5] = student.getEmail(); + } + return expected; + } + + public void deleteStudent(CourseAttributes course, String studentEmail) { + clickAndConfirm(getDeleteButton(course, studentEmail)); + waitUntilAnimationFinish(); + } + + private WebElement getDeleteButton(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + return studentRow.findElement(By.id("btn-delete")); + } + + private WebElement getStudentRow(CourseAttributes course, String studentEmail) { + WebElement targetCourse = getStudentTableForHeader(course); + if (targetCourse == null) { + fail("Course with ID " + course.getId() + " is not found"); + } + + List studentRows = targetCourse.findElements(By.cssSelector("tbody tr")); + for (WebElement studentRow : studentRows) { + List studentCells = studentRow.findElements(By.tagName("td")); + if (studentCells.get(5).getText().equals(studentEmail)) { + return studentRow; + } + } + return null; + } + + public InstructorCourseStudentDetailsViewPage clickViewStudent(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + WebElement viewButton = studentRow.findElement(By.id("btn-view-details")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorCourseStudentDetailsViewPage.class); + } + + public InstructorCourseStudentDetailsEditPage clickEditStudent(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + WebElement viewButton = studentRow.findElement(By.id("btn-edit-details")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorCourseStudentDetailsEditPage.class); + } + + public InstructorStudentRecordsPage clickViewAllRecords(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + WebElement viewButton = studentRow.findElement(By.id("btn-view-records")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorStudentRecordsPage.class); + } + +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentListPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentListPage.java new file mode 100644 index 00000000000..c8245df9881 --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentListPage.java @@ -0,0 +1,185 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.ThreadHelper; + +/** + * Page Object Model for instructor student list page. + */ +public class InstructorStudentListPage extends AppPage { + + public InstructorStudentListPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageSource().contains("Student List"); + } + + private List getCoursesTabs() { + return browser.driver.findElements(By.className("course-table")); + } + + private String createHeaderText(CourseAttributes course) { + return String.format("[%s]: %s", course.getId(), course.getName()); + } + + public void clickCourseTabHeader(CourseAttributes course) { + String targetHeader = createHeaderText(course); + List courseTabs = getCoursesTabs(); + for (WebElement courseTab : courseTabs) { + WebElement headerElement = courseTab.findElement(By.className("card-header")); + String header = headerElement.getText(); + if (header.equals(targetHeader)) { + click(headerElement); + waitForPageToLoad(); + waitUntilAnimationFinish(); + } + } + } + + public void verifyStudentDetails(Map courses, Map students) { + List coursesTabs = getCoursesTabs(); + assertEquals(students.size(), courses.size()); + assertEquals(students.size(), coursesTabs.size()); + + students.forEach((courseId, studentsForCourse) -> verifyStudentDetails(courses.get(courseId), studentsForCourse)); + } + + public void verifyStudentDetails(CourseAttributes course, StudentAttributes[] students) { + WebElement targetCourse = getCourseTab(course); + if (targetCourse == null) { + fail("Course with ID " + course.getId() + " is not found"); + } + + if (students.length == 0) { + String noStudentText = targetCourse.findElement(By.className("card-body")).getText(); + // Need to account for the text from the enroll students button as well + String expectedText = "There are no students in this course." + + System.lineSeparator() + "Enroll Students"; + assertEquals(expectedText, noStudentText); + } else { + WebElement studentList = targetCourse.findElement(By.tagName("table")); + verifyTableBodyValues(studentList, getExpectedStudentValues(students)); + verifyDisplayedNumbers(targetCourse, students); + } + } + + private WebElement getCourseTab(CourseAttributes course) { + String targetHeader = createHeaderText(course); + List courseTabs = getCoursesTabs(); + + return courseTabs.stream().filter(courseTab -> { + String courseHeader = courseTab.findElement(By.className("card-header")).getText(); + return targetHeader.equals(courseHeader); + }).findFirst().orElse(null); + } + + private void verifyDisplayedNumbers(WebElement courseTab, StudentAttributes[] students) { + String nStudents = courseTab.findElement(By.id("num-students")).getText(); + String nSections = courseTab.findElement(By.id("num-sections")).getText(); + String nTeams = courseTab.findElement(By.id("num-teams")).getText(); + + String expectedNStudents = students.length + " students"; + String expectedNSections = Arrays.stream(students) + .map(StudentAttributes::getSection) + .distinct() + .count() + " sections"; + String expectedNTeams = Arrays.stream(students) + .map(StudentAttributes::getTeam) + .distinct() + .count() + " teams"; + + assertEquals(expectedNStudents, nStudents); + assertEquals(expectedNSections, nSections); + assertEquals(expectedNTeams, nTeams); + } + + private String[][] getExpectedStudentValues(StudentAttributes[] students) { + String[][] expected = new String[students.length][6]; + for (int i = 0; i < students.length; i++) { + StudentAttributes student = students[i]; + expected[i][0] = "View Photo"; + expected[i][1] = student.getSection(); + expected[i][2] = student.getTeam(); + expected[i][3] = student.getName(); + expected[i][4] = student.getGoogleId().isEmpty() ? "Yet to Join" : "Joined"; + expected[i][5] = student.getEmail(); + } + return expected; + } + + public void deleteStudent(CourseAttributes course, String studentEmail) { + clickAndConfirm(getDeleteButton(course, studentEmail)); + waitUntilAnimationFinish(); + } + + private WebElement getDeleteButton(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + return studentRow.findElement(By.id("btn-delete")); + } + + private WebElement getStudentRow(CourseAttributes course, String studentEmail) { + WebElement targetCourse = getCourseTab(course); + if (targetCourse == null) { + fail("Course with ID " + course.getId() + " is not found"); + } + + List studentRows = targetCourse.findElements(By.cssSelector("tbody tr")); + for (WebElement studentRow : studentRows) { + List studentCells = studentRow.findElements(By.tagName("td")); + if (studentCells.get(5).getText().equals(studentEmail)) { + return studentRow; + } + } + return null; + } + + public InstructorCourseEnrollPage clickEnrollStudents(CourseAttributes course) { + WebElement studentRow = getCourseTab(course); + WebElement enrollButton = studentRow.findElement(By.id("btn-enroll")); + click(enrollButton); + waitForPageToLoad(); + return changePageType(InstructorCourseEnrollPage.class); + } + + public InstructorCourseStudentDetailsViewPage clickViewStudent(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + WebElement viewButton = studentRow.findElement(By.id("btn-view-details")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorCourseStudentDetailsViewPage.class); + } + + public InstructorCourseStudentDetailsEditPage clickEditStudent(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + WebElement viewButton = studentRow.findElement(By.id("btn-edit-details")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorCourseStudentDetailsEditPage.class); + } + + public InstructorStudentRecordsPage clickViewAllRecords(CourseAttributes course, String studentEmail) { + WebElement studentRow = getStudentRow(course, studentEmail); + WebElement viewButton = studentRow.findElement(By.id("btn-view-records")); + click(viewButton); + ThreadHelper.waitFor(2000); + switchToNewWindow(); + return changePageType(InstructorStudentRecordsPage.class); + } + +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentRecordsPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentRecordsPage.java new file mode 100644 index 00000000000..f6c18d9b1dc --- /dev/null +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorStudentRecordsPage.java @@ -0,0 +1,84 @@ +package teammates.e2e.pageobjects; + +import static org.junit.Assert.assertEquals; + +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.attributes.StudentProfileAttributes; + +/** + * Page Object Model for instructor student records page. + */ +public class InstructorStudentRecordsPage extends AppPage { + private static final String NOT_SPECIFIED_LABEL = "Not Specified"; + + @FindBy(id = "records-header") + private WebElement headerText; + + @FindBy (id = "name-with-gender") + private WebElement studentNameWithGender; + + @FindBy (id = "personal-email") + private WebElement studentPersonalEmail; + + @FindBy (id = "institution") + private WebElement studentInstitution; + + @FindBy (id = "nationality") + private WebElement studentNationality; + + @FindBy (id = "more-info") + private WebElement moreInformation; + + public InstructorStudentRecordsPage(Browser browser) { + super(browser); + } + + @Override + protected boolean containsExpectedPageContents() { + return getPageSource().contains("'s Records"); + } + + public void verifyIsCorrectPage(String courseId, String studentName) { + String expected = String.format("%s's Records - %s", studentName, courseId); + assertEquals(expected, headerText.getText()); + } + + public void verifyStudentDetails(StudentProfileAttributes studentProfile, StudentAttributes student) { + verifyIsCorrectPage(student.getCourse(), student.getName()); + + StudentProfileAttributes profileToTest = studentProfile; + if (studentProfile == null) { + profileToTest = StudentProfileAttributes.builder(student.getGoogleId()).build(); + } + verifyDetail(getExpectedNameWithGender(profileToTest), studentNameWithGender); + verifyDetail(profileToTest.getEmail(), studentPersonalEmail); + verifyDetail(profileToTest.getInstitute(), studentInstitution); + verifyDetail(profileToTest.getNationality(), studentNationality); + verifyDetail(profileToTest.getMoreInfo(), moreInformation); + } + + private void verifyDetail(String expected, WebElement detailField) { + if (expected.isEmpty()) { + assertEquals(NOT_SPECIFIED_LABEL, detailField.getText()); + } else { + assertEquals(expected, detailField.getText()); + } + } + + private String getExpectedNameWithGender(StudentProfileAttributes profile) { + String name = profile.getShortName(); + StudentProfileAttributes.Gender gender = profile.getGender(); + String expectedName = name.isEmpty() + ? NOT_SPECIFIED_LABEL + : name; + String expectedGender = gender.equals(StudentProfileAttributes.Gender.OTHER) + ? NOT_SPECIFIED_LABEL + : gender.toString(); + + return expectedName + " (" + expectedGender + ")"; + } + +} diff --git a/src/e2e/java/teammates/e2e/pageobjects/StudentCourseDetailsPage.java b/src/e2e/java/teammates/e2e/pageobjects/StudentCourseDetailsPage.java index ecfa960cb25..093705f9c09 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/StudentCourseDetailsPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/StudentCourseDetailsPage.java @@ -1,19 +1,106 @@ package teammates.e2e.pageobjects; +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.attributes.StudentProfileAttributes; +import teammates.common.util.StringHelper; /** * Page Object Model for student course details page. */ public class StudentCourseDetailsPage extends AppPage { + @FindBy(id = "course-name") + private WebElement courseNameField; + + @FindBy(id = "course-id") + private WebElement courseIdField; + + @FindBy(id = "instructors") + private WebElement instructorsList; + + @FindBy(id = "student-name") + private WebElement studentNameField; + + @FindBy(id = "student-section") + private WebElement studentSectionField; + + @FindBy(id = "student-team") + private WebElement studentTeamField; + + @FindBy(id = "student-email") + private WebElement studentEmailField; + public StudentCourseDetailsPage(Browser browser) { super(browser); } @Override protected boolean containsExpectedPageContents() { - return browser.driver.findElement(By.tagName("h4")).getText().equals("Course"); + return waitForElementPresence(By.tagName("h1")).getText().matches("Team Details for .+"); + } + + public void verifyCourseDetails(CourseAttributes courseDetails) { + assertEquals(courseDetails.getName(), courseNameField.getText()); + assertEquals(courseDetails.getId(), courseIdField.getText()); + } + + public void verifyInstructorsDetails(InstructorAttributes[] instructorDetails) { + String[] actualInstructors = instructorsList.getText().split(System.lineSeparator()); + for (int i = 0; i < instructorDetails.length; i++) { + InstructorAttributes expected = instructorDetails[i]; + assertEquals(expected.displayedName + ": " + expected.name + " (" + expected.email + ")", + actualInstructors[i]); + } + } + + public void verifyStudentDetails(StudentAttributes studentDetails) { + assertEquals(studentDetails.getName(), studentNameField.getText()); + assertEquals(studentDetails.getSection(), studentSectionField.getText()); + assertEquals(studentDetails.getTeam(), studentTeamField.getText()); + assertEquals(studentDetails.getEmail(), studentEmailField.getText()); + } + + private String convertGender(StudentProfileAttributes.Gender gender) { + switch (gender) { + case MALE: + return "Male"; + case FEMALE: + return "Female"; + default: + return "Not Specified"; + } + } + + public void verifyTeammatesDetails(StudentAttributes[] teammates, StudentProfileAttributes[] teammateProfiles) { + int numTables = teammateProfiles.length; + + for (int i = 0; i < numTables; i++) { + List profileItems = new ArrayList<>(); + profileItems.add("Name: " + teammates[i].getName()); + profileItems.add("Email: " + teammates[i].getEmail()); + profileItems.add("Gender: " + convertGender(teammateProfiles[i].getGender())); + if (!StringHelper.isEmpty(teammateProfiles[i].getInstitute())) { + profileItems.add("Institute: " + teammateProfiles[i].getInstitute()); + } + if (!StringHelper.isEmpty(teammateProfiles[i].getNationality())) { + profileItems.add("Nationality: " + teammateProfiles[i].getNationality()); + } + } + } + + public void sortTeammatesByName() { + click(browser.driver.findElement(By.id("sort-name"))); } } diff --git a/src/e2e/java/teammates/e2e/util/BackDoor.java b/src/e2e/java/teammates/e2e/util/BackDoor.java index e1d0d005656..477fabf8574 100644 --- a/src/e2e/java/teammates/e2e/util/BackDoor.java +++ b/src/e2e/java/teammates/e2e/util/BackDoor.java @@ -6,9 +6,11 @@ import java.net.URI; import java.net.URISyntaxException; import java.nio.charset.Charset; +import java.time.Duration; +import java.time.Instant; import java.time.ZoneId; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -30,24 +32,41 @@ import org.apache.http.message.BasicNameValuePair; import teammates.common.datatransfer.DataBundle; +import teammates.common.datatransfer.FeedbackParticipantType; +import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.exception.HttpRequestFailedException; +import teammates.common.util.Assumption; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.ui.webapi.output.CourseData; -import teammates.ui.webapi.output.CoursesData; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.output.InstructorsData; -import teammates.ui.webapi.output.StudentData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.AccountData; +import teammates.ui.output.CourseData; +import teammates.ui.output.CoursesData; +import teammates.ui.output.FeedbackQuestionData; +import teammates.ui.output.FeedbackQuestionsData; +import teammates.ui.output.FeedbackResponseCommentData; +import teammates.ui.output.FeedbackResponseData; +import teammates.ui.output.FeedbackResponsesData; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionsData; +import teammates.ui.output.FeedbackVisibilityType; +import teammates.ui.output.InstructorData; +import teammates.ui.output.InstructorsData; +import teammates.ui.output.NumberOfEntitiesToGiveFeedbackToSetting; +import teammates.ui.output.ResponseVisibleSetting; +import teammates.ui.output.SessionVisibleSetting; +import teammates.ui.output.StudentData; +import teammates.ui.request.Intent; /** * Used to create API calls to the back-end without going through the UI. - * - *

Note that this will replace {@link teammates.test.driver.BackDoor} once the front-end migration is complete. */ public final class BackDoor { @@ -60,7 +79,7 @@ private BackDoor() { * * @return The body content and status of the HTTP response */ - public static ResponseBodyAndCode executeGetRequest(String relativeUrl, Map params) { + public static ResponseBodyAndCode executeGetRequest(String relativeUrl, Map params) { return executeRequest(HttpGet.METHOD_NAME, relativeUrl, params, null); } @@ -69,7 +88,7 @@ public static ResponseBodyAndCode executeGetRequest(String relativeUrl, Map params, String body) { + public static ResponseBodyAndCode executePostRequest(String relativeUrl, Map params, String body) { return executeRequest(HttpPost.METHOD_NAME, relativeUrl, params, body); } @@ -78,7 +97,7 @@ public static ResponseBodyAndCode executePostRequest(String relativeUrl, Map params, String body) { + public static ResponseBodyAndCode executePutRequest(String relativeUrl, Map params, String body) { return executeRequest(HttpPut.METHOD_NAME, relativeUrl, params, body); } @@ -87,7 +106,7 @@ public static ResponseBodyAndCode executePutRequest(String relativeUrl, Map params) { + public static ResponseBodyAndCode executeDeleteRequest(String relativeUrl, Map params) { return executeRequest(HttpDelete.METHOD_NAME, relativeUrl, params, null); } @@ -97,8 +116,8 @@ public static ResponseBodyAndCode executeDeleteRequest(String relativeUrl, Map params, String body) { - String url = TestProperties.TEAMMATES_URL + Const.ResourceURIs.URI_PREFIX + relativeUrl; + String method, String relativeUrl, Map params, String body) { + String url = TestProperties.TEAMMATES_URL + relativeUrl; HttpRequestBase request; switch (method) { @@ -142,11 +161,11 @@ private static ResponseBodyAndCode executeRequest( * * @return The content of the HTTP response */ - private static HttpGet createGetRequest(String url, Map params) { + private static HttpGet createGetRequest(String url, Map params) { return new HttpGet(createBasicUri(url, params)); } - private static HttpPost createPostRequest(String url, Map params, String body) { + private static HttpPost createPostRequest(String url, Map params, String body) { HttpPost post = new HttpPost(createBasicUri(url, params)); if (body != null) { @@ -157,7 +176,7 @@ private static HttpPost createPostRequest(String url, Map para return post; } - private static HttpPut createPutRequest(String url, Map params, String body) { + private static HttpPut createPutRequest(String url, Map params, String body) { HttpPut put = new HttpPut(createBasicUri(url, params)); if (body != null) { @@ -168,16 +187,14 @@ private static HttpPut createPutRequest(String url, Map params return put; } - private static HttpDelete createDeleteRequest(String url, Map params) { + private static HttpDelete createDeleteRequest(String url, Map params) { return new HttpDelete(createBasicUri(url, params)); } - private static URI createBasicUri(String url, Map params) { + private static URI createBasicUri(String url, Map params) { List postParameters = new ArrayList<>(); if (params != null) { - params.forEach((key, values) -> Arrays.stream(values).forEach(value -> { - postParameters.add(new BasicNameValuePair(key, value)); - })); + params.forEach((key, value) -> postParameters.add(new BasicNameValuePair(key, value))); } try { @@ -249,13 +266,33 @@ public static String putDocuments(DataBundle dataBundle) { ? Const.StatusCodes.BACKDOOR_STATUS_SUCCESS : Const.StatusCodes.BACKDOOR_STATUS_FAILURE; } + /** + * Gets an account from the datastore. + */ + public static AccountAttributes getAccount(String googleId) { + Map params = new HashMap<>(); + params.put(Const.ParamsNames.INSTRUCTOR_ID, googleId); + ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.ACCOUNT, params); + if (response.responseCode == HttpStatus.SC_NOT_FOUND) { + return null; + } + + AccountData accountData = JsonUtils.fromJson(response.responseBody, AccountData.class); + return AccountAttributes.builder(accountData.getGoogleId()) + .withName(accountData.getName()) + .withEmail(accountData.getEmail()) + .withInstitute(accountData.getInstitute()) + .withIsInstructor(accountData.isInstructor()) + .build(); + } + /** * Gets a student's profile from the datastore. */ public static StudentProfileAttributes getStudentProfile(String courseId, String studentEmail) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.COURSE_ID, new String[] { courseId }); - params.put(Const.ParamsNames.STUDENT_EMAIL, new String[] { studentEmail }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.COURSE_ID, courseId); + params.put(Const.ParamsNames.STUDENT_EMAIL, studentEmail); ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.STUDENT_PROFILE, params); if (response.responseCode == HttpStatus.SC_NOT_FOUND) { return null; @@ -268,8 +305,9 @@ public static StudentProfileAttributes getStudentProfile(String courseId, String * Gets course data from the datastore. */ public static CourseData getCourseData(String courseId) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.COURSE_ID, new String[] { courseId }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.COURSE_ID, courseId); + params.put(Const.ParamsNames.ENTITY_TYPE, Const.EntityType.STUDENT); ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.COURSE, params); if (response.responseCode == HttpStatus.SC_NOT_FOUND) { return null; @@ -296,24 +334,29 @@ public static CourseAttributes getCourse(String courseId) { * Gets archived course data from the datastore. */ public static CourseData getArchivedCourseData(String instructorId, String courseId) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.USER_ID, new String[] { instructorId }); - params.put(Const.ParamsNames.COURSE_ID, new String[] { courseId }); - params.put(Const.ParamsNames.ENTITY_TYPE, new String[] { Const.EntityType.INSTRUCTOR }); - params.put(Const.ParamsNames.COURSE_STATUS, new String[] { Const.CourseStatus.ARCHIVED }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.USER_ID, instructorId); + params.put(Const.ParamsNames.COURSE_ID, courseId); + params.put(Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR); + params.put(Const.ParamsNames.COURSE_STATUS, Const.CourseStatus.ARCHIVED); ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.COURSES, params); if (response.responseCode == HttpStatus.SC_NOT_FOUND) { return null; } + CoursesData coursesData = JsonUtils.fromJson(response.responseBody, CoursesData.class); - List courseDataList = coursesData.getCourses(); - for (CourseData courseData : courseDataList) { - if (courseData.getCourseId().equals(courseId)) { - return courseData; - } + CourseData courseData = coursesData.getCourses() + .stream() + .filter(cd -> cd.getCourseId().equals(courseId)) + .findFirst() + .orElse(null); + + if (courseData == null) { + return null; } - return null; + + return courseData; } /** @@ -334,22 +377,26 @@ public static CourseAttributes getArchivedCourse(String instructorId, String cou * Gets instructor data from the datastore. */ public static InstructorData getInstructorData(String courseId, String email) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.COURSE_ID, new String[] { courseId }); - params.put(Const.ParamsNames.INTENT, new String[] { Intent.FULL_DETAIL.toString() }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.COURSE_ID, courseId); + params.put(Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString()); ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.INSTRUCTORS, params); if (response.responseCode == HttpStatus.SC_NOT_FOUND) { return null; } InstructorsData instructorsData = JsonUtils.fromJson(response.responseBody, InstructorsData.class); - List instructorsDataList = instructorsData.getInstructors(); - for (InstructorData instructor : instructorsDataList) { - if (instructor.getEmail().equals(email)) { - return instructor; - } + InstructorData instructorData = instructorsData.getInstructors() + .stream() + .filter(instructor -> instructor.getEmail().equals(email)) + .findFirst() + .orElse(null); + + if (instructorData == null) { + return null; } - return null; + + return instructorData; } /** @@ -377,16 +424,20 @@ public static InstructorAttributes getInstructor(String courseId, String instruc if (instructorData.getDisplayedToStudentsAs() != null) { instructor.withDisplayedName(instructorData.getDisplayedToStudentsAs()); } - return instructor.build(); + InstructorAttributes instructorAttributes = instructor.build(); + if (instructorData.getKey() != null) { + instructorAttributes.key = instructorData.getKey(); + } + return instructorAttributes; } /** * Gets student data from the datastore. */ public static StudentData getStudentData(String courseId, String studentEmail) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.COURSE_ID, new String[] { courseId }); - params.put(Const.ParamsNames.STUDENT_EMAIL, new String[] { studentEmail }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.COURSE_ID, courseId); + params.put(Const.ParamsNames.STUDENT_EMAIL, studentEmail); ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.STUDENT, params); if (response.responseCode == HttpStatus.SC_NOT_FOUND) { return null; @@ -402,35 +453,258 @@ public static StudentAttributes getStudent(String courseId, String studentEmail) if (studentData == null) { return null; } - StudentAttributes.Builder student = StudentAttributes.builder(studentData.getCourseId(), + StudentAttributes.Builder builder = StudentAttributes.builder(studentData.getCourseId(), studentData.getEmail()); if (studentData.getGoogleId() != null) { - student.withGoogleId(studentData.getGoogleId()); + builder.withGoogleId(studentData.getGoogleId()); } if (studentData.getName() != null) { - student.withName(studentData.getName()); + builder.withName(studentData.getName()); } if (studentData.getSectionName() != null) { - student.withSectionName(studentData.getSectionName()); + builder.withSectionName(studentData.getSectionName()); } if (studentData.getTeamName() != null) { - student.withTeamName(studentData.getTeamName()); + builder.withTeamName(studentData.getTeamName()); } if (studentData.getComments() != null) { - student.withComment(studentData.getComments()); + builder.withComment(studentData.getComments()); } if (studentData.getLastName() != null) { - student.withLastName(studentData.getLastName()); + builder.withLastName(studentData.getLastName()); + } + StudentAttributes student = builder.build(); + if (studentData.getKey() != null) { + student.key = studentData.getKey(); } - return student.build(); + return student; + } + + /** + * Get feedback session data from datastore. + */ + public static FeedbackSessionData getFeedbackSessionData(String courseId, String feedbackSessionName) { + Map params = new HashMap<>(); + params.put(Const.ParamsNames.COURSE_ID, courseId); + params.put(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); + params.put(Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString()); + ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.SESSION, params); + if (response.responseCode == HttpStatus.SC_NOT_FOUND) { + return null; + } + return JsonUtils.fromJson(response.responseBody, FeedbackSessionData.class); + } + + /** + * Get feedback session from datastore. + */ + public static FeedbackSessionAttributes getFeedbackSession(String courseId, String feedbackSessionName) { + FeedbackSessionData sessionData = getFeedbackSessionData(courseId, feedbackSessionName); + if (sessionData == null) { + return null; + } + + FeedbackSessionAttributes sessionAttributes = FeedbackSessionAttributes + .builder(sessionData.getFeedbackSessionName(), sessionData.getCourseId()) + .withInstructions(sessionData.getInstructions()) + .withStartTime(Instant.ofEpochMilli(sessionData.getSubmissionStartTimestamp())) + .withEndTime(Instant.ofEpochMilli(sessionData.getSubmissionEndTimestamp())) + .withTimeZone(ZoneId.of(sessionData.getTimeZone())) + .withGracePeriod(Duration.ofMinutes(sessionData.getGracePeriod())) + .withIsClosingEmailEnabled(sessionData.getIsClosingEmailEnabled()) + .withIsPublishedEmailEnabled(sessionData.getIsPublishedEmailEnabled()) + .build(); + + sessionAttributes.setCreatedTime(Instant.ofEpochMilli(sessionData.getCreatedAtTimestamp())); + + if (sessionData.getSessionVisibleSetting().equals(SessionVisibleSetting.AT_OPEN)) { + sessionAttributes.setSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING); + } else { + sessionAttributes.setSessionVisibleFromTime(Instant.ofEpochMilli( + sessionData.getCustomSessionVisibleTimestamp())); + } + + if (sessionData.getResponseVisibleSetting().equals(ResponseVisibleSetting.AT_VISIBLE)) { + sessionAttributes.setResultsVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_VISIBLE); + } else if (sessionData.getResponseVisibleSetting().equals(ResponseVisibleSetting.LATER)) { + sessionAttributes.setResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER); + } else { + sessionAttributes.setResultsVisibleFromTime(Instant.ofEpochMilli( + sessionData.getCustomResponseVisibleTimestamp())); + } + + return sessionAttributes; + } + + /** + * Get soft deleted feedback session from datastore. + */ + public static FeedbackSessionAttributes getSoftDeletedSession(String feedbackSessionName, String instructorId) { + Map params = new HashMap<>(); + params.put(Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR); + params.put(Const.ParamsNames.IS_IN_RECYCLE_BIN, "true"); + params.put(Const.ParamsNames.USER_ID, instructorId); + ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.SESSIONS, params); + if (response.responseCode == HttpStatus.SC_NOT_FOUND) { + return null; + } + + FeedbackSessionsData sessionsData = JsonUtils.fromJson(response.responseBody, FeedbackSessionsData.class); + FeedbackSessionData feedbackSession = sessionsData.getFeedbackSessions() + .stream() + .filter(fs -> fs.getFeedbackSessionName().equals(feedbackSessionName)) + .findFirst() + .orElse(null); + + if (feedbackSession == null) { + return null; + } + + return FeedbackSessionAttributes + .builder(feedbackSession.getCourseId(), feedbackSession.getFeedbackSessionName()) + .build(); + } + + /** + * Get feedback question from datastore. + */ + public static FeedbackQuestionAttributes getFeedbackQuestion(String courseId, String feedbackSessionName, + int qnNumber) { + Map params = new HashMap<>(); + params.put(Const.ParamsNames.COURSE_ID, courseId); + params.put(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); + params.put(Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString()); + ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.QUESTIONS, params); + if (response.responseCode == HttpStatus.SC_NOT_FOUND) { + return null; + } + + FeedbackQuestionsData questionsData = JsonUtils.fromJson(response.responseBody, FeedbackQuestionsData.class); + FeedbackQuestionData question = questionsData.getQuestions() + .stream() + .filter(fq -> fq.getQuestionNumber() == qnNumber) + .findFirst() + .orElse(null); + + if (question == null) { + return null; + } + + FeedbackQuestionAttributes questionAttr = FeedbackQuestionAttributes.builder() + .withCourseId(courseId) + .withFeedbackSessionName(feedbackSessionName) + .withQuestionDetails(question.getQuestionDetails()) + .withQuestionDescription(question.getQuestionDescription()) + .withQuestionNumber(question.getQuestionNumber()) + .withGiverType(question.getGiverType()) + .withRecipientType(question.getRecipientType()) + .withNumberOfEntitiesToGiveFeedbackTo(question.getNumberOfEntitiesToGiveFeedbackToSetting() + .equals(NumberOfEntitiesToGiveFeedbackToSetting.UNLIMITED) + ? Const.MAX_POSSIBLE_RECIPIENTS + : question.getCustomNumberOfEntitiesToGiveFeedbackTo()) + .withShowResponsesTo(convertToFeedbackParticipantType(question.getShowResponsesTo())) + .withShowGiverNameTo(convertToFeedbackParticipantType(question.getShowGiverNameTo())) + .withShowRecipientNameTo(convertToFeedbackParticipantType(question.getShowRecipientNameTo())) + .build(); + if (question.getFeedbackQuestionId() != null) { + questionAttr.setId(question.getFeedbackQuestionId()); + } + return questionAttr; + } + + /** + * Converts List of FeedbackParticipantType to sorted List of FeedbackVisibilityType. + */ + private static List convertToFeedbackParticipantType( + List feedbackVisibilityTypeList) { + List feedbackParticipantTypeList = feedbackVisibilityTypeList.stream() + .map(feedbackParticipantType -> { + switch (feedbackParticipantType) { + case STUDENTS: + return FeedbackParticipantType.STUDENTS; + case INSTRUCTORS: + return FeedbackParticipantType.INSTRUCTORS; + case RECIPIENT: + return FeedbackParticipantType.RECEIVER; + case GIVER_TEAM_MEMBERS: + return FeedbackParticipantType.OWN_TEAM_MEMBERS; + case RECIPIENT_TEAM_MEMBERS: + return FeedbackParticipantType.RECEIVER_TEAM_MEMBERS; + default: + Assumption.fail("Unknown FeedbackVisibilityType " + feedbackParticipantType); + break; + } + return null; + }).collect(Collectors.toList()); + Collections.sort(feedbackParticipantTypeList); + return feedbackParticipantTypeList; + } + + /** + * Get feedback response from datastore. + */ + public static FeedbackResponseAttributes getFeedbackResponse(String feedbackQuestionId, String giver, + String recipient) { + Map params = new HashMap<>(); + params.put(Const.ParamsNames.FEEDBACK_QUESTION_ID, feedbackQuestionId); + params.put(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); + params.put(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, giver); + ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.RESPONSES, params); + if (response.responseCode == HttpStatus.SC_NOT_FOUND) { + return null; + } + + FeedbackResponsesData responsesData = JsonUtils.fromJson(response.responseBody, FeedbackResponsesData.class); + FeedbackResponseData fr = responsesData.getResponses() + .stream() + .filter(r -> r.getGiverIdentifier().equals(giver) && r.getRecipientIdentifier().equals(recipient)) + .findFirst() + .orElse(null); + + if (fr == null) { + return null; + } + + FeedbackResponseAttributes responseAttr = FeedbackResponseAttributes + .builder(feedbackQuestionId, fr.getGiverIdentifier(), fr.getRecipientIdentifier()) + .withResponseDetails(fr.getResponseDetails()) + .build(); + if (fr.getFeedbackResponseId() != null) { + responseAttr.setId(fr.getFeedbackResponseId()); + } + return responseAttr; + } + + /** + * Get feedback response comment from datastore. + */ + public static FeedbackResponseCommentAttributes getFeedbackResponseComment(String feedbackResponseId) { + Map params = new HashMap<>(); + params.put(Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponseId); + params.put(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); + ResponseBodyAndCode response = executeGetRequest(Const.ResourceURIs.RESPONSE_COMMENT, params); + if (response.responseCode == HttpStatus.SC_NOT_FOUND) { + return null; + } + + FeedbackResponseCommentData frc = JsonUtils.fromJson(response.responseBody, FeedbackResponseCommentData.class); + + if (frc == null) { + return null; + } + + return FeedbackResponseCommentAttributes.builder() + .withCommentGiver(frc.getCommentGiver()) + .withCommentText(frc.getCommentText()) + .build(); } /** * Deletes a student from the datastore. */ public static void deleteStudent(String unregUserId) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.STUDENT_ID, new String[] { unregUserId }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.STUDENT_ID, unregUserId); executeDeleteRequest(Const.ResourceURIs.STUDENTS, params); } @@ -438,9 +712,9 @@ public static void deleteStudent(String unregUserId) { * Deletes a feedback session from the datastore. */ public static void deleteFeedbackSession(String feedbackSession, String courseId) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.FEEDBACK_SESSION_NAME, new String[] { feedbackSession }); - params.put(Const.ParamsNames.COURSE_ID, new String[] { courseId }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSession); + params.put(Const.ParamsNames.COURSE_ID, courseId); executeDeleteRequest(Const.ResourceURIs.SESSION, params); } @@ -448,8 +722,8 @@ public static void deleteFeedbackSession(String feedbackSession, String courseId * Deletes a course from the datastore. */ public static void deleteCourse(String courseId) { - Map params = new HashMap<>(); - params.put(Const.ParamsNames.COURSE_ID, new String[] { courseId }); + Map params = new HashMap<>(); + params.put(Const.ParamsNames.COURSE_ID, courseId); executeDeleteRequest(Const.ResourceURIs.COURSE, params); } diff --git a/src/e2e/java/teammates/e2e/util/EmailAccount.java b/src/e2e/java/teammates/e2e/util/EmailAccount.java index f08fbbaee3b..58808268787 100644 --- a/src/e2e/java/teammates/e2e/util/EmailAccount.java +++ b/src/e2e/java/teammates/e2e/util/EmailAccount.java @@ -99,6 +99,27 @@ public String getRegistrationKeyFromUnreadEmails(String courseName, String cours return null; } + /** + * Returns true if unread mail contains mail with the specified subject. + */ + public boolean isEmailWithSubjectPresent(String subject) + throws IOException, MessagingException { + + List messageStubs = getListOfUnreadEmailOfUser(); + + for (Message messageStub : messageStubs) { + Message message = service.users().messages().get(username, messageStub.getId()).setFormat("raw") + .execute(); + + MimeMessage email = convertFromMessageToMimeMessage(message); + + if (email.getSubject().equals(subject)) { + return true; + } + } + return false; + } + /** * Marks all unread emails in the user's inbox as read. */ diff --git a/src/e2e/java/teammates/e2e/util/PriorityInterceptor.java b/src/e2e/java/teammates/e2e/util/PriorityInterceptor.java index 422316ab0f1..b70bf92c991 100644 --- a/src/e2e/java/teammates/e2e/util/PriorityInterceptor.java +++ b/src/e2e/java/teammates/e2e/util/PriorityInterceptor.java @@ -9,7 +9,7 @@ import org.testng.IMethodInterceptor; import org.testng.ITestContext; -import teammates.test.driver.FileHelper; +import teammates.test.FileHelper; /** * Allows TestNG to run tests in a specified order, based on the {@code Priority(n)} annotation. diff --git a/src/e2e/java/teammates/e2e/util/TestProperties.java b/src/e2e/java/teammates/e2e/util/TestProperties.java index dda59164a06..2e28b832d5b 100644 --- a/src/e2e/java/teammates/e2e/util/TestProperties.java +++ b/src/e2e/java/teammates/e2e/util/TestProperties.java @@ -6,7 +6,7 @@ import java.nio.file.Paths; import java.util.Properties; -import teammates.common.util.Url; +import teammates.common.util.UrlExtension; /** * Represents properties in test.properties file. @@ -25,12 +25,12 @@ public final class TestProperties { /** The directory where HTML files for testing pages are stored. */ public static final String TEST_PAGES_FOLDER = "src/e2e/resources/pages"; - /** The directory where HTML files for testing email contents are stored. */ - public static final String TEST_EMAILS_FOLDER = "src/e2e/resources/emails"; - /** The directory where JSON files used to create data bundles are stored. */ public static final String TEST_DATA_FOLDER = "src/e2e/resources/data"; + /** The directory where webdriver downloads files to. */ + public static final String TEST_DOWNLOADS_FOLDER = "src/e2e/resources/downloads"; + /** The value of "test.app.url" in test.properties file. */ public static final String TEAMMATES_URL; @@ -80,6 +80,9 @@ public final class TestProperties { /** One of the allowed values of "test.selenium.browser" in test.properties file. */ public static final String BROWSER_FIREFOX = "firefox"; + /** The value of "test.browser.closeonfailure" in test.properties file. */ + public static final boolean CLOSE_BROWSER_ON_FAILURE; + /** The value of "test.firefox.path" in test.properties file. */ public static final String FIREFOX_PATH; @@ -89,6 +92,12 @@ public final class TestProperties { /** The value of "test.geckodriver.path" in test.properties file. */ public static final String GECKODRIVER_PATH; + /** The value of "test.firefox.profile.name" in test.properties file. */ + public static final String FIREFOX_PROFILE_NAME; + + /** The value of "test.chrome.userdata.path" in test.properties file. */ + public static final String CHROME_USER_DATA_PATH; + /** The value of "test.timeout" in test.properties file. */ public static final int TEST_TIMEOUT; @@ -111,7 +120,7 @@ public final class TestProperties { prop.load(testPropStream); } - TEAMMATES_URL = Url.trimTrailingSlash(prop.getProperty("test.app.url")); + TEAMMATES_URL = UrlExtension.trimTrailingSlash(prop.getProperty("test.app.url")); Properties buildProperties = new Properties(); try (InputStream buildPropStream = Files.newInputStream(Paths.get("src/main/resources/build.properties"))) { @@ -138,9 +147,12 @@ public final class TestProperties { BACKDOOR_KEY = prop.getProperty("test.backdoor.key"); BROWSER = prop.getProperty("test.selenium.browser").toLowerCase(); + CLOSE_BROWSER_ON_FAILURE = Boolean.parseBoolean(prop.getProperty("test.browser.closeonfailure")); FIREFOX_PATH = prop.getProperty("test.firefox.path"); CHROMEDRIVER_PATH = prop.getProperty("test.chromedriver.path"); GECKODRIVER_PATH = prop.getProperty("test.geckodriver.path"); + FIREFOX_PROFILE_NAME = prop.getProperty("test.firefox.profile.name"); + CHROME_USER_DATA_PATH = prop.getProperty("test.chrome.userdata.path"); TEST_TIMEOUT = Integer.parseInt(prop.getProperty("test.timeout")); PERSISTENCE_RETRY_PERIOD_IN_S = Integer.parseInt(prop.getProperty("test.persistence.timeout")); diff --git a/src/test/resources/data/AdminAccountDetailsPageUiTest.json b/src/e2e/resources/data/AdminAccountsPageE2ETest.json similarity index 50% rename from src/test/resources/data/AdminAccountDetailsPageUiTest.json rename to src/e2e/resources/data/AdminAccountsPageE2ETest.json index c0d64535e8c..280bbd476f5 100644 --- a/src/test/resources/data/AdminAccountDetailsPageUiTest.json +++ b/src/e2e/resources/data/AdminAccountsPageE2ETest.json @@ -1,90 +1,95 @@ { "accounts": { - "AAMgtUiT.instr2": { - "googleId": "AAMgtUiT.instr2", + "AAMgtE2eT.instr2": { + "googleId": "AAMgtE2eT.instr2", "name": "Teammates Instr2", "isInstructor": true, - "email": "AAMgtUiT.instr2@gmail.tmt", + "email": "AAMgtE2eT.instr2@gmail.tmt", "institute": "TEAMMATES Test Institute 1" } }, "courses": { - "AAMgtUiT.CS2103": { - "id": "AAMgtUiT.CS2103", + "AAMgtE2eT.CS2104": { + "id": "AAMgtE2eT.CS2104", + "name": "Programming Languages", + "timeZone": "UTC" + }, + "AAMgtE2eT.CS2103": { + "id": "AAMgtE2eT.CS2103", "name": "Software Engineering", "timeZone": "UTC" }, - "AAMgtUiT.CS1101": { - "id": "AAMgtUiT.CS1101", + "AAMgtE2eT.CS1101": { + "id": "AAMgtE2eT.CS1101", "name": "Programming Methodology", "timeZone": "UTC" } }, "instructors": { - "AAMgtUiT.instr2-AAMgtUiT.CS2104": { - "googleId": "AAMgtUiT.instr2", - "courseId": "AAMgtUiT.CS2104", + "AAMgtE2eT.instr2-AAMgtE2eT.CS2104": { + "googleId": "AAMgtE2eT.instr2", + "courseId": "AAMgtE2eT.CS2104", "name": "Teammates Instr2", - "email": "AAMgtUiT.instr2@gmail.tmt", + "email": "AAMgtE2eT.instr2@gmail.tmt", "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", "privileges": { "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, "canmodifycourse": true, - "canviewsessioninsection": true, + "canmodifyinstructor": true, "canmodifysession": true, "canmodifystudent": true, - "canmodifyinstructor": true + "canviewstudentinsection": true, + "canviewsessioninsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true }, "sectionLevel": {}, "sessionLevel": {} } }, - "AAMgtUiT.instr2-AAMgtUiT.CS2103": { - "googleId": "AAMgtUiT.instr2", - "courseId": "AAMgtUiT.CS2103", + "AAMgtE2eT.instr2-AAMgtE2eT.CS2103": { + "googleId": "AAMgtE2eT.instr2", + "courseId": "AAMgtE2eT.CS2103", "name": "Teammates Instr2", - "email": "AAMgtUiT.instr2@gmail.tmt", + "email": "AAMgtE2eT.instr2@gmail.tmt", "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", "privileges": { "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, "canmodifycourse": true, - "canviewsessioninsection": true, + "canmodifyinstructor": true, "canmodifysession": true, "canmodifystudent": true, - "canmodifyinstructor": true + "canviewstudentinsection": true, + "canviewsessioninsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true }, "sectionLevel": {}, "sessionLevel": {} } }, - "AAMgtUiT.instr2-AAMgtUiT.CS1101": { - "googleId": "AAMgtUiT.instr2", - "courseId": "AAMgtUiT.CS1101", + "AAMgtE2eT.instr2-AAMgtE2eT.CS1101": { + "googleId": "AAMgtE2eT.instr2", + "courseId": "AAMgtE2eT.CS1101", "name": "Teammates Instr2", - "email": "AAMgtUiT.instr2@gmail.tmt", + "email": "AAMgtE2eT.instr2@gmail.tmt", "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", "privileges": { "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, "canmodifycourse": true, - "canviewsessioninsection": true, + "canmodifyinstructor": true, "canmodifysession": true, "canmodifystudent": true, - "canmodifyinstructor": true + "canviewstudentinsection": true, + "canviewsessioninsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true }, "sectionLevel": {}, "sessionLevel": {} @@ -92,13 +97,31 @@ } }, "students": { - "AAMgtUiT.instr2-student": { - "googleId": "AAMgtUiT.instr2", - "email": "AAMgtUiT.instr2@gmail.tmt", - "course": "AAMgtUiT.CS1101", - "name": "Teammates Instr2'\"", - "comments": "This is an instructor'\"", - "team": "Team 1'\"", + "AAMgtE2eT.instr2-student-CS2104": { + "googleId": "AAMgtE2eT.instr2", + "email": "AAMgtE2eT.instr2@gmail.tmt", + "course": "AAMgtE2eT.CS2104", + "name": "Teammates Instr2", + "comments": "This is an instructor", + "team": "Team 1", + "section": "None" + }, + "AAMgtE2eT.instr2-student-CS2103": { + "googleId": "AAMgtE2eT.instr2", + "email": "AAMgtE2eT.instr2@gmail.tmt", + "course": "AAMgtE2eT.CS2103", + "name": "Teammates Instr2", + "comments": "This is an instructor", + "team": "Team 1", + "section": "None" + }, + "AAMgtE2eT.instr2-student-CS1101": { + "googleId": "AAMgtE2eT.instr2", + "email": "AAMgtE2eT.instr2@gmail.tmt", + "course": "AAMgtE2eT.CS1101", + "name": "Teammates Instr2", + "comments": "This is an instructor", + "team": "Team 1", "section": "None" } }, diff --git a/src/e2e/resources/data/AdminSessionsPageE2ETest.json b/src/e2e/resources/data/AdminSessionsPageE2ETest.json new file mode 100644 index 00000000000..4fd5aed4e0b --- /dev/null +++ b/src/e2e/resources/data/AdminSessionsPageE2ETest.json @@ -0,0 +1,105 @@ +{ + "accounts": { + "instructor1OfCourse1": { + "googleId": "adminSessions.idOfInstructor1OfCourse1", + "name": "Instructor1 of Course1", + "isInstructor": true, + "email": "adminSessions.instructor1@course1.tmt", + "institute": "TEAMMATES Institute 1" + } + }, + "courses": { + "typicalCourse1": { + "id": "adminSessions.idOfTypicalCourse1", + "name": "Typical Course 1", + "timeZone": "UTC" + } + }, + "instructors": { + "instructor1OfCourse1": { + "googleId": "adminSessions.idOfInstructor1OfCourse1", + "courseId": "adminSessions.idOfTypicalCourse1", + "name": "Instructor1 of Course1", + "email": "adminSessions.instructor1@course1.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "feedbackSessions": { + "session1InCourse1": { + "feedbackSessionName": "Open feedback session", + "courseId": "adminSessions.idOfTypicalCourse1", + "creatorEmail": "adminSessions.instructor1@course1.tmt", + "instructions": "Please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2012-03-28T21:59:00Z", + "endTime": "2012-05-01T21:59:00Z", + "sessionVisibleFromTime": "2012-03-28T21:59:00Z", + "resultsVisibleFromTime": "2012-05-01T21:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": true, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "session2InCourse1": { + "feedbackSessionName": "Awaiting feedback session", + "courseId": "adminSessions.idOfTypicalCourse1", + "creatorEmail": "adminSessions.instructor1@course1.tmt", + "instructions": "Please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2012-03-28T21:59:00Z", + "endTime": "2012-05-01T21:59:00Z", + "sessionVisibleFromTime": "2012-03-28T21:59:00Z", + "resultsVisibleFromTime": "2012-05-01T21:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": true, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "session3InCourse1": { + "feedbackSessionName": "Future feedback session", + "courseId": "adminSessions.idOfTypicalCourse1", + "creatorEmail": "adminSessions.instructor1@course1.tmt", + "instructions": "Please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2012-03-28T21:59:00Z", + "endTime": "2012-05-01T21:59:00Z", + "sessionVisibleFromTime": "2012-03-28T21:59:00Z", + "resultsVisibleFromTime": "2012-05-01T21:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": true, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + } +} diff --git a/src/test/resources/data/AutomatedSessionRemindersTest.json b/src/e2e/resources/data/AutomatedSessionRemindersTest.json similarity index 100% rename from src/test/resources/data/AutomatedSessionRemindersTest.json rename to src/e2e/resources/data/AutomatedSessionRemindersTest.json diff --git a/src/e2e/resources/data/FeedbackConstSumOptionQuestionE2ETest.json b/src/e2e/resources/data/FeedbackConstSumOptionQuestionE2ETest.json new file mode 100644 index 00000000000..1f6f7c7d8c9 --- /dev/null +++ b/src/e2e/resources/data/FeedbackConstSumOptionQuestionE2ETest.json @@ -0,0 +1,222 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FConstSumOptionQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FConstSumOptionQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FConstSumOptionQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FConstSumOptionQuestionE2eT.instructor", + "courseId": "FConstSumOptionQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FConstSumOptionQuestionE2eT.instructor", + "courseId": "FConstSumOptionQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FConstSumOptionQuestionE2eT.CS2104": { + "googleId": "FConstSumOptionQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FConstSumOptionQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FConstSumOptionQuestionE2eT.CS2104": { + "googleId": "FConstSumOptionQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FConstSumOptionQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@FConstSumOptionQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FConstSumOptionQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FConstSumOptionQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 1", + "section": "None" + }, + "danny.tmms@FConstSumOptionQuestionE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "FConstSumOptionQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FConstSumOptionQuestionE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FConstSumOptionQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FConstSumOptionQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FConstSumOptionQuestionE2eT.CS2104", + "questionDetails": { + "distributeToRecipients": false, + "forceUnevenDistribution": true, + "distributePointsFor": "All options", + "pointsPerOption": false, + "questionText": "How well did you do in each area? Give points accordingly.", + "numOfConstSumOptions": 3, + "questionType": "CONSTSUM_OPTIONS", + "points": 100, + "constSumOptions": [ + "Teamwork", + "Creativity", + "Leadership" + ] + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "SELF", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FConstSumOptionQuestionE2eT.CS1101", + "questionDetails": { + "distributeToRecipients": false, + "forceUnevenDistribution": false, + "distributePointsFor": "None", + "pointsPerOption": true, + "questionText": "How much did you contribute to this area? Give points accordingly.", + "numOfConstSumOptions": 3, + "questionType": "CONSTSUM_OPTIONS", + "points": 20, + "constSumOptions": [ + "Algo", + "UI", + "Testing" + ] + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "SELF", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackConstSumRecipientQuestionE2ETest.json b/src/e2e/resources/data/FeedbackConstSumRecipientQuestionE2ETest.json new file mode 100644 index 00000000000..dd7630848b0 --- /dev/null +++ b/src/e2e/resources/data/FeedbackConstSumRecipientQuestionE2ETest.json @@ -0,0 +1,218 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FConstSumRecipientQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FConstSumRecipientQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FConstSumRecipientQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FConstSumRecipientQuestionE2eT.instructor", + "courseId": "FConstSumRecipientQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FConstSumRecipientQuestionE2eT.instructor", + "courseId": "FConstSumRecipientQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FConstSumRecipientQuestionE2eT.CS2104": { + "googleId": "FConstSumRecipientQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FConstSumRecipientQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FConstSumRecipientQuestionE2eT.CS2104": { + "googleId": "FConstSumRecipientQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FConstSumRecipientQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 2", + "section": "None" + }, + "charlie.tmms@FConstSumRecipientQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FConstSumRecipientQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FConstSumRecipientQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 3", + "section": "None" + }, + "danny.tmms@FConstSumRecipientQuestionE2eT.CS2104": { + "googleId": "danny.tmms", + "email": "FConstSumRecipientQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FConstSumRecipientQuestionE2eT.CS2104", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 3", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FConstSumRecipientQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FConstSumRecipientQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FConstSumRecipientQuestionE2eT.CS2104", + "questionDetails": { + "distributeToRecipients": true, + "pointsPerOption": false, + "questionText": "Split points among the teams, according to how well you think each team did.", + "numOfConstSumOptions": 0, + "questionType": "CONSTSUM_RECIPIENTS", + "points": 100, + "forceUnevenDistribution": true, + "distributePointsFor": "All options", + "constSumOptions": [] + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FConstSumRecipientQuestionE2eT.CS1101", + "questionDetails": { + "numOfConstSumOptions": 0, + "constSumOptions": [], + "distributeToRecipients": true, + "pointsPerOption": true, + "forceUnevenDistribution": false, + "distributePointsFor": "None", + "points": 20, + "questionType": "CONSTSUM_RECIPIENTS", + "questionText": "Split points among the teams, according to how creative you think each team was." + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackContributionQuestionE2ETest.json b/src/e2e/resources/data/FeedbackContributionQuestionE2ETest.json new file mode 100644 index 00000000000..4d9b66781e2 --- /dev/null +++ b/src/e2e/resources/data/FeedbackContributionQuestionE2ETest.json @@ -0,0 +1,205 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FContributionQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FContributionQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FContributionQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FContributionQuestionE2eT.instructor", + "courseId": "FContributionQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FContributionQuestionE2eT.instructor", + "courseId": "FContributionQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FContributionQuestionE2eT.CS2104": { + "googleId": "FContributionQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FContributionQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FContributionQuestionE2eT.CS2104": { + "googleId": "FContributionQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FContributionQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@FContributionQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FContributionQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FContributionQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 1", + "section": "None" + }, + "danny.tmms@FContributionQuestionE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "FContributionQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FContributionQuestionE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FContributionQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FContributionQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FContributionQuestionE2eT.CS2104", + "questionDetails": { + "isNotSureAllowed": true, + "questionType": "CONTRIB", + "questionText": "How much has each team member including yourself, contributed to the project?" + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FContributionQuestionE2eT.CS1101", + "questionDetails": { + "isNotSureAllowed": false, + "questionType": "CONTRIB", + "questionText": "How much has each team member including yourself, contributed to the project?" + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackMcqQuestionE2ETest.json b/src/e2e/resources/data/FeedbackMcqQuestionE2ETest.json new file mode 100644 index 00000000000..4dbfd3bf0eb --- /dev/null +++ b/src/e2e/resources/data/FeedbackMcqQuestionE2ETest.json @@ -0,0 +1,191 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FMcqQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FMcqQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FMcqQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FMcqQuestionE2eT.instructor", + "courseId": "FMcqQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FMcqQuestionE2eT.instructor", + "courseId": "FMcqQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FMcqQuestionE2eT.CS2104": { + "googleId": "FMcqQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FMcqQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FMcqQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FMcqQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FMcqQuestionE2eT.CS2104", + "questionDetails": { + "questionType": "MCQ", + "questionText": "Which area did you work on the most?", + "numOfMcqChoices": 3, + "mcqChoices": [ + "UI", + "Algo", + "Testing" + ], + "otherEnabled": true, + "hasAssignedWeights": true, + "mcqWeights": [ + 30.61, + 29.4, + 20 + ], + "mcqOtherWeight": 60 + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "NONE", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FMcqQuestionE2eT.CS1101", + "questionDetails": { + "numOfMcqChoices": 0, + "mcqChoices": [], + "questionText": "Who is the best student?", + "questionType": "MCQ", + "generateOptionsFor": "STUDENTS", + "otherEnabled": false + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "NONE", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackMsqQuestionE2ETest.json b/src/e2e/resources/data/FeedbackMsqQuestionE2ETest.json new file mode 100644 index 00000000000..5404e145a4b --- /dev/null +++ b/src/e2e/resources/data/FeedbackMsqQuestionE2ETest.json @@ -0,0 +1,222 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FMsqQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FMsqQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FMsqQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FMsqQuestionE2eT.instructor", + "courseId": "FMsqQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FMsqQuestionE2eT.instructor", + "courseId": "FMsqQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FMsqQuestionE2eT.CS2104": { + "googleId": "FMsqQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FMsqQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FMsqQuestionE2eT.CS2104": { + "googleId": "FMsqQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FMsqQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@FMsqQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FMsqQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FMsqQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 2", + "section": "None" + }, + "danny.tmms@FMsqQuestionE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "FMsqQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FMsqQuestionE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FMsqQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FMsqQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FMsqQuestionE2eT.CS2104", + "questionDetails": { + "questionType": "MSQ", + "questionText": "Which area did this student work well in?", + "numOfMsqChoices": 3, + "msqChoices": [ + "Teamwork", + "Leadership", + "Creativity" + ], + "otherEnabled": true, + "hasAssignedWeights": true, + "msqWeights": [ + 30.61, + 29.4, + 20 + ], + "msqOtherWeight": 60, + "maxSelectableChoices": 2 + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "STUDENTS", + "numberOfEntitiesToGiveFeedbackTo": 1, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FMsqQuestionE2eT.CS1101", + "questionDetails": { + "numOfMsqChoices": 0, + "msqChoices": [], + "questionText": "Which teams did well in your opinion?", + "questionType": "MSQ", + "generateOptionsFor": "TEAMS", + "otherEnabled": false, + "minSelectableChoices": 2 + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "NONE", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackNumScaleQuestionE2ETest.json b/src/e2e/resources/data/FeedbackNumScaleQuestionE2ETest.json new file mode 100644 index 00000000000..895a7ac3260 --- /dev/null +++ b/src/e2e/resources/data/FeedbackNumScaleQuestionE2ETest.json @@ -0,0 +1,210 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FNumScaleQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FNumScaleQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FNumScaleQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FNumScaleQuestionE2eT.instructor", + "courseId": "FNumScaleQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FNumScaleQuestionE2eT.instructor", + "courseId": "FNumScaleQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FNumScaleQuestionE2eT.CS2104": { + "googleId": "FNumScaleQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FNumScaleQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FNumScaleQuestionE2eT.CS2104": { + "googleId": "FNumScaleQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FNumScaleQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 2", + "section": "None" + }, + "charlie.tmms@FNumScaleQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FNumScaleQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FNumScaleQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 3", + "section": "None" + }, + "danny.tmms@FNumScaleQuestionE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "FNumScaleQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FNumScaleQuestionE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FNumScaleQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FNumScaleQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FNumScaleQuestionE2eT.CS2104", + "questionDetails": { + "minScale": 0, + "questionText": "Rate this team's product", + "questionType": "NUMSCALE", + "maxScale": 10, + "step": 0.2 + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": 1, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FNumScaleQuestionE2eT.CS1101", + "questionDetails": { + "minScale": 1, + "questionText": "Rate this team's teamwork", + "questionType": "NUMSCALE", + "maxScale": 10, + "step": 0.005 + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": 1, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackRankOptionQuestionE2ETest.json b/src/e2e/resources/data/FeedbackRankOptionQuestionE2ETest.json new file mode 100644 index 00000000000..e39bf0881bf --- /dev/null +++ b/src/e2e/resources/data/FeedbackRankOptionQuestionE2ETest.json @@ -0,0 +1,220 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FRankOptionQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FRankOptionQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FRankOptionQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FRankOptionQuestionE2eT.instructor", + "courseId": "FRankOptionQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FRankOptionQuestionE2eT.instructor", + "courseId": "FRankOptionQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FRankOptionQuestionE2eT.CS2104": { + "googleId": "FRankOptionQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FRankOptionQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FRankOptionQuestionE2eT.CS2104": { + "googleId": "FRankOptionQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FRankOptionQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@FRankOptionQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FRankOptionQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FRankOptionQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 1", + "section": "None" + }, + "danny.tmms@FRankOptionQuestionE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "FRankOptionQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FRankOptionQuestionE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FRankOptionQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FRankOptionQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FRankOptionQuestionE2eT.CS2104", + "questionDetails": { + "areDuplicatesAllowed": false, + "questionText": "As a student, rank for every teammate, the areas of improvement that they should work on", + "questionType": "RANK_OPTIONS", + "maxOptionsToBeRanked" : 3, + "options": [ + "Teamwork", + "Time management", + "Quality Control", + "Quality Assurance" + ] + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "OWN_TEAM_MEMBERS", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FRankOptionQuestionE2eT.CS1101", + "questionDetails": { + "areDuplicatesAllowed": true, + "questionText": "As an student, rank for every team, the areas of improvement that they should work on", + "questionType": "RANK_OPTIONS", + "minOptionsToBeRanked": 1, + "options": [ + "Teamwork", + "Time management", + "Quality Control", + "Quality Assurance" + ] + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackRankRecipientQuestionE2ETest.json b/src/e2e/resources/data/FeedbackRankRecipientQuestionE2ETest.json new file mode 100644 index 00000000000..ffbc8822766 --- /dev/null +++ b/src/e2e/resources/data/FeedbackRankRecipientQuestionE2ETest.json @@ -0,0 +1,231 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FRankRecipientQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FRankRecipientQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FRankRecipientQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FRankRecipientQuestionE2eT.instructor", + "courseId": "FRankRecipientQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FRankRecipientQuestionE2eT.instructor2", + "courseId": "FRankRecipientQuestionE2eT.CS2104", + "name": "Teammates Test 2", + "email": "tmms.tes2t@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor3": { + "googleId": "FRankRecipientQuestionE2eT.instructor", + "courseId": "FRankRecipientQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FRankRecipientQuestionE2eT.CS2104": { + "googleId": "FRankRecipientQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FRankRecipientQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FRankRecipientQuestionE2eT.CS2104": { + "googleId": "FRankRecipientQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FRankRecipientQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@FRankRecipientQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FRankRecipientQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FRankRecipientQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 1", + "section": "None" + }, + "danny.tmms@FRankRecipientQuestionE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "FRankRecipientQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FRankRecipientQuestionE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FRankRecipientQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FRankRecipientQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FRankRecipientQuestionE2eT.CS2104", + "questionDetails": { + "areDuplicatesAllowed": true, + "questionType": "RANK_RECIPIENTS", + "questionText": "Rank your instructors by approachability.", + "minOptionsToBeRanked": 1 + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "INSTRUCTORS", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FRankRecipientQuestionE2eT.CS1101", + "questionDetails": { + "areDuplicatesAllowed": false, + "questionType": "RANK_RECIPIENTS", + "questionText": "Rank your instructors by knowledge.", + "maxOptionsToBeRanked": 3 + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "INSTRUCTORS", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/FeedbackRubricQuestionE2ETest.json b/src/e2e/resources/data/FeedbackRubricQuestionE2ETest.json new file mode 100644 index 00000000000..23305e42472 --- /dev/null +++ b/src/e2e/resources/data/FeedbackRubricQuestionE2ETest.json @@ -0,0 +1,271 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FRubricQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FRubricQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FRubricQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FRubricQuestionE2eT.instructor", + "courseId": "FRubricQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FRubricQuestionE2eT.instructor", + "courseId": "FRubricQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FRubricQuestionE2eT.CS2104": { + "googleId": "FRubricQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FRubricQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@FRubricQuestionE2eT.CS2104": { + "googleId": "FRubricQuestionE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "FRubricQuestionE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@FRubricQuestionE2eT.CS2104": { + "googleId": "charlie.tmms", + "email": "FRubricQuestionE2eT.charlie.tmms@gmail.tmt", + "course": "FRubricQuestionE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 1", + "section": "None" + }, + "danny.tmms@FRubricQuestionE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "FRubricQuestionE2eT.danny.tmms@gmail.tmt", + "course": "FRubricQuestionE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FRubricQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FRubricQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FRubricQuestionE2eT.CS2104", + "questionDetails": { + "rubricSubQuestions": [ + "This student has done a good job.", + "This student has tried his/her best." + ], + "rubricWeightsForEachCell": [ + [ + 1.01, + -0.99 + ], + [ + 100, + -200 + ] + ], + "questionText": "Please choose the best choice for the following sub-questions.", + "numOfRubricChoices": 2, + "numOfRubricSubQuestions": 2, + "questionType": "RUBRIC", + "hasAssignedWeights": true, + "rubricChoices": [ + "Yes", + "No" + ], + "rubricDescriptions": [ + [ + "", + "" + ], + [ + "Most of the time", + "Less than half the time" + ] + ] + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "OWN_TEAM_MEMBERS", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FRubricQuestionE2eT.CS1101", + "questionDetails": { + "rubricSubQuestions": [ + "The content of the class was interesting.", + "The professor was engaging.", + "The duration of the lessons too short." + ], + "questionText": "Please choose the best choice for the following sub-questions.", + "numOfRubricChoices": 5, + "numOfRubricSubQuestions": 3, + "questionType": "RUBRIC", + "hasAssignedWeights": false, + "rubricChoices": [ + "Strongly Agree", + "Agree", + "Neutral", + "Disagree", + "Strongly Disagree" + ], + "rubricDescriptions": [ + [ + "", + "", + "", + "", + "" + ], + [ + "Most of the time", + "", + "", + "", + "Less than half the time" + ], + [ + "The class should be 1 hour longer.", + "The class should be 30 min longer.", + "The class duration is just right.", + "The class should be 30 min shorter.", + "The class should be 1 hour shorter." + ] + ] + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "NONE", + "numberOfEntitiesToGiveFeedbackTo": -100, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/test/resources/data/InstructorFeedbackSubmissionEditSaveActionTest.json b/src/e2e/resources/data/FeedbackSubmitPageE2ETest.json similarity index 51% rename from src/test/resources/data/InstructorFeedbackSubmissionEditSaveActionTest.json rename to src/e2e/resources/data/FeedbackSubmitPageE2ETest.json index ca72c4ea51d..348bb818f03 100644 --- a/src/test/resources/data/InstructorFeedbackSubmissionEditSaveActionTest.json +++ b/src/e2e/resources/data/FeedbackSubmitPageE2ETest.json @@ -1,50 +1,64 @@ { "accounts": { - "instructor1InCourse1": { - "googleId": "instructor1InCourse1", + "SFSubmitE2eT.instr": { + "googleId": "SFSubmitE2eT.instr", "name": "Teammates Test", "isInstructor": true, - "email": "instructor1@course1.tmt", + "email": "SFSubmitE2eT.instr@gmail.tmt", "institute": "TEAMMATES Test Institute 1" }, - "instructor2InCourse1": { - "googleId": "instructor2InCourse1", + "SFSubmitE2eT.instr2": { + "googleId": "SFSubmitE2eT.instr2", "name": "Teammates Test2", "isInstructor": true, - "email": "instructor2@course1.tmt", + "email": "SFSubmitE2eT.instr2@gmail.tmt", "institute": "TEAMMATES Test Institute 1" }, - "instructor1InCourse2": { - "googleId": "idOfInstructor1OfCourse2", - "name": "Instructor 1 of Course 2", - "isInstructor": true, - "email": "instr1@course2.tmt", + "SFResultsUiT.alice.b": { + "googleId": "SFSubmitE2eT.alice.b", + "name": "Alice B.", + "isInstructor": false, + "email": "SFSubmitE2eT.alice.b@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "SFSubmitE2eT.charlie.d": { + "googleId": "SFSubmitE2eT.charlie.d", + "name": "Charlie D.", + "isInstructor": false, + "email": "SFSubmitE2eT.charlie.d@gmail.tmt", "institute": "TEAMMATES Test Institute 1" }, - "student1InCourse1": { - "googleId": "student1InCourse1", - "name": "Student 1 in course 1", + "SFSubmitE2eT.danny.e": { + "googleId": "SFSubmitE2eT.danny.e", + "name": "Danny E.", "isInstructor": false, - "email": "student1inCourse1@gmail.tmt", + "email": "SFSubmitE2eT.danny.e@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "SFSubmitE2eT.emily.f": { + "googleId": "SFSubmitE2eT.emily.f", + "name": "Emily F.", + "isInstructor": false, + "email": "SFSubmitE2eT.emily.f@gmail.tmt", "institute": "TEAMMATES Test Institute 1" } }, "courses": { - "idOfCourse1": { - "id": "idOfCourse1", + "SFSubmitE2eT.CS2104": { + "id": "SFSubmitE2eT.CS2104", "name": "Programming Language Concepts", "timeZone": "UTC" } }, "instructors": { - "instructor1InCourse1": { - "googleId": "instructor1InCourse1", - "courseId": "idOfCourse1", + "SFSubmitE2eT.instr": { + "googleId": "SFSubmitE2eT.instr", + "courseId": "SFSubmitE2eT.CS2104", "name": "Teammates Test", - "email": "instructor1@course1.tmt", + "email": "SFSubmitE2eT.instr@gmail.tmt", "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", "privileges": { "courseLevel": { "canviewstudentinsection": true, @@ -60,37 +74,14 @@ "sessionLevel": {} } }, - "instructor2InCourse1": { - "googleId": "instructor2InCourse1", - "courseId": "idOfCourse1", + "SFSubmitE2eT.instr2": { + "googleId": "SFSubmitE2eT.instr2", + "courseId": "SFSubmitE2eT.CS2104", "name": "Teammates Test2", - "email": "instructor2@course1.tmt", + "email": "SFSubmitE2eT.instr2@gmail.tmt", "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1InCourse2": { - "googleId": "idOfInstructor1OfCourse2", - "courseId": "idOfTypicalCourse2", - "name": "Instructor1 Course2", - "email": "instructor1@course2.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", "privileges": { "courseLevel": { "canviewstudentinsection": true, @@ -108,21 +99,57 @@ } }, "students": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "email": "student1InCourse1@gmail.tmt", - "course": "idOfCourse1", - "name": "student1 In Course1'\"", - "comments": "comment for student1InCourse1'\"", - "team": "Team 1.1'\"", + "Alice": { + "googleId": "SFSubmitE2eT.alice.b", + "email": "SFSubmitE2eT.alice.b@gmail.tmt", + "course": "SFSubmitE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "Benny": { + "googleId": "SFSubmitE2eT.benny.c", + "email": "SFSubmitE2eT.benny.c@gmail.tmt", + "course": "SFSubmitE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "Charlie": { + "googleId": "SFSubmitE2eT.charlie.d", + "email": "SFSubmitE2eT.charlie.d@gmail.tmt", + "course": "SFSubmitE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 2", + "section": "None" + }, + "Danny": { + "googleId": "SFSubmitE2eT.danny.e", + "email": "SFSubmitE2eT.danny.e@gmail.tmt", + "course": "SFSubmitE2eT.CS2104", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + }, + "Emily": { + "googleId": "SFSubmitE2eT.emily.f", + "email": "SFSubmitE2eT.emily.f@gmail.tmt", + "course": "SFSubmitE2eT.CS2104", + "name": "Emily", + "comments": "This student's name is Emily", + "team": "Team 3", "section": "None" } }, "feedbackSessions": { "Open Session": { "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", - "creatorEmail": "instructor1@course1.tmt", + "courseId": "SFSubmitE2eT.CS2104", + "creatorEmail": "SFSubmitE2eT.instr@gmail.tmt", "instructions": "Instructions for first session", "createdTime": "2012-04-01T23:59:00Z", "startTime": "2012-04-01T15:59:00Z", @@ -139,19 +166,19 @@ "isClosingEmailEnabled": true, "isPublishedEmailEnabled": true }, - "Closed Session": { - "feedbackSessionName": "Second Session", - "courseId": "idOfCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the second feedback session", + "Grace Period Session": { + "feedbackSessionName": "Grace Period Session", + "courseId": "SFSubmitE2eT.CS2104", + "creatorEmail": "SFSubmitE2eT.instr@gmail.tmt", + "instructions": "This going to be a grace period session", "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2026-04-02T15:59:00Z", + "startTime": "2012-04-01T15:59:00Z", "endTime": "2026-04-30T15:59:00Z", "sessionVisibleFromTime": "2012-04-01T15:59:00Z", "resultsVisibleFromTime": "2026-05-01T15:59:00Z", "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, + "gracePeriod": 10, + "sentOpenEmail": true, "sentClosingEmail": false, "sentClosedEmail": false, "sentPublishedEmail": false, @@ -159,39 +186,19 @@ "isClosingEmailEnabled": true, "isPublishedEmailEnabled": true }, - "Empty Session": { - "feedbackSessionName": "Third Session", - "courseId": "idOfCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the last feedback session", + "Closed Session": { + "feedbackSessionName": "Closed Session", + "courseId": "SFSubmitE2eT.CS2104", + "creatorEmail": "SFSubmitE2eT.instr@gmail.tmt", + "instructions": "This going to be a closed session", "createdTime": "2012-04-01T23:59:00Z", "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", + "endTime": "2012-04-30T15:59:00Z", "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", + "resultsVisibleFromTime": "2026-05-01T15:59:00Z", "timeZone": "Asia/Singapore", "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Grace Period Session": { - "feedbackSessionName": "Session in Grace Period", - "courseId": "idOfCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-03-20T23:59:00Z", - "startTime": "2013-06-01T21:59:00Z", - "endTime": "2026-04-28T21:59:00Z", - "sessionVisibleFromTime": "2013-03-20T21:59:00Z", - "resultsVisibleFromTime": "2026-04-29T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 1440, - "sentOpenEmail": true, + "sentOpenEmail": false, "sentClosingEmail": false, "sentClosedEmail": false, "sentPublishedEmail": false, @@ -203,43 +210,50 @@ "feedbackQuestions": { "qn1InSession1": { "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" + "questionText": "Rate 3 other students' products" }, + "questionDescription": "

Question description for qn1

", "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, + "giverType": "STUDENTS", + "recipientType": "STUDENTS", + "numberOfEntitiesToGiveFeedbackTo": 3, "showResponsesTo": [ + "INSTRUCTORS", "RECEIVER", - "INSTRUCTORS" + "OWN_TEAM_MEMBERS" ], "showGiverNameTo": [ - "INSTRUCTORS" + "INSTRUCTORS", + "OWN_TEAM_MEMBERS" ], "showRecipientNameTo": [ - "INSTRUCTORS" + "INSTRUCTORS", + "RECEIVER" ] }, "qn2InSession1": { "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { "questionType": "TEXT", - "questionText": "Rate 3 students' products" + "questionText": "Provide feedback on each instructor" }, + "questionDescription": "

Question description for qn2

", "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, + "giverType": "STUDENTS", + "recipientType": "INSTRUCTORS", + "numberOfEntitiesToGiveFeedbackTo": -100, "showResponsesTo": [ "INSTRUCTORS", - "RECEIVER" + "RECEIVER", + "OWN_TEAM_MEMBERS" ], "showGiverNameTo": [ - "INSTRUCTORS" + "INSTRUCTORS", + "OWN_TEAM_MEMBERS" ], "showRecipientNameTo": [ "INSTRUCTORS", @@ -248,29 +262,37 @@ }, "qn3InSession1": { "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { "questionType": "TEXT", - "questionText": "Comments about the class" + "questionText": "Give feedback to your team mates" }, "questionNumber": 3, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", + "giverType": "STUDENTS", + "recipientType": "OWN_TEAM_MEMBERS", "numberOfEntitiesToGiveFeedbackTo": -100, "showResponsesTo": [ - "INSTRUCTORS" + "RECEIVER" + ], + "showGiverNameTo": [ + "RECEIVER" ], - "showGiverNameTo": [], "showRecipientNameTo": [ - "INSTRUCTORS" + "RECEIVER" ] }, "qn4InSession1": { "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should be hidden." + "numOfMcqChoices": 2, + "mcqChoices": [ + "UI", + "Algo" + ], + "questionText": "What do you think is the other teams' best feature?", + "questionType": "MCQ", + "otherEnabled": false }, "questionNumber": 4, "giverType": "TEAMS", @@ -288,14 +310,14 @@ }, "qn5InSession1": { "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { "questionType": "TEXT", "questionText": "This question should be hidden." }, "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", + "giverType": "INSTRUCTORS", + "recipientType": "STUDENTS", "numberOfEntitiesToGiveFeedbackTo": -100, "showResponsesTo": [ "RECEIVER" @@ -307,38 +329,50 @@ "RECEIVER" ] }, - "qn6InSession1": { - "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", + "qn1InGracePeriodSession": { + "feedbackSessionName": "Grace Period Session", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to other instructors." + "numOfMcqChoices": 2, + "mcqChoices": [ + "UI", + "Algo" + ], + "questionText": "What do you think is the other teams' best feature?", + "questionType": "MCQ", + "otherEnabled": false }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": 3, "showResponsesTo": [ + "INSTRUCTORS", "RECEIVER" ], "showGiverNameTo": [ + "INSTRUCTORS", "RECEIVER" ], "showRecipientNameTo": [ + "INSTRUCTORS", "RECEIVER" ] }, - "qn1InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "idOfCourse1", + "qn2InGracePeriodSession": { + "feedbackSessionName": "Grace Period Session", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" + "numOfMcqChoices": 0, + "questionText": "Which instructor do you think is the most engaging", + "questionType": "MCQ", + "otherEnabled": false, + "generateOptionsFor": "INSTRUCTORS" }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, + "questionNumber": 2, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": 3, "showResponsesTo": [ "RECEIVER" ], @@ -349,60 +383,44 @@ "RECEIVER" ] }, - "qn1InGracePeriodSession": { - "feedbackSessionName": "Session in Grace Period", - "courseId": "idOfCourse1", + "qn1InClosedSession": { + "feedbackSessionName": "Closed Session", + "courseId": "SFSubmitE2eT.CS2104", "questionDetails": { "questionType": "TEXT", - "questionText": "Give feedback." + "questionText": "What is the best selling point of your product?" }, "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, + "giverType": "STUDENTS", + "recipientType": "SELF", + "numberOfEntitiesToGiveFeedbackTo": 1, "showResponsesTo": [ - "RECEIVER" + "RECEIVER", + "OWN_TEAM_MEMBERS", + "STUDENTS", + "INSTRUCTORS" ], "showGiverNameTo": [ - "RECEIVER" + "RECEIVER", + "INSTRUCTORS" ], "showRecipientNameTo": [ - "RECEIVER" + "INSTRUCTORS" ] } }, "feedbackResponses": { - "response1ForQ1S1C1": { + "response1": { "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", - "feedbackQuestionId": "1", - "giver": "instructor1@course1.tmt", - "recipient": "instructor1@course1.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Instructor self feedback." - } - }, - "response1ForQ2S1C1": { - "feedbackSessionName": "First Session", - "courseId": "idOfCourse1", - "feedbackQuestionId": "2", - "giver": "instructor1@course1.tmt", - "recipient": "student1inCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Instructor feedback to student 1." - } - }, - "response1ForGracePeriodSession": { - "feedbackSessionName": "Session in Grace Period", - "courseId": "idOfCourse1", + "courseId": "SFSubmitE2eT.CS2104", "feedbackQuestionId": "1", - "giver": "instructor1@course1.tmt", - "recipient": "instructor2@course1.tmt", + "giver": "SFSubmitE2eT.benny.c@gmail.tmt", + "recipient": "SFSubmitE2eT.alice.b@gmail.tmt", + "giverSection": "None", + "recipientSection": "None", "responseDetails": { "questionType": "TEXT", - "answer": "Response from instructor 1 to instructor 2." + "answer": "Alice response." } } }, diff --git a/src/e2e/resources/data/FeedbackTextQuestionE2ETest.json b/src/e2e/resources/data/FeedbackTextQuestionE2ETest.json new file mode 100644 index 00000000000..d85306baf84 --- /dev/null +++ b/src/e2e/resources/data/FeedbackTextQuestionE2ETest.json @@ -0,0 +1,198 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "FTextQuestionE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "FTextQuestionE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "FTextQuestionE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "FTextQuestionE2eT.instructor", + "courseId": "FTextQuestionE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "FTextQuestionE2eT.instructor2", + "courseId": "FTextQuestionE2eT.CS2104", + "name": "Teammates Test 2", + "email": "tmms.test2@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor3": { + "googleId": "FTextQuestionE2eT.instructor", + "courseId": "FTextQuestionE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@FTextQuestionE2eT.CS2104": { + "googleId": "FTextQuestionE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "FTextQuestionE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "FTextQuestionE2eT.CS2104", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "FTextQuestionE2eT.CS1101", + "creatorEmail": "tmms.test@gmail.tmt", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1ForFirstSession": { + "feedbackSessionName": "First Session", + "courseId": "FTextQuestionE2eT.CS2104", + "questionDetails": { + "questionType": "TEXT", + "questionText": "What did this instructor do well?", + "recommendedLength": 1000 + }, + "questionDescription": "

Testing description for first session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "INSTRUCTORS", + "numberOfEntitiesToGiveFeedbackTo": 1, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + }, + "qn1ForSecondSession": { + "feedbackSessionName": "Second Session", + "courseId": "FTextQuestionE2eT.CS1101", + "questionDetails": { + "questionType": "TEXT", + "questionText": "How can this instructor improve?", + "recommendedLength": 100 + }, + "questionDescription": "

Testing description for second session

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "INSTRUCTORS", + "numberOfEntitiesToGiveFeedbackTo": 1, + "showResponsesTo": [ + "INSTRUCTORS" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/InstructorCourseDetailsPageE2ETest.json b/src/e2e/resources/data/InstructorCourseDetailsPageE2ETest.json new file mode 100644 index 00000000000..3bb8ae8fd34 --- /dev/null +++ b/src/e2e/resources/data/InstructorCourseDetailsPageE2ETest.json @@ -0,0 +1,130 @@ +{ + "accounts": { + "ICDetailsE2eT.instr": { + "googleId": "ICDetailsE2eT.instr", + "name": "Teammates Test", + "isInstructor": true, + "email": "ICDetailsE2eT.instr@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "ICDetailsE2eT.instr2": { + "googleId": "ICDetailsE2eT.instr2", + "name": "Teammates Test 2", + "isInstructor": true, + "email": "ICDetailsE2eT.instr2@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "Alice": { + "googleId": "ICDetailsE2eT.alice.b", + "name": "Alice Betsy", + "isInstructor": false, + "email": "alice.b.tmms@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "Danny": { + "googleId": "ICDetailsE2eT.danny.e", + "name": "Charlie Davis", + "isInstructor": false, + "email": "danny.e.tmms@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "ICDetailsE2eT.CS2104": { + "id": "ICDetailsE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "UTC" + } + }, + "instructors": { + "ICDetailsE2eT.instr": { + "googleId": "ICDetailsE2eT.instr", + "courseId": "ICDetailsE2eT.CS2104", + "name": "Teammates Test", + "email": "ICDetailsE2eT.instr@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "ICDetailsE2eT.instr2": { + "googleId": "ICDetailsE2eT.instr2", + "courseId": "ICDetailsE2eT.CS2104", + "name": "Teammates Test 2", + "email": "ICDetailsE2eT.instr2@gmail.tmt", + "role": "Tutor", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": false, + "canmodifycourse": false, + "canviewsessioninsection": true, + "canmodifysession": false, + "canmodifystudent": false, + "canmodifyinstructor": false + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@ICDetailsE2eT.CS2104": { + "googleId": "ICDetailsE2eT.alice.b", + "email": "alice.b.tmms@gmail.tmt", + "course": "ICDetailsE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@ICDetailsE2eT.CS2104": { + "googleId": "", + "email": "benny.c.tmms@gmail.tmt", + "course": "ICDetailsE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 2", + "section": "None" + }, + "charlie.tmms@ICDetailsE2eT.CS2104": { + "googleId": "", + "email": "charlie.d.tmms@gmail.tmt", + "course": "ICDetailsE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 1", + "section": "Section 1" + }, + "danny.tmms@ICDetailsE2eT.CS2104": { + "googleId": "ICDetailsE2eT.danny.e", + "email": "danny.e.tmms@gmail.tmt", + "course": "ICDetailsE2eT.CS2104", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "Section 2" + } + }, + "feedbackSessions": {}, + "feedbackQuestions": {}, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/test/resources/data/AdminAccountManagementPageUiTest.json b/src/e2e/resources/data/InstructorCourseJoinConfirmationPageE2ETest.json similarity index 62% rename from src/test/resources/data/AdminAccountManagementPageUiTest.json rename to src/e2e/resources/data/InstructorCourseJoinConfirmationPageE2ETest.json index f801d1870c5..84c7e43f8b2 100644 --- a/src/test/resources/data/AdminAccountManagementPageUiTest.json +++ b/src/e2e/resources/data/InstructorCourseJoinConfirmationPageE2ETest.json @@ -1,33 +1,25 @@ { "accounts": { - "AAMgtUiT.instr1": { - "googleId": "AAMgtUiT.instr1", - "name": "Teammates Instr1", + "ICJConfirmationE2eT.instr": { + "googleId": "ICJConfirmationE2eT.instr", + "name": "Teammates Test", "isInstructor": true, - "email": "AAMgtUiT.instr1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "AAMgtUiT.instr3": { - "googleId": "AAMgtUiT.instr3", - "name": "Teammates Instr3", - "isInstructor": true, - "email": "AAMgtUiT.instr3@gmail.tmt", + "email": "ICJConfirmationE2eT.instr@gmail.tmt", "institute": "TEAMMATES Test Institute 1" } }, "courses": { - "AAMgtUiT.CS2104": { - "id": "AAMgtUiT.CS2104", - "name": "Programming Language Concepts", + "ICJConfirmationE2eT.CS1101": { + "id": "ICJConfirmationE2eT.CS1101", + "name": "Programming Methodology", "timeZone": "UTC" } }, "instructors": { - "AAMgtUiT.instr1": { - "googleId": "AAMgtUiT.instr1", - "courseId": "AAMgtUiT.CS2104", - "name": "Teammates Instr1", - "email": "AAMgtUiT.instr1@gmail.tmt", + "ICJConfirmationE2eT.instr.CS1101": { + "courseId": "ICJConfirmationE2eT.CS1101", + "name": "Teammates Test 2", + "email": "ICJConfirmationE2eT.instr2@gmail.tmt", "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", @@ -46,13 +38,13 @@ "sessionLevel": {} } }, - "AAMgtUiT.instr3": { - "googleId": "AAMgtUiT.instr3", - "courseId": "AAMgtUiT.CS2104", - "name": "Teammates Instr3", - "email": "AAMgtUiT.instr2@gmail.tmt", + "ICJConfirmationE2eT.instr2.CS1101": { + "googleId": "ICJConfirmationE2eT.instr", + "courseId": "ICJConfirmationE2eT.CS1101", + "name": "Teammates Test", + "email": "ICJConfirmationE2eT.instr@gmail.tmt", "role": "Co-owner", - "isDisplayedToStudents": false, + "isDisplayedToStudents": true, "displayedName": "Co-owner", "privileges": { "courseLevel": { diff --git a/src/test/resources/data/InstructorCourseStudentDetailsEditPageUiTest.json b/src/e2e/resources/data/InstructorCourseStudentDetailsEditPageE2ETest.json similarity index 56% rename from src/test/resources/data/InstructorCourseStudentDetailsEditPageUiTest.json rename to src/e2e/resources/data/InstructorCourseStudentDetailsEditPageE2ETest.json index 84f8f8a1d70..f101b9ac287 100644 --- a/src/test/resources/data/InstructorCourseStudentDetailsEditPageUiTest.json +++ b/src/e2e/resources/data/InstructorCourseStudentDetailsEditPageE2ETest.json @@ -1,26 +1,26 @@ { "accounts": { - "CCSDEditUiT.instr": { - "googleId": "CCSDEditUiT.instr", + "ICSDEditE2eT.instr": { + "googleId": "ICSDEditE2eT.instr", "name": "Teammates Test", "isInstructor": true, - "email": "CCSDEditUiT.instr@gmail.tmt", + "email": "ICSDEditE2eT.instr@gmail.tmt", "institute": "TEAMMATES Test Institute 1" } }, "courses": { - "CCSDEditUiT.CS2104": { - "id": "CCSDEditUiT.CS2104", + "ICSDEditE2eT.CS2104": { + "id": "ICSDEditE2eT.CS2104", "name": "Programming Language Concepts", "timeZone": "UTC" } }, "instructors": { - "CCSDEditUiT.instr": { - "googleId": "CCSDEditUiT.instr", - "courseId": "CCSDEditUiT.CS2104", + "ICSDEditE2eT.instr": { + "googleId": "ICSDEditE2eT.instr", + "courseId": "ICSDEditE2eT.CS2104", "name": "Teammates Test", - "email": "CCSDEditUiT.instr@gmail.tmt", + "email": "ICSDEditE2eT.instr@gmail.tmt", "role": "Co-owner", "isDisplayedToStudents": false, "displayedName": "Co-owner", @@ -41,23 +41,21 @@ } }, "students": { - "registeredStudent": { - "googleId": "CCSDEditUiT.jose.tmms", - "email": "CCSDEditUiT.jose.tmms@gmail.tmt", - "course": "CCSDEditUiT.CS2104", - "name": "José Gómez'\"", - "comments": "This student's name is José Gómez'\"", - "team": "Team 1'\"", - "section": "None" + "ICSDEditE2eT.jose.tmms": { + "googleId": "ICSDEditE2eT.jose.tmms", + "email": "ICSDEditE2eT.jose.tmms@gmail.tmt", + "course": "ICSDEditE2eT.CS2104", + "name": "José Gómez", + "comments": "This student's name is José Gómez", + "team": "Team 1" }, - "unregisteredStudent": { + "ICSDEditE2eT.benny.c": { "googleId": "", - "email": "benny.c.tmms@gmail.tmt", - "course": "CCSDEditUiT.CS2104", + "email": "ICSDEditE2eT.benny.c.tmms@gmail.tmt", + "course": "ICSDEditE2eT.CS2104", "name": "Benny Charles", "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" + "team": "Team 1" } }, "feedbackSessions": {}, diff --git a/src/e2e/resources/data/InstructorCourseStudentDetailsPageE2ETest.json b/src/e2e/resources/data/InstructorCourseStudentDetailsPageE2ETest.json new file mode 100644 index 00000000000..c95c670cf17 --- /dev/null +++ b/src/e2e/resources/data/InstructorCourseStudentDetailsPageE2ETest.json @@ -0,0 +1,79 @@ +{ + "accounts": { + "ICSDetailsE2eT.instr": { + "googleId": "ICSDetailsE2eT.instr.veryLongGoogleId", + "name": "Teammates Test", + "isInstructor": true, + "email": "ICSDetailsE2eT.instr@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "ICSDetailsE2eT.CS2104": { + "id": "ICSDetailsE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "UTC" + } + }, + "instructors": { + "ICSDetailsE2eT.instr": { + "googleId": "ICSDetailsE2eT.instr", + "courseId": "ICSDetailsE2eT.CS2104", + "name": "Teammates Test", + "email": "ICSDetailsE2eT.instr@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "ICSDetailsE2eT.jose.tmms": { + "googleId": "ICSDetailsE2eT.jose.tmms", + "email": "ICSDetailsE2eT.jose.tmms@gmail.tmt", + "course": "ICSDetailsE2eT.CS2104", + "name": "José Gómez", + "comments": "This student's name is José Gómez", + "team": "Team 1", + "section": "None" + }, + "ICSDetailsE2eT.benny.c": { + "googleId": "ICSDetailsE2eT.benny.c", + "email": "ICSDetailsE2eT.benny.c.tmms@gmail.tmt", + "course": "ICSDetailsE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "Section 1" + } + }, + "feedbackSessions": {}, + "feedbackQuestions": {}, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": { + "ICSDetailsE2eT.jose.tmms": { + "googleId": "ICSDetailsE2eT.jose.tmms", + "shortName": "José", + "email": "jose@e.tmt", + "institute": "TEAMMATES Test Institute 7", + "nationality": "Laotian", + "gender": "MALE", + "moreInfo": "This is a lot of info...", + "pictureKey": "" + } + } +} diff --git a/src/e2e/resources/data/InstructorFeedbackEditPageE2ETest.json b/src/e2e/resources/data/InstructorFeedbackEditPageE2ETest.json new file mode 100644 index 00000000000..8c355e4baa1 --- /dev/null +++ b/src/e2e/resources/data/InstructorFeedbackEditPageE2ETest.json @@ -0,0 +1,187 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "CFeedbackEditE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "CFeedbackEditE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "CFeedbackEditE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "CFeedbackEditE2eT.instructor", + "courseId": "CFeedbackEditE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "CFeedbackEditE2eT.instructor", + "courseId": "CFeedbackEditE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@CFeedbackEditE2eT.CS2104": { + "googleId": "CFeedbackEditE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "CFeedbackEditE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@CFeedbackEditE2eT.CS2104": { + "googleId": "CFeedbackEditE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "CFeedbackEditE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@CFeedbackEditE2eT.CS1101": { + "googleId": "charlie.tmms", + "email": "CFeedbackEditE2eT.charlie.tmms@gmail.tmt", + "course": "CFeedbackEditE2eT.CS1101", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 2", + "section": "None" + }, + "danny.tmms@CFeedbackEditE2eT.CS1101": { + "googleId": "danny.tmms", + "email": "CFeedbackEditE2eT.danny.tmms@gmail.tmt", + "course": "CFeedbackEditE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "openSession": { + "feedbackSessionName": "First Session", + "courseId": "CFeedbackEditE2eT.CS2104", + "creatorEmail": "backdoor@teammates.com", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession2": { + "feedbackSessionName": "Second Session", + "courseId": "CFeedbackEditE2eT.CS1101", + "creatorEmail": "backdoor@teammates.com", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1": { + "feedbackSessionName": "Second Session", + "courseId": "CFeedbackEditE2eT.CS1101", + "questionDetails": { + "questionType": "TEXT", + "questionText": "Testing question text" + }, + "questionDescription": "

Testing description

", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": 2, + "showResponsesTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ], + "showGiverNameTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ], + "showRecipientNameTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ] + } + }, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/InstructorFeedbackSessionsPageE2ETest.json b/src/e2e/resources/data/InstructorFeedbackSessionsPageE2ETest.json new file mode 100644 index 00000000000..05ccd8410f4 --- /dev/null +++ b/src/e2e/resources/data/InstructorFeedbackSessionsPageE2ETest.json @@ -0,0 +1,201 @@ +{ + "accounts": { + "instructorWithSessions": { + "googleId": "CFeedbackSessionsE2eT.instructor", + "name": "Teammates Test", + "isInstructor": true, + "email": "tmms.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "course": { + "id": "CFeedbackSessionsE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "Africa/Johannesburg" + }, + "course2": { + "id": "CFeedbackSessionsE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "Africa/Johannesburg" + } + }, + "instructors": { + "instructor": { + "googleId": "CFeedbackSessionsE2eT.instructor", + "courseId": "CFeedbackSessionsE2eT.CS2104", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor2": { + "googleId": "CFeedbackSessionsE2eT.instructor", + "courseId": "CFeedbackSessionsE2eT.CS1101", + "name": "Teammates Test", + "email": "tmms.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@CFeedbackSessionsE2eT.CS2104": { + "googleId": "CFeedbackSessionsE2eT.alice.tmms", + "email": "alice.b.tmms@gmail.tmt", + "course": "CFeedbackSessionsE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "benny.tmms@CFeedbackSessionsE2eT.CS2104": { + "googleId": "CFeedbackSessionsE2eT.benny.tmms", + "email": "benny.tmms@gmail.tmt", + "course": "CFeedbackSessionsE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "charlie.tmms@CFeedbackSessionsE2eT.CS1101": { + "googleId": "CFeedbackSessionsE2eT.charlie.tmms", + "email": "charlie.tmms@gmail.tmt", + "course": "CFeedbackSessionsE2eT.CS1101", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 2", + "section": "None" + }, + "danny.tmms@CFeedbackSessionsE2eT.CS1101": { + "googleId": "CFeedbackSessionsE2eT.danny.tmms", + "email": "CFeedbackSessionsE2eT.danny.tmms@gmail.tmt", + "course": "CFeedbackSessionsE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "closedSession": { + "feedbackSessionName": "First Session", + "courseId": "CFeedbackSessionsE2eT.CS2104", + "creatorEmail": "backdoor@teammates.com", + "instructions": "

Instructions for first session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2016-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2016-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "openSession": { + "feedbackSessionName": "Second Session", + "courseId": "CFeedbackSessionsE2eT.CS1101", + "creatorEmail": "backdoor@teammates.com", + "instructions": "

Instructions for Second session

", + "createdTime": "2012-04-01T23:59:00Z", + "startTime": "2012-04-01T21:59:00Z", + "endTime": "2026-04-30T21:59:00Z", + "sessionVisibleFromTime": "2012-04-01T21:59:00Z", + "resultsVisibleFromTime": "2026-05-01T21:59:00Z", + "timeZone": "Africa/Johannesburg", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "qn1": { + "feedbackSessionName": "Second Session", + "courseId": "CFeedbackSessionsE2eT.CS1101", + "questionDetails": { + "questionType": "TEXT", + "questionText": "Testing question text" + }, + "questionDescription": "Testing description", + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": 2, + "showResponsesTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ], + "showGiverNameTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ], + "showRecipientNameTo": [ + "STUDENTS", + "INSTRUCTORS", + "OWN_TEAM_MEMBERS", + "RECEIVER" + ] + } + }, + "feedbackResponses": { + "response1": { + "feedbackSessionName": "Second Session", + "courseId": "CFeedbackSessionsE2eT.CS1101", + "feedbackQuestionId": "1", + "giver": "CFeedbackSessionsE2eT.danny.tmms@gmail.tmt", + "recipient": "CFeedbackSessionsE2eT.danny.tmms@gmail.tmt", + "giverSection": "None", + "recipientSection": "None", + "responseDetails": { + "questionType": "TEXT", + "answer": "Danny self feedback." + } + } + }, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/InstructorHomePageE2ETest.json b/src/e2e/resources/data/InstructorHomePageE2ETest.json new file mode 100644 index 00000000000..597858388da --- /dev/null +++ b/src/e2e/resources/data/InstructorHomePageE2ETest.json @@ -0,0 +1,314 @@ +{ + "accounts": { + "IHomeE2eT.instr": { + "googleId": "IHomeE2eT.instructor.tmms", + "name": "Teammates Test", + "isInstructor": true, + "email": "IHomeE2eT.instructor.tmms@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "IHomeE2eT.CS2104": { + "createdAt": "2012-04-01T23:58:00Z", + "id": "IHomeE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "UTC" + }, + "IHomeE2eT.CS1101": { + "createdAt": "2013-04-01T23:59:00Z", + "id": "IHomeE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "UTC" + } + }, + "instructors": { + "IHomeE2eT.instr.CS2104": { + "googleId": "IHomeE2eT.instructor.tmms", + "courseId": "IHomeE2eT.CS2104", + "name": "Teammates Test", + "email": "IHomeE2eT.instructor.tmms@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "IHomeE2eT.instr.CS1101": { + "googleId": "IHomeE2eT.instructor.tmms", + "courseId": "IHomeE2eT.CS1101", + "name": "Teammates Test", + "email": "IHomeE2eT.instructor.tmms@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "IHomeE2eT.alice.b.tmms@IHomeE2eT.CS2104": { + "googleId": "IHomeE2eT.alice.b.tmms", + "email": "IHomeE2eT.alice.b.tmms@gmail.tmt", + "course": "IHomeE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "IHomeE2eT.benny.c.tmms@IHomeE2eT.CS2104": { + "googleId": "IHomeE2eT.benny.c.tmms", + "email": "IHomeE2eT.benny.c.tmms@gmail.tmt", + "course": "IHomeE2eT.CS2104", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "IHomeE2eT.charlie.d.tmms@IHomeE2eT.CS2104": { + "googleId": "IHomeE2eT.charlie.d.tmms", + "email": "IHomeE2eT.charlie.d.tmms@gmail.tmt", + "course": "IHomeE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 2", + "section": "None" + }, + "IHomeE2eT.danny.e.tmms@IHomeE2eT.CS2104": { + "googleId": "IHomeE2eT.danny.e.tmms", + "email": "IHomeE2eT.danny.e.tmms@gmail.tmt", + "course": "IHomeE2eT.CS2104", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + }, + "IHomeE2eT.alice.b.tmms@IHomeE2eT.CS1101": { + "googleId": "IHomeE2eT.alice.b.tmms", + "email": "IHomeE2eT.alice.b.tmms@gmail.tmt", + "course": "IHomeE2eT.CS1101", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", + "section": "None" + }, + "IHomeE2eT.benny.c.tmms@IHomeE2eT.CS1101": { + "googleId": "IHomeE2eT.benny.c.tmms", + "email": "IHomeE2eT.benny.c.tmms@gmail.tmt", + "course": "IHomeE2eT.CS1101", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "None" + }, + "IHomeE2eT.charlie.d.tmms@IHomeE2eT.CS1101": { + "googleId": "IHomeE2eT.charlie.d.tmms", + "email": "IHomeE2eT.charlie.d.tmms@gmail.tmt", + "course": "IHomeE2eT.CS1101", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 2", + "section": "None" + }, + "IHomeE2eT.danny.e.tmms@IHomeE2eT.CS1101": { + "googleId": "IHomeE2eT.danny.e.tmms", + "email": "IHomeE2eT.danny.e.tmms@gmail.tmt", + "course": "IHomeE2eT.CS1101", + "name": "Danny Engrid", + "comments": "This student's name is Danny Engrid", + "team": "Team 2", + "section": "None" + } + }, + "feedbackSessions": { + "First Feedback Session": { + "feedbackSessionName": "First Feedback Session", + "courseId": "IHomeE2eT.CS2104", + "creatorEmail": "IHomeE2eT.instructor.tmms@gmail.tmt", + "instructions": "Please please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2012-04-01T04:00:00Z", + "endTime": "2027-04-30T15:59:00Z", + "sessionVisibleFromTime": "2012-03-28T15:59:00Z", + "resultsVisibleFromTime": "2027-05-01T15:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": true, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "Second Feedback Session": { + "feedbackSessionName": "Second Feedback Session", + "courseId": "IHomeE2eT.CS2104", + "creatorEmail": "IHomeE2eT.instructor.tmms@gmail.tmt", + "instructions": "Please please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2027-03-29T14:59:00Z", + "endTime": "2027-04-30T04:00:00Z", + "sessionVisibleFromTime": "2012-03-28T15:59:00Z", + "resultsVisibleFromTime": "2027-05-01T15:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": false, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "Third Feedback Session": { + "feedbackSessionName": "Third Feedback Session", + "courseId": "IHomeE2eT.CS2104", + "creatorEmail": "IHomeE2eT.instructor.tmms@gmail.tmt", + "instructions": "Please please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2012-04-10T15:59:00Z", + "endTime": "2012-04-30T15:59:00Z", + "sessionVisibleFromTime": "2012-03-28T15:59:00Z", + "resultsVisibleFromTime": "2027-05-01T15:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": true, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": false, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "Fourth Feedback Session": { + "feedbackSessionName": "Fourth Feedback Session", + "courseId": "IHomeE2eT.CS2104", + "creatorEmail": "IHomeE2eT.instructor.tmms@gmail.tmt", + "instructions": "Please please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2012-04-05T03:59:00Z", + "endTime": "2012-04-20T04:00:00Z", + "sessionVisibleFromTime": "2012-03-28T15:59:00Z", + "resultsVisibleFromTime": "2012-05-01T15:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": true, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": true, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + }, + "CS1101 Session": { + "feedbackSessionName": "CS1101 Session", + "courseId": "IHomeE2eT.CS1101", + "creatorEmail": "IHomeE2eT.instructor.tmms@gmail.tmt", + "instructions": "Please please fill in the following questions.", + "createdTime": "2012-03-20T23:59:00Z", + "startTime": "2012-04-05T03:59:00Z", + "endTime": "2012-04-20T04:00:00Z", + "sessionVisibleFromTime": "2012-03-28T15:59:00Z", + "resultsVisibleFromTime": "2012-05-01T15:59:00Z", + "timeZone": "Asia/Singapore", + "gracePeriod": 10, + "sentOpenEmail": true, + "sentClosingEmail": false, + "sentClosedEmail": false, + "sentPublishedEmail": true, + "isOpeningEmailEnabled": true, + "isClosingEmailEnabled": true, + "isPublishedEmailEnabled": true + } + }, + "feedbackQuestions": { + "IHomeE2eT.CS2104:First Feedback Session:Q1": { + "feedbackSessionName": "First Feedback Session", + "courseId": "IHomeE2eT.CS2104", + "questionDetails": { + "questionType": "TEXT", + "questionText": "Rate 5 other students' products" + }, + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "STUDENTS", + "numberOfEntitiesToGiveFeedbackTo": 5, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + }, + "IHomeE2eT.CS2104:Third Feedback Session:Q1": { + "feedbackSessionName": "Third Feedback Session", + "courseId": "IHomeE2eT.CS2104", + "questionDetails": { + "questionType": "TEXT", + "questionText": "Rate 5 other students' products" + }, + "questionNumber": 1, + "giverType": "STUDENTS", + "recipientType": "STUDENTS", + "numberOfEntitiesToGiveFeedbackTo": 5, + "showResponsesTo": [ + "INSTRUCTORS", + "RECEIVER" + ], + "showGiverNameTo": [ + "INSTRUCTORS" + ], + "showRecipientNameTo": [ + "INSTRUCTORS", + "RECEIVER" + ] + } + }, + "feedbackResponses": { + "response1": { + "feedbackSessionName": "First Feedback Session", + "courseId": "IHomeE2eT.CS2104", + "feedbackQuestionId": "1", + "giver": "IHomeE2eT.alice.b.tmms@gmail.tmt", + "recipient": "IHomeE2eT.danny.e.tmms@gmail.tmt", + "giverSection": "None", + "recipientSection": "None", + "responseDetails": { + "questionType": "TEXT", + "answer": "Alice response to Danny." + } + } + }, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/InstructorSearchPageE2ETest.json b/src/e2e/resources/data/InstructorSearchPageE2ETest.json new file mode 100644 index 00000000000..2f9649ccbee --- /dev/null +++ b/src/e2e/resources/data/InstructorSearchPageE2ETest.json @@ -0,0 +1,189 @@ +{ + "accounts": { + "instructor1OfCourse1": { + "googleId": "searchE2E.idOfInstructor1OfCourse1", + "name": "Instructor 1 of Course 1", + "isInstructor": true, + "email": "searchE2E.instr1@course1.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "student1InCourse1": { + "googleId": "searchE2E.student1InCourse1", + "name": "Student 1 in course 1", + "isInstructor": false, + "email": "searchE2E.student1InCourse1@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "student2InCourse1": { + "googleId": "searchE2E.student2InCourse1", + "name": "Student in two courses", + "isInstructor": false, + "email": "searchE2E.student2InCourse1@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "student2.2InCourse1": { + "googleId": "searchE2E.student2.2InCourse1", + "name": "Student in two courses", + "isInstructor": false, + "email": "searchE2E.student2InCourse1@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "student3InCourse1": { + "googleId": "searchE2E.student3InCourse1", + "name": "Student 3 in course 1", + "isInstructor": false, + "email": "searchE2E.student3InCourse1@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "typicalCourse1": { + "id": "searchE2E.idOfTypicalCourse1", + "name": "Typical Course 1 with 2 Evals", + "timeZone": "UTC" + }, + "typicalCourse2": { + "id": "searchE2E.idOfTypicalCourse2", + "name": "Typical Course 2 with 2 Evals", + "timeZone": "UTC" + } + }, + "instructors": { + "instructor1OfCourse1": { + "googleId": "searchE2E.idOfInstructor1OfCourse1", + "courseId": "searchE2E.idOfTypicalCourse1", + "name": "Instructor1 Course1", + "email": "searchE2E.instructor1@course1.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructor1OfCourse2": { + "googleId": "searchE2E.idOfInstructor1OfCourse1", + "courseId": "searchE2E.idOfTypicalCourse2", + "name": "Instructor1 Course2", + "email": "searchE2E.instructor1@course1.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "student1InCourse1": { + "googleId": "searchE2E.student1InCourse1", + "email": "searchE2E.student1InCourse1@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse1", + "name": "student1 In Course1", + "comments": "comment for student1InCourse1", + "team": "Team 1.1", + "section": "Section 1" + }, + "student2InCourse1": { + "googleId": "searchE2E.student2InCourse1", + "email": "searchE2E.student2InCourse1@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse1", + "name": "student2 In Course1", + "comments": "", + "team": "Team 1.1", + "section": "Section 1" + }, + "student2.2InCourse1": { + "googleId": "searchE2E.student2.2InCourse1", + "email": "searchE2E.student2.2InCourse1@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse1", + "name": "student2 2 In Course1", + "comments": "", + "team": "Team 1.1", + "section": "Section 1" + }, + "student3InCourse1": { + "googleId": "searchE2E.student3InCourse1", + "email": "searchE2E.student3InCourse1@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse1", + "name": "student3 In Course1", + "comments": "", + "team": "Team 1.2", + "section": "Section 1" + }, + "student1InCourse2": { + "googleId": "", + "email": "searchE2E.student1InCourse2@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse2", + "name": "student1 In Course2", + "comments": "comment for student1InCourse2", + "team": "Team 1.1", + "section": "Section 1" + }, + "student2InCourse2": { + "googleId": "", + "email": "searchE2E.student2InCourse2@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse2", + "name": "student2 In Course2", + "comments": "", + "team": "Team 1.1", + "section": "Section 1" + }, + "student2.2InCourse2": { + "googleId": "", + "email": "searchE2E.student2.2InCourse2@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse2", + "name": "student2 2 In Course2", + "comments": "", + "team": "Team 1.1", + "section": "Section 1" + }, + "student3InCourse2": { + "googleId": "", + "email": "searchE2E.student3InCourse2@gmail.tmt", + "course": "searchE2E.idOfTypicalCourse2", + "name": "student3 In Course2", + "comments": "", + "team": "Team 1.2", + "section": "Section 1" + } + }, + "feedbackSessions": {}, + "feedbackQuestions": {}, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": { + "student1InCourse1": { + "googleId": "student1InCourse1", + "shortName": "Stud1", + "email": "i.m.stud1@gmail.tmt", + "institute": "TEAMMATES Test Institute 3", + "nationality": "", + "gender": "MALE", + "moreInfo": "I am just a student :P", + "pictureKey": "" + } + } +} diff --git a/src/e2e/resources/data/InstructorStudentListPageE2ETest.json b/src/e2e/resources/data/InstructorStudentListPageE2ETest.json new file mode 100644 index 00000000000..419ff10cce8 --- /dev/null +++ b/src/e2e/resources/data/InstructorStudentListPageE2ETest.json @@ -0,0 +1,179 @@ +{ + "accounts": { + "instructorOfCourse1": { + "googleId": "ISListE2ET.idOfInstructor1OfCourse1", + "name": "Instructor of Course 1", + "isInstructor": true, + "email": "ISListE2E.instr1@course1.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "Student3Course3": { + "googleId": "ISListE2ET.charlie.tmms", + "name": "Charlie D", + "isInstructor": false, + "email": "ISListE2ET.charlie.tmms@gmail.tmt", + "institute": "TEAMMATES Test Institute 5" + } + }, + "courses": { + "course1": { + "id": "ISListE2ET.course1", + "name": "Name of Course 1", + "timeZone": "UTC" + }, + "course2": { + "id": "ISListE2ET.course2", + "name": "Name of Course 2", + "timeZone": "UTC" + }, + "course3": { + "id": "ISListE2ET.course3", + "name": "Name of Course 3", + "timeZone": "UTC" + } + }, + "instructors": { + "instructorOfCourse1": { + "googleId": "ISListE2ET.idOfInstructor1OfCourse1", + "courseId": "ISListE2ET.course1", + "name": "Instructor1 Course1", + "email": "ISListE2E.instr1@course1.tmt", + "isArchived": false, + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructorOfCourse2": { + "googleId": "ISListE2ET.idOfInstructor1OfCourse1", + "courseId": "ISListE2ET.course2", + "name": "Instructor1 Course2", + "email": "ISListE2E.instr1@course1.tmt", + "isArchived": false, + "role": "Custom", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": false, + "cansubmitsessioninsection": false, + "canmodifysessioncommentinsection": false, + "canmodifycourse": false, + "canviewsessioninsection": false, + "canmodifysession": false, + "canmodifystudent": false, + "canmodifyinstructor": false + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "instructorOfCourse3": { + "googleId": "ISListE2ET.idOfInstructor1OfCourse1", + "courseId": "ISListE2ET.course3", + "name": "Instructor1 Course3", + "email": "ISListE2E.instr1@course1.tmt", + "isArchived": false, + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "Student1Course2": { + "googleId": "ISListE2ET.alice.tmms", + "email": "ISListE2ET.alice.tmms@gmail.tmt", + "course": "ISListE2ET.course2", + "name": "Alice", + "comments": "This student's name is Alice", + "team": "Team 1", + "section": "Section A" + }, + "Student2Course2": { + "googleId": "ISListE2ET.benny.tmms", + "email": "benny.c.tmms@gmail.tmt", + "course": "ISListE2ET.course2", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 2", + "section": "Section B" + }, + "Student3Course2": { + "googleId": "", + "email": "hugh.i.tmms@gmail.tmt", + "course": "ISListE2ET.course2", + "name": "Hugh Ivanov", + "comments": "This student's name is Hugh Ivanov", + "team": "Team 2", + "section": "Section B" + }, + "Student1Course3": { + "googleId": "ISListE2ET.alice.tmms", + "email": "ISListE2ET.alice.tmms@gmail.tmt", + "course": "ISListE2ET.course3", + "name": "Alice Betsy", + "comments": "This student's name is Alice", + "team": "Team 1", + "section": "Section 1" + }, + "Student2Course3": { + "googleId": "", + "email": "benny.c.tmms@gmail.tmt", + "course": "ISListE2ET.course3", + "name": "Benny Charles", + "comments": "This student's name is Benny Charles", + "team": "Team 1", + "section": "Section 1" + }, + "Student3Course3": { + "googleId": "ISListE2ET.charlie.tmms", + "email": "ISListE2ET.charlie.tmms@gmail.tmt", + "course": "ISListE2ET.course3", + "name": "Charlie D", + "comments": "This student's name is Charlie Davis", + "team": "Team 2", + "section": "Section 1" + }, + "Student4Course3": { + "googleId": "", + "email": "denny.c.tmms@gmail.tmt", + "course": "ISListE2ET.course3", + "name": "Denny Charlés", + "comments": "This student's name is Denny Charlés", + "team": "Team 2", + "section": "Section 1" + } + }, + "feedbackSessions": {}, + "feedbackQuestions": {}, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/data/InstructorStudentRecordsPageE2ETest.json b/src/e2e/resources/data/InstructorStudentRecordsPageE2ETest.json new file mode 100644 index 00000000000..46d12f44d36 --- /dev/null +++ b/src/e2e/resources/data/InstructorStudentRecordsPageE2ETest.json @@ -0,0 +1,77 @@ +{ + "accounts": { + "teammates.test": { + "googleId": "ISRE2eT.teammates.test", + "name": "Teammates Test", + "isInstructor": true, + "email": "teammates.test@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "benny.c.tmms@ISR.CS2104": { + "googleId": "ISRE2eT.benny.c.tmms", + "name": "Benny Charlés", + "isInstructor": false, + "email": "benny.c.tmms@gmail.tmt", + "institute": "TEAMMATES Test Institute 5" + } + }, + "courses": { + "CS2104": { + "id": "ISRE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "UTC" + } + }, + "instructors": { + "teammates.test.CS2104": { + "googleId": "ISRE2eT.teammates.test", + "courseId": "ISRE2eT.CS2104", + "name": "Teammates Test", + "email": "teammates.test@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "benny.c.tmms@ISR.CS2104": { + "googleId": "ISRE2eT.benny.c.tmms", + "email": "benny.c.tmms@gmail.tmt", + "course": "ISRE2eT.CS2104", + "name": "Benny Charlés", + "comments": "This student's name is Benny Charlés", + "team": "Team 1", + "section": "None" + } + }, + "feedbackSessions": {}, + "feedbackQuestions": {}, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": { + "benny.c.tmms@ISR.CS2104": { + "googleId": "ISRE2eT.benny.c.tmms", + "shortName": "Ben", + "email": "", + "institute": "TEAMMATES Test Institute 7", + "nationality": "Singaporean", + "gender": "MALE", + "moreInfo": "This is a lot of info!", + "pictureKey": "" + } + } +} diff --git a/src/e2e/resources/data/StudentCourseDetailsPageE2ETest.json b/src/e2e/resources/data/StudentCourseDetailsPageE2ETest.json index c10b0e8a019..99aba29374e 100644 --- a/src/e2e/resources/data/StudentCourseDetailsPageE2ETest.json +++ b/src/e2e/resources/data/StudentCourseDetailsPageE2ETest.json @@ -1,7 +1,7 @@ { "accounts": { - "SCDetailsUiT.instr": { - "googleId": "SCDetailsUiT.instr", + "SCDetailsE2eT.instr": { + "googleId": "SCDetailsE2eT.instr", "name": "Instructor", "isInstructor": true, "email": "tmms.test@gmail.tmt", @@ -9,18 +9,42 @@ } }, "courses": { - "SCDetailsUiT.CS2104": { - "id": "SCDetailsUiT.CS2104", + "SCDetailsE2eT.CS2104": { + "id": "SCDetailsE2eT.CS2104", "name": "Programming Language Concepts", - "timeZone": "UTC" + "timeZone": "UTC", + "createdAt": "2012-04-02T11:00:00Z" } }, "instructors": { - "SCDetailsUiT.instr": { - "googleId": "SCDetailsUiT.instr", - "courseId": "SCDetailsUiT.CS2104", + "SCDetailsE2eT.instr": { + "googleId": "SCDetailsE2eT.instr", + "courseId": "SCDetailsE2eT.CS2104", "name": "Teammates Test", - "email": "SCDetailsUiT.instr@gmail.tmt", + "email": "SCDetailsE2eT.instr@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Instructor", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "SCDetailsE2eT.instr2": { + "googleId": "SCDetailsE2eT.instr2", + "courseId": "SCDetailsE2eT.CS2104", + "name": "Teammates Test 2", + "email": "SCDetailsE2eT2.instr@gmail.tmt", "role": "Co-owner", "isDisplayedToStudents": true, "displayedName": "Instructor", @@ -41,22 +65,31 @@ } }, "students": { - "SCDetailsUiT.alice": { - "googleId": "SCDetailsUiT.alice.veryLongGoogleId", - "email": "SCDetailsUiT.alice@gmail.tmt", - "course": "SCDetailsUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", + "SCDetailsE2eT.alice": { + "googleId": "SCDetailsE2eT.alice", + "email": "SCDetailsE2eT.alice@gmail.tmt", + "course": "SCDetailsE2eT.CS2104", + "name": "Alice Betsy", + "comments": "This student's name is Alice Betsy", + "team": "Team 1", "section": "None" }, - "SCDetailsUiT.benny": { - "googleId": "SCDetailsUiT.benny", - "email": "SCDetailsUiT.benny@gmail.tmt", - "course": "SCDetailsUiT.CS2104", + "SCDetailsE2eT.benny": { + "googleId": "SCDetailsE2eT.benny", + "email": "SCDetailsE2eT.benny@gmail.tmt", + "course": "SCDetailsE2eT.CS2104", "name": "Benny Charles", "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", + "team": "Team 1", + "section": "None" + }, + "SCDetailsE2eT.charlie": { + "googleId": "SCDetailsE2eT.charlie", + "email": "SCDetailsE2eT.charlie@gmail.tmt", + "course": "SCDetailsE2eT.CS2104", + "name": "Charlie Davis", + "comments": "This student's name is Charlie Davis", + "team": "Team 1", "section": "None" } }, @@ -65,14 +98,24 @@ "feedbackResponses": {}, "feedbackResponseComments": {}, "profiles": { - "SCDetailsUiT.student1InTSCourse": { - "googleId": "SCDetailsUiT.benny", + "SCDetailsE2eT.benny": { + "googleId": "SCDetailsE2eT.benny", "shortName": "Benny", - "email": "SCDetailsUiT.benny@gmail.tmt", - "institute": "inst", + "email": "SCDetailsE2eT.benny@gmail.tmt", + "institute": "inst", "nationality": "American", "gender": "OTHER", - "moreInfo": "I am just a student :P", + "moreInfo": "I am just a student :P", + "pictureKey": "" + }, + "SCDetailsE2eT.charlie": { + "googleId": "SCDetailsE2eT.charlie", + "shortName": "Charlie", + "email": "SCDetailsE2eT.charlie@gmail.tmt", + "institute": "inst", + "nationality": "Singaporean", + "gender": "OTHER", + "moreInfo": "I am also a student :P", "pictureKey": "" } } diff --git a/src/e2e/resources/data/StudentCourseJoinConfirmationPageE2ETest.json b/src/e2e/resources/data/StudentCourseJoinConfirmationPageE2ETest.json new file mode 100644 index 00000000000..8874022ab53 --- /dev/null +++ b/src/e2e/resources/data/StudentCourseJoinConfirmationPageE2ETest.json @@ -0,0 +1,103 @@ +{ + "accounts": { + "SCJConfirmationE2eT.instr": { + "googleId": "SCJConfirmationE2eT.instr", + "name": "Teammates Test", + "isInstructor": true, + "email": "SCJConfirmationE2eT.instr@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + }, + "alice.tmms": { + "googleId": "SCJConfirmationE2eT.alice", + "name": "Alice B", + "isInstructor": false, + "email": "SCJConfirmationE2eT.alice@gmail.tmt", + "institute": "TEAMMATES Test Institute 1" + } + }, + "courses": { + "SCJConfirmationE2eT.CS2104": { + "id": "SCJConfirmationE2eT.CS2104", + "name": "Programming Language Concepts", + "timeZone": "UTC" + }, + "SCJConfirmationE2eT.CS1101": { + "id": "SCJConfirmationE2eT.CS1101", + "name": "Programming Methodology", + "timeZone": "UTC" + } + }, + "instructors": { + "SCJConfirmationE2eT.instr.CS2104": { + "googleId": "SCJConfirmationE2eT.instr", + "courseId": "SCJConfirmationE2eT.CS2104", + "name": "Teammates Test", + "email": "SCJConfirmationE2eT.instr@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + }, + "SCJConfirmationE2eT.instr.CS1101": { + "googleId": "SCJConfirmationE2eT.instr", + "courseId": "SCJConfirmationE2eT.CS1101", + "name": "Teammates Test", + "email": "SCJConfirmationE2eT.instr@gmail.tmt", + "role": "Co-owner", + "isDisplayedToStudents": true, + "displayedName": "Co-owner", + "privileges": { + "courseLevel": { + "canviewstudentinsection": true, + "cansubmitsessioninsection": true, + "canmodifysessioncommentinsection": true, + "canmodifycourse": true, + "canviewsessioninsection": true, + "canmodifysession": true, + "canmodifystudent": true, + "canmodifyinstructor": true + }, + "sectionLevel": {}, + "sessionLevel": {} + } + } + }, + "students": { + "alice.tmms@SCJConfirmationE2eT.CS2104": { + "googleId": "", + "email": "SCJConfirmationE2eT.alice@gmail.tmt", + "course": "SCJConfirmationE2eT.CS2104", + "name": "Amy Betsy", + "comments": "This student's name is Amy Betsy", + "team": "Team 1", + "section": "None" + }, + "alice.tmms@SCJConfirmationE2eT.CS1101": { + "googleId": "SCJConfirmationE2eT.alice", + "email": "SCJConfirmationE2eT.alice@gmail.tmt", + "course": "SCJConfirmationE2eT.CS1101", + "name": "Amy Betsy", + "comments": "This student's name is Amy Betsy", + "team": "Team 1", + "section": "None" + } + }, + "feedbackSessions": {}, + "feedbackQuestions": {}, + "feedbackResponses": {}, + "feedbackResponseComments": {}, + "profiles": {} +} diff --git a/src/e2e/resources/test.template.properties b/src/e2e/resources/test.template.properties index 2207377e331..f2e380bcae6 100644 --- a/src/e2e/resources/test.template.properties +++ b/src/e2e/resources/test.template.properties @@ -6,7 +6,7 @@ # This is the url of the app we are testing against. # e.g. test.app.url=http\://localhost\:8080 -# e.g. test.app.url=https\://6-0-0-dot-teammates-john.appspot.com +# e.g. test.app.url=https\://7-0-0-dot-teammates-john.appspot.com # Note: the '.' in the url has been replaced by -dot- to support https connection for the staging server. test.app.url=http\://localhost\:8080 @@ -24,6 +24,10 @@ test.backdoor.key=samplekey # allowed values for browser: firefox, chrome test.selenium.browser=firefox +# Indicates whether browser should be closed when an E2E test fails. +# Browser is always closed after an E2E test succeeds. +test.browser.closeonfailure=true + # Optional field to change Firefox path. # This allows using a non-default binary. # To use the default Firefox in your PATH variable, leave the field empty. @@ -43,6 +47,18 @@ test.geckodriver.path= # e.g test.chromedriver.path=/Users/YourName/Downloads/chromedriver test.chromedriver.path= +# This is the profile for Firefox used for logging in. +# It is required if you are running test with Firefox and not using dev server. +# Enter about:profiles into Firefox address bar to identify the profile you are using. +# e.g test.firefox.profile.name=default-release +test.firefox.profile.name= + +# This is the path for Chrome's user data used for logging in. +# It is required if you are running test with Chrome and not using dev server. +# e.g test.chromedriver.path=C:/Users/YourName/AppData/Local/Google/User Data +# e.g test.chromedriver.path=/Users/YourName/Library/Application Support/Google/Chrome/Default +test.chrome.userdata.path= + ############################################################################### # This is the timeout value, in seconds, for the waitings done in browsers # e.g waiting for element (non-)presence/(in)visibility, for page to load diff --git a/src/e2e/resources/test.travis-chrome.properties b/src/e2e/resources/test.travis-chrome.properties index af40a38a5cb..10f85e22b39 100644 --- a/src/e2e/resources/test.travis-chrome.properties +++ b/src/e2e/resources/test.travis-chrome.properties @@ -6,8 +6,9 @@ test.app.url=http\://localhost\:8080 test.csrf.key=samplekey test.backdoor.key=samplekey test.selenium.browser=chrome +test.browser.closeonfailure=true test.chromedriver.path=/home/travis/chromedriver -test.timeout=15 +test.timeout=5 test.persistence.timeout=16 test.admin.account=yourGoogleId test.admin.password=adminpassword diff --git a/src/e2e/resources/test.travis.properties b/src/e2e/resources/test.travis.properties index ef11322892a..8b9a268a784 100644 --- a/src/e2e/resources/test.travis.properties +++ b/src/e2e/resources/test.travis.properties @@ -6,9 +6,10 @@ test.app.url=http\://localhost\:8080 test.csrf.key=samplekey test.backdoor.key=samplekey test.selenium.browser=firefox +test.browser.closeonfailure=true test.geckodriver.path=/home/travis/geckodriver test.firefox.path= -test.timeout=15 +test.timeout=5 test.persistence.timeout=16 test.admin.account=yourGoogleId test.admin.password=adminpassword diff --git a/src/e2e/resources/testng-e2e.xml b/src/e2e/resources/testng-e2e.xml index f928d59c83d..0a7c6206b6e 100644 --- a/src/e2e/resources/testng-e2e.xml +++ b/src/e2e/resources/testng-e2e.xml @@ -9,16 +9,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/src/main/java/teammates/common/datatransfer/CommonAccountSearchResult.java b/src/main/java/teammates/common/datatransfer/CommonAccountSearchResult.java deleted file mode 100644 index 5ab2c8997c5..00000000000 --- a/src/main/java/teammates/common/datatransfer/CommonAccountSearchResult.java +++ /dev/null @@ -1,93 +0,0 @@ -package teammates.common.datatransfer; - -/** - * Represents common details of an account. - * *
Contains: - * *
* account name, email, google id, course name, institution. - * *
* link for join course, home page and manage account. - */ -public class CommonAccountSearchResult { - protected String name; - protected String email; - protected String googleId; - protected String courseId; - protected String courseName; - protected String institute; - - protected String courseJoinLink; - protected String homePageLink; - protected String manageAccountLink; - protected boolean showLinks; - - public void setName(String name) { - this.name = name; - } - - public void setEmail(String email) { - this.email = email; - } - - public void setGoogleId(String googleId) { - this.googleId = googleId; - } - - public void setCourseId(String courseId) { - this.courseId = courseId; - } - - public void setCourseJoinLink(String courseJoinLink) { - this.courseJoinLink = courseJoinLink; - } - - public void setCourseName(String courseName) { - this.courseName = courseName; - } - - public void setHomePageLink(String homePageLink) { - this.homePageLink = homePageLink; - } - - public void setInstitute(String institute) { - this.institute = institute; - } - - public void setManageAccountLink(String manageAccountLink) { - this.manageAccountLink = manageAccountLink; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - public String getGoogleId() { - return googleId; - } - - public String getCourseId() { - return courseId; - } - - public String getCourseName() { - return courseName; - } - - public String getInstitute() { - return institute; - } - - public String getCourseJoinLink() { - return courseJoinLink; - } - - public String getHomePageLink() { - return homePageLink; - } - - public String getManageAccountLink() { - return manageAccountLink; - } -} diff --git a/src/main/java/teammates/common/datatransfer/CourseDetailsBundle.java b/src/main/java/teammates/common/datatransfer/CourseDetailsBundle.java deleted file mode 100644 index ee04940f9f4..00000000000 --- a/src/main/java/teammates/common/datatransfer/CourseDetailsBundle.java +++ /dev/null @@ -1,70 +0,0 @@ -package teammates.common.datatransfer; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.util.SanitizationHelper; - -/** - * Represents details of a course, including its students and feedback sessions. - *
Contains: - *
* statistics of teams, enrollments, registrations - *
* Details of its feedback sessions (as {@link FeedbackSessionDetailsBundle} objects) - *
* Details of its teams (as {@link TeamDetailsBundle} objects) - * - */ -public class CourseDetailsBundle { - public CourseAttributes course; - public CourseStats stats = new CourseStats(); - - public List feedbackSessions = new ArrayList<>(); - public List sections = new ArrayList<>(); - - public CourseDetailsBundle(CourseAttributes courseData) { - this.course = courseData; - //TODO: [CourseAttribute] remove desanitization after data migration - //creating a new course with possibly desanitized name as course name cannot be accessed directly - this.course = CourseAttributes - .builder(courseData.getId()) - .withName(SanitizationHelper.desanitizeIfHtmlSanitized(courseData.getName())) - .withTimezone(courseData.getTimeZone()) - .build(); - this.course.createdAt = courseData.createdAt; - } - - /** - * Gets all FeedbackSessionAttributes in this CourseDetailsBundle. - */ - public List getFeedbackSessionsList() { - List feedbackSessionAttributes = new ArrayList<>(); - for (FeedbackSessionDetailsBundle feedbackSessionDetails : feedbackSessions) { - feedbackSessionAttributes.add(feedbackSessionDetails.feedbackSession); - } - return feedbackSessionAttributes; - } - - /** - * Sorts courses based on course ID. - */ - public static void sortDetailedCoursesByCourseId(List courses) { - courses.sort(Comparator.comparing(obj -> obj.course.getId())); - } - - /** - * Sorts courses based on course creation date in the order of latest to oldest order. - */ - public static void sortDetailedCoursesByCreationDate(List courses) { - courses.sort(Comparator.comparing((CourseDetailsBundle obj) -> obj.course.createdAt).reversed()); - } - - public CourseStats getStats() { - return stats; - } - - public CourseAttributes getCourse() { - return course; - } -} diff --git a/src/main/java/teammates/common/datatransfer/CourseRoster.java b/src/main/java/teammates/common/datatransfer/CourseRoster.java index b5529c55fdd..6e88c9aad6c 100644 --- a/src/main/java/teammates/common/datatransfer/CourseRoster.java +++ b/src/main/java/teammates/common/datatransfer/CourseRoster.java @@ -39,15 +39,6 @@ public Map> getTeamToMembersTable() { return teamToMembersTable; } - /** - * Checks if an instructor is the instructor of a course by providing an email address. - * @param instructorEmail email of the instructor to be checked. - * @return true if the instructor is an instructor of the course - */ - public boolean isInstructorOfCourse(String instructorEmail) { - return instructorListByEmail.containsKey(instructorEmail); - } - public boolean isStudentInCourse(String studentEmail) { return studentListByEmail.containsKey(studentEmail); } @@ -79,25 +70,6 @@ public InstructorAttributes getInstructorForEmail(String email) { return instructorListByEmail.get(email); } - /** - * Returns a map of email mapped to name of instructors and students of the course. - * - * @return Map in which key is email of student/instructor and value is name. - */ - public Map getEmailToNameTableFromRoster() { - Map emailToNameTable = new HashMap<>(); - List instructorList = getInstructors(); - for (InstructorAttributes instructor : instructorList) { - emailToNameTable.put(instructor.email, instructor.name); - } - - List studentList = getStudents(); - for (StudentAttributes student : studentList) { - emailToNameTable.put(student.email, student.name); - } - return emailToNameTable; - } - private void populateStudentListByEmail(List students) { if (students == null) { @@ -183,7 +155,7 @@ public static class ParticipantInfo { private final String teamName; private final String sectionName; - public ParticipantInfo(String name, String lastName, String teamName, String sectionName) { + private ParticipantInfo(String name, String lastName, String teamName, String sectionName) { this.name = name; this.lastName = lastName; this.teamName = teamName; diff --git a/src/main/java/teammates/common/datatransfer/CourseStats.java b/src/main/java/teammates/common/datatransfer/CourseStats.java deleted file mode 100644 index 60f1af2d4e7..00000000000 --- a/src/main/java/teammates/common/datatransfer/CourseStats.java +++ /dev/null @@ -1,31 +0,0 @@ -package teammates.common.datatransfer; - -/** - * Represents the course statistics for a course. - *
Contains: - *
* The total number of teams in the course. - *
* The total number of students in the course. - *
* The total number of unregistered students in the course. - */ -public class CourseStats { - public int sectionsTotal; - public int teamsTotal; - public int studentsTotal; - public int unregisteredTotal; - - public int getSectionsTotal() { - return sectionsTotal; - } - - public int getTeamsTotal() { - return teamsTotal; - } - - public int getStudentsTotal() { - return studentsTotal; - } - - public int getUnregisteredTotal() { - return unregisteredTotal; - } -} diff --git a/src/main/java/teammates/common/datatransfer/CourseSummaryBundle.java b/src/main/java/teammates/common/datatransfer/CourseSummaryBundle.java deleted file mode 100644 index e370eafc08d..00000000000 --- a/src/main/java/teammates/common/datatransfer/CourseSummaryBundle.java +++ /dev/null @@ -1,43 +0,0 @@ -package teammates.common.datatransfer; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; - -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.util.SanitizationHelper; - -public class CourseSummaryBundle { - - public CourseAttributes course; - public List feedbackSessions = new ArrayList<>(); - - public CourseSummaryBundle(CourseAttributes courseData) { - this.course = courseData; - } - - /** - * Sorts courses based on course ID. - */ - public static void sortSummarizedCoursesByCourseId(List courses) { - courses.sort(Comparator.comparing(obj -> obj.course.getId())); - } - - /** - * Sorts courses based on course name. - */ - public static void sortSummarizedCoursesByCourseName(List courses) { - //TODO: [CourseAttribute] remove desanitization after data migration - //desanitization is applied to course name to ensure a well-defined order of the courses by course name - courses.sort(Comparator.comparing(obj -> SanitizationHelper.desanitizeFromHtml(obj.course.getName()))); - } - - /** - * Sorts courses based on course creation date in the order of latest to oldest order. - */ - public static void sortSummarizedCoursesByCreationDate(List courses) { - courses.sort(Comparator.comparing((CourseSummaryBundle obj) -> obj.course.createdAt).reversed()); - } - -} diff --git a/src/main/java/teammates/common/datatransfer/DataBundle.java b/src/main/java/teammates/common/datatransfer/DataBundle.java index 2e200f6a47f..a3bbbad53ad 100644 --- a/src/main/java/teammates/common/datatransfer/DataBundle.java +++ b/src/main/java/teammates/common/datatransfer/DataBundle.java @@ -5,7 +5,6 @@ import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.EntityAttributes; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; @@ -13,7 +12,6 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.datatransfer.attributes.StudentProfileAttributes; -import teammates.storage.entity.BaseEntity; /** * Holds a bundle of *Attributes data transfer objects. @@ -29,28 +27,4 @@ public class DataBundle { public Map feedbackResponses = new LinkedHashMap<>(); public Map feedbackResponseComments = new LinkedHashMap<>(); public Map profiles = new LinkedHashMap<>(); - - /** - * Sanitize each attribute in the dataBundle for saving. - */ - public void sanitizeForSaving() { - sanitizeMapForSaving(accounts); - sanitizeMapForSaving(courses); - sanitizeMapForSaving(instructors); - sanitizeMapForSaving(students); - sanitizeMapForSaving(feedbackSessions); - sanitizeMapForSaving(feedbackQuestions); - sanitizeMapForSaving(feedbackResponses); - sanitizeMapForSaving(feedbackResponseComments); - sanitizeMapForSaving(profiles); - } - - /** - * Sanitize each attribute in the {@code map} for saving. - */ - private > void sanitizeMapForSaving(Map map) { - for (T attribute : map.values()) { - attribute.sanitizeForSaving(); - } - } } diff --git a/src/main/java/teammates/common/datatransfer/FeedbackParticipantType.java b/src/main/java/teammates/common/datatransfer/FeedbackParticipantType.java index cb9747a9567..7dd120e1cf4 100644 --- a/src/main/java/teammates/common/datatransfer/FeedbackParticipantType.java +++ b/src/main/java/teammates/common/datatransfer/FeedbackParticipantType.java @@ -1,67 +1,39 @@ package teammates.common.datatransfer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - public enum FeedbackParticipantType { // booleans represent: isValidGiver?, isValidRecipient? isValidViewer? // Strings represents: option shown in giver select box, option shown in recipient select box, // text displayed during feedback submission respectively. - SELF(true, true, false, "Feedback session creator (i.e., me)", "Giver (Self feedback)", ""), - STUDENTS(true, true, true, "Students in this course", "Other students in the course", "Other students in the course"), + SELF(true, true, false, "Feedback session creator (i.e., me)", "Giver (Self feedback)"), + STUDENTS(true, true, true, "Students in this course", "Other students in the course"), //used to generate options for MCQ & MSQ: - STUDENTS_EXCLUDING_SELF(false, false, false, "Students in this course", "Other students in the course", - "Other students in the course"), - INSTRUCTORS(true, true, true, "Instructors in this course", "Instructors in the course", "Instructors in this course"), - TEAMS(true, true, false, "Teams in this course", "Other teams in the course", ""), - TEAMS_EXCLUDING_SELF(false, false, false, "Teams in this course", "Other teams in the course", ""), - OWN_TEAM(false, true, false, "", "Giver's team", "Your team"), - OWN_TEAM_MEMBERS(false, true, true, "", "Giver's team members", "Your team members"), - OWN_TEAM_MEMBERS_INCLUDING_SELF(false, true, true, "", "Giver's team members and Giver", "Your team members"), - RECEIVER(false, false, true, "", "", "The receiving"), - RECEIVER_TEAM_MEMBERS(false, false, true, "", "", "The recipient's team members"), - NONE(false, true, false, "", "Nobody specific (For general class feedback)", ""), + STUDENTS_EXCLUDING_SELF(false, false, false, "Students in this course", "Other students in the course"), + + INSTRUCTORS(true, true, true, "Instructors in this course", "Instructors in the course"), + TEAMS(true, true, false, "Teams in this course", "Other teams in the course"), + TEAMS_EXCLUDING_SELF(false, false, false, "Teams in this course", "Other teams in the course"), + OWN_TEAM(false, true, false, "", "Giver's team"), + OWN_TEAM_MEMBERS(false, true, true, "", "Giver's team members"), + OWN_TEAM_MEMBERS_INCLUDING_SELF(false, true, true, "", "Giver's team members and Giver"), + RECEIVER(false, false, true, "", ""), + RECEIVER_TEAM_MEMBERS(false, false, true, "", ""), + NONE(false, true, false, "", "Nobody specific (For general class feedback)"), // Used by feedbackResponseComment: - GIVER(false, false, true, "", "", ""); - - public static final List GIVERS; - static { - List giverInitializer = new ArrayList<>(); - for (FeedbackParticipantType participantType : FeedbackParticipantType.values()) { - if (participantType.isValidGiver()) { - giverInitializer.add(participantType); - } - } - GIVERS = Collections.unmodifiableList(giverInitializer); - } - - public static final List RECIPIENTS; - static { - List recipientInitializer = new ArrayList<>(); - for (FeedbackParticipantType participantType : FeedbackParticipantType.values()) { - if (participantType.isValidRecipient()) { - recipientInitializer.add(participantType); - } - } - RECIPIENTS = Collections.unmodifiableList(recipientInitializer); - } + GIVER(false, false, true, "", ""); private final boolean validGiver; private final boolean validRecipient; private final boolean validViewer; private String displayNameGiver; private String displayNameRecipient; - private String displayNameVisibility; FeedbackParticipantType(boolean isGiver, boolean isRecipient, boolean isViewer, - String displayNameGiver, String displayNameRecipient, String displayNameVisibility) { + String displayNameGiver, String displayNameRecipient) { this.validGiver = isGiver; this.validRecipient = isRecipient; this.validViewer = isViewer; this.displayNameGiver = displayNameGiver; this.displayNameRecipient = displayNameRecipient; - this.displayNameVisibility = displayNameVisibility; } public boolean isValidGiver() { @@ -98,16 +70,6 @@ public String toDisplayRecipientName() { return displayNameRecipient; } - /** - * Formats the participant type for display to user in the response visibility section. - * - * @return A user-friendly {@code String} representing this participant directed to users who are - * responding to a feedback. - */ - public String toVisibilityString() { - return displayNameVisibility; - } - /** * Formats the participant type as a singular noun. * @@ -136,35 +98,4 @@ public String toSingularFormString() { } } - /** - * Gets {@code displayNameGiver} property. - */ - public String getDisplayNameGiver() { - return displayNameGiver; - } - - /** - * Gets {@code displayNameRecipient} property. - */ - public String getDisplayNameRecipient() { - return displayNameRecipient; - } - - /** - * Returns A list of {@link FeedbackParticipantType} objects corresponding to the supplied parameter. - */ - public static List getParticipantListFromCommaSeparatedValues( - String commaSeparatedValues) { - List participantList = new ArrayList<>(); - - if (commaSeparatedValues == null || commaSeparatedValues.isEmpty()) { - return participantList; - } - - for (String str : commaSeparatedValues.split(",")) { - participantList.add(FeedbackParticipantType.valueOf(str)); - } - - return participantList; - } } diff --git a/src/main/java/teammates/common/datatransfer/FeedbackSessionDetailsBundle.java b/src/main/java/teammates/common/datatransfer/FeedbackSessionDetailsBundle.java deleted file mode 100644 index 08c751d9cc3..00000000000 --- a/src/main/java/teammates/common/datatransfer/FeedbackSessionDetailsBundle.java +++ /dev/null @@ -1,43 +0,0 @@ -package teammates.common.datatransfer; - -import java.util.Comparator; -import java.util.List; - -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; - -/** - * Represents details of a feedback session - * Contains: - *
* The basic info of the feedback session (as a {@link FeedbackSessionAttributes} object). - *
* Feedback response statistics (as a {@link FeedbackSessionStats} object). - */ -public class FeedbackSessionDetailsBundle { - - public FeedbackSessionStats stats; - public FeedbackSessionAttributes feedbackSession; - - public FeedbackSessionDetailsBundle(FeedbackSessionAttributes feedbackSession) { - this.feedbackSession = feedbackSession; - this.stats = new FeedbackSessionStats(); - } - - /** - * Sorts feedback session based courseID (ascending), then by create time (ascending), deadline - * (ascending), then by start time (ascending), then by feedback session name - * (ascending). The sort by CourseID part is to cater the case when this - * method is called with combined feedback sessions from many courses - */ - public static void sortFeedbackSessionsByCreationTime(List sessions) { - sessions.sort(Comparator.comparing((FeedbackSessionDetailsBundle fsd) -> fsd.feedbackSession.getCourseId()) - .thenComparing(fsd -> fsd.feedbackSession.getCreatedTime()) - .thenComparing(fsd -> fsd.feedbackSession.getEndTime()) - .thenComparing(fsd -> fsd.feedbackSession.getStartTime()) - .thenComparing(fsd -> fsd.feedbackSession.getFeedbackSessionName())); - } - - @Override - public String toString() { - return "course:" + feedbackSession.getCourseId() + ", name:" + feedbackSession.getFeedbackSessionName() - + System.lineSeparator() + "submitted/total: " + stats.submittedTotal + "/" + stats.expectedTotal; - } -} diff --git a/src/main/java/teammates/common/datatransfer/FeedbackSessionQuestionsBundle.java b/src/main/java/teammates/common/datatransfer/FeedbackSessionQuestionsBundle.java deleted file mode 100644 index 218494e910a..00000000000 --- a/src/main/java/teammates/common/datatransfer/FeedbackSessionQuestionsBundle.java +++ /dev/null @@ -1,142 +0,0 @@ -package teammates.common.datatransfer; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; - -public class FeedbackSessionQuestionsBundle { - - public FeedbackSessionAttributes feedbackSession; - public Map> questionResponseBundle; - public Map> recipientList; - public Map> commentsForResponses; - public CourseRoster roster; - - public FeedbackSessionQuestionsBundle(FeedbackSessionAttributes feedbackSession, Map> questionResponseBundle, Map> recipientList, - Map> commentsForResponses, CourseRoster roster) { - - this.feedbackSession = feedbackSession; - this.questionResponseBundle = questionResponseBundle; - this.recipientList = recipientList; - this.commentsForResponses = commentsForResponses; - this.roster = roster; - } - - public Map> getQuestionResponseBundle() { - return questionResponseBundle; - } - - public FeedbackSessionAttributes getFeedbackSession() { - return feedbackSession; - } - - /** - * Gets the list of questions in this bundle, sorted by question number. - * @return A {@code List} of {@code FeedackQuestionAttributes}. - */ - public List getSortedQuestions() { - List sortedQuestions = - new ArrayList<>(this.questionResponseBundle.keySet()); - - sortedQuestions.sort(null); - - return sortedQuestions; - } - - /** - * Gets the question in the data bundle with id == questionId. - * @return a FeedbackQuestionAttribute with the specified questionId - */ - public FeedbackQuestionAttributes getQuestionAttributes(String questionId) { - List questions = - new ArrayList<>(this.questionResponseBundle.keySet()); - - for (FeedbackQuestionAttributes question : questions) { - if (question.getId().equals(questionId)) { - return question; - } - } - - return null; - } - - /** - * Gets the recipient list for a question, sorted by the recipient's name. - * @param feedbackQuestionId of the question - * @return A {@code Map} where {@code key} is the recipient's email - * and {@code value} is the recipients name. - */ - public Map getSortedRecipientList(String feedbackQuestionId) { - - List> sortedList = new ArrayList<>(recipientList.get(feedbackQuestionId).entrySet()); - - sortedList.sort(Comparator.comparing((Map.Entry obj) -> obj.getValue()) - .thenComparing(obj -> obj.getKey())); - - Map result = new LinkedHashMap<>(); - - for (Map.Entry entry : sortedList) { - result.put(entry.getKey(), entry.getValue()); - } - - return result; - } - - public Set getRecipientEmails(String feedbackQuestionId) { - List> emailList = new ArrayList<>(recipientList.get(feedbackQuestionId).entrySet()); - - Set result = new HashSet<>(); - - for (Map.Entry entry : emailList) { - result.add(entry.getKey()); - } - - return result; - } - - /** - * Removes question from the bundle if the question has givers or recipients that are anonymous to the instructor - * or responses that are hidden from the instructor. - */ - public void hideUnmoderatableQuestions() { - List questionsToHide = new ArrayList<>(); - - for (FeedbackQuestionAttributes question : questionResponseBundle.keySet()) { - boolean isGiverVisibleToInstructor = question.showGiverNameTo.contains(FeedbackParticipantType.INSTRUCTORS); - boolean isRecipientVisibleToInstructor = - question.showRecipientNameTo.contains(FeedbackParticipantType.INSTRUCTORS); - boolean isResponseVisibleToInstructor = question.showResponsesTo.contains(FeedbackParticipantType.INSTRUCTORS); - - if (!isResponseVisibleToInstructor || !isGiverVisibleToInstructor || !isRecipientVisibleToInstructor) { - questionsToHide.add(question); - questionResponseBundle.put(question, new ArrayList<>()); - } - } - - questionResponseBundle.keySet().removeAll(questionsToHide); - } - - /** - * Empties responses for all questions in this bundle. - * Used to not show existing responses when previewing as instructor - */ - public void resetAllResponses() { - for (FeedbackQuestionAttributes question : questionResponseBundle.keySet()) { - questionResponseBundle.put(question, new ArrayList<>()); - } - } - - public CourseRoster getRoster() { - return roster; - } -} diff --git a/src/main/java/teammates/common/datatransfer/FeedbackSessionResponseStatus.java b/src/main/java/teammates/common/datatransfer/FeedbackSessionResponseStatus.java deleted file mode 100644 index a74ed66c374..00000000000 --- a/src/main/java/teammates/common/datatransfer/FeedbackSessionResponseStatus.java +++ /dev/null @@ -1,113 +0,0 @@ -package teammates.common.datatransfer; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FeedbackSessionResponseStatus { - public List studentsWhoDidNotRespond; - public List studentsWhoResponded; - public Map emailNameTable; - public Map emailSectionTable; - public Map emailTeamNameTable; - - // Sorts by studentName - private Comparator compareByName = Comparator.comparing(s -> emailNameTable.get(s).toLowerCase()); - - // Sorts by teamName - private Comparator compareByTeamName = (s1, s2) -> { - - // Compare between instructor and student - // Instructor should be at higher order compared to student - String teamName1 = emailTeamNameTable.get(s1); - String teamName2 = emailTeamNameTable.get(s2); - boolean isTeamName1Instructor = teamName1 == null; - boolean isTeamName2Instructor = teamName2 == null; - - if (isTeamName1Instructor && !isTeamName2Instructor) { - // Team 1 has higher sorting order when team 1 belongs instructor and team 2 belongs to student - // -1 represents team 1 is at higher order - return -1; - } else if (!isTeamName1Instructor && isTeamName2Instructor) { - // Team 2 has higher sorting order when team 2 belongs instructor and team 1 belongs to student - // 1 represents team 2 is at higher order - return 1; - } else if (isTeamName1Instructor && isTeamName2Instructor) { - // Both teams belong to instructor - // Therefore team name 1 and 2 are the same, which is indicated by 0 - return compareByName.compare(s1, s2); - } else { - // Both teams belong to student - // Compare on team names - return teamName1.compareToIgnoreCase(teamName2); - } - - }; - - // Sorts by teamName > studentName - private Comparator compareByTeamNameStudentName = compareByTeamName.thenComparing(compareByName); - - public FeedbackSessionResponseStatus() { - studentsWhoDidNotRespond = new ArrayList<>(); - studentsWhoResponded = new ArrayList<>(); - emailNameTable = new HashMap<>(); - emailSectionTable = new HashMap<>(); - emailTeamNameTable = new HashMap<>(); - } - - /** - * Returns list of students who did not respond to the feedback session - * sorted by teamName > studentNamelist. - */ - public List getStudentsWhoDidNotRespondSorted() { - studentsWhoDidNotRespond.sort(compareByTeamNameStudentName); - return studentsWhoDidNotRespond; - } - - /** - * Returns list of all students, sorted by teamName > studentNamelist. - */ - public List getAllStudentsSorted() { - List allStudents = new ArrayList<>(studentsWhoDidNotRespond); - allStudents.addAll(studentsWhoResponded); - allStudents.sort(compareByTeamNameStudentName); - return allStudents; - } - - /** - * Returns list of students who did not respond to the feedback session. - */ - public List getStudentsWhoDidNotRespond() { - return studentsWhoDidNotRespond; - } - - /** - * Returns list of students who responded to the feedback session - * sorted by teamName > studentNamelist. - */ - public List getStudentsWhoRespondedSorted() { - studentsWhoResponded.sort(compareByTeamNameStudentName); - return studentsWhoResponded; - } - - /** - * Returns list of students who responded to the feedback session. - */ - public List getStudentsWhoResponded() { - return studentsWhoResponded; - } - - public Map getEmailNameTable() { - return emailNameTable; - } - - public Map getEmailTeamNameTable() { - return emailTeamNameTable; - } - - public Map getEmailSectionTable() { - return emailSectionTable; - } -} diff --git a/src/main/java/teammates/common/datatransfer/FeedbackSessionStats.java b/src/main/java/teammates/common/datatransfer/FeedbackSessionStats.java deleted file mode 100644 index a099715e943..00000000000 --- a/src/main/java/teammates/common/datatransfer/FeedbackSessionStats.java +++ /dev/null @@ -1,14 +0,0 @@ -package teammates.common.datatransfer; - -import teammates.common.util.Const; - -/** - * Represents submission statistics for the feedback session. - *
Contains: - *
* The total number of students who were expected to submit. - *
* The total number of students who submitted . - */ -public class FeedbackSessionStats { - public int submittedTotal = Const.INT_UNINITIALIZED; - public int expectedTotal = Const.INT_UNINITIALIZED; -} diff --git a/src/main/java/teammates/common/datatransfer/InstructorPrivileges.java b/src/main/java/teammates/common/datatransfer/InstructorPrivileges.java index 126db002bc8..d639510e955 100644 --- a/src/main/java/teammates/common/datatransfer/InstructorPrivileges.java +++ b/src/main/java/teammates/common/datatransfer/InstructorPrivileges.java @@ -125,38 +125,38 @@ public InstructorPrivileges(String instrRole) { } } - public static boolean isPrivilegeNameValid(String privilegeName) { + static boolean isPrivilegeNameValid(String privilegeName) { return COURSE_LEVEL_ONLY_PRIVILEGES.contains(privilegeName) || SECTION_LEVEL_ONLY_PRIVILEGES.contains(privilegeName) || SESSION_LEVEL_ONLY_PRIVILEGES.contains(privilegeName); } - public static boolean isPrivilegeNameValidForSectionLevel(String privilegeName) { + static boolean isPrivilegeNameValidForSectionLevel(String privilegeName) { return SECTION_LEVEL_ONLY_PRIVILEGES.contains(privilegeName) || SESSION_LEVEL_ONLY_PRIVILEGES.contains(privilegeName); } - public static boolean isPrivilegeNameValidForSessionLevel(String privilegeName) { + static boolean isPrivilegeNameValidForSessionLevel(String privilegeName) { return SESSION_LEVEL_ONLY_PRIVILEGES.contains(privilegeName); } - public void setDefaultPrivilegesForCoowner() { + void setDefaultPrivilegesForCoowner() { setDefaultPrivileges(PRIVILEGES_COOWNER); } - public void setDefaultPrivilegesForManager() { + void setDefaultPrivilegesForManager() { setDefaultPrivileges(PRIVILEGES_MANAGER); } - public void setDefaultPrivilegesForObserver() { + void setDefaultPrivilegesForObserver() { setDefaultPrivileges(PRIVILEGES_OBSERVER); } - public void setDefaultPrivilegesForTutor() { + void setDefaultPrivilegesForTutor() { setDefaultPrivileges(PRIVILEGES_TUTOR); } - public void setDefaultPrivilegesForCustom() { + void setDefaultPrivilegesForCustom() { setDefaultPrivileges(PRIVILEGES_CUSTOM); } @@ -164,7 +164,7 @@ private void setDefaultPrivileges(Map defaultPrivileges) { defaultPrivileges.forEach((key, value) -> courseLevel.put(key, value)); } - public Map getOverallPrivilegesForSections() { + private Map getOverallPrivilegesForSections() { Map privileges = new LinkedHashMap<>(); privileges.put(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS, @@ -180,20 +180,6 @@ public Map getOverallPrivilegesForSections() { return privileges; } - public Map getOverallPrivilegesForSessionsInSection(String sectionName) { - Map privileges = new LinkedHashMap<>(); - - privileges.put(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS, - isAllowedInSectionLevel(sectionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - privileges.put(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS, - isAllowedInSectionLevel(sectionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); - privileges.put(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS, - isAllowedInSectionLevel(sectionName, - Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS)); - - return privileges; - } - /** * Sets privilege for the privilege specified by privilegeName. */ @@ -240,34 +226,6 @@ private void updatePrivilegeInSessionLevel(String sectionName, String sessionNam .put(privilegeName, isAllowed); } - public void updatePrivileges(String sectionName, Map privileges) { - updatePrivilegesInSectionLevel(sectionName, privileges); - } - - public void updatePrivileges(String sectionName, String sessionName, Map privileges) { - updatePrivilegesInSessionLevel(sectionName, sessionName, privileges); - } - - private void updatePrivilegesInSectionLevel(String sectionName, Map privileges) { - for (String privilegeName : privileges.keySet()) { - if (!isPrivilegeNameValidForSectionLevel(privilegeName)) { - return; - } - } - sectionLevel.put(sectionName, new LinkedHashMap<>(privileges)); - } - - private void updatePrivilegesInSessionLevel(String sectionName, String sessionName, - Map privileges) { - for (String privilegeName : privileges.keySet()) { - if (!isPrivilegeNameValidForSessionLevel(privilegeName)) { - return; - } - } - verifyExistenceOfsectionName(sectionName); - this.sessionLevel.get(sectionName).put(sessionName, new LinkedHashMap<>(privileges)); - } - private void verifyExistenceOfsectionName(String sectionName) { this.sessionLevel.computeIfAbsent(sectionName, key -> { addSectionWithDefaultPrivileges(sectionName); @@ -275,16 +233,10 @@ private void verifyExistenceOfsectionName(String sectionName) { }); } - public void addSectionWithDefaultPrivileges(String sectionName) { + void addSectionWithDefaultPrivileges(String sectionName) { this.sectionLevel.putIfAbsent(sectionName, getOverallPrivilegesForSections()); } - public void addSessionWithDefaultPrivileges(String sectionName, String sessionName) { - verifyExistenceOfsectionName(sectionName); - this.sessionLevel.get(sectionName) - .putIfAbsent(sessionName, getOverallPrivilegesForSessionsInSection(sectionName)); - } - /** * Returns true if it is allowed for the privilege specified by privilegeName. */ @@ -340,36 +292,12 @@ private boolean hasSamePrivileges(Map defaultPrivileges) { return true; } - public boolean isSectionSpecial(String sectionName) { - return this.sectionLevel.containsKey(sectionName); - } - - public int numberOfSectionsSpecial() { - return this.sectionLevel.keySet().size(); - } - - /** - * Returns true if there are special settings for sectionName. - */ - public boolean isSessionsInSectionSpecial(String sectionName) { - return this.sessionLevel.containsKey(sectionName); - } - - /** - * Returns true if there are special settings for sessionName in sectionName. - */ - public boolean isSessionInSectionSpecial(String sectionName, String sessionName) { - return this.sessionLevel.containsKey(sectionName) - && this.sessionLevel.get(sectionName).containsKey(sessionName); - } - /** * Removes special settings for sectionName. */ public void removeSectionLevelPrivileges(String sectionName) { - if (this.sectionLevel.containsKey(sectionName)) { - this.sectionLevel.remove(sectionName); - } + + this.sectionLevel.remove(sectionName); this.removeSessionsPrivilegesForSection(sectionName); } @@ -377,18 +305,7 @@ public void removeSectionLevelPrivileges(String sectionName) { * Removes special settings for all sessionNames in sectionName. */ public void removeSessionsPrivilegesForSection(String sectionName) { - if (this.sessionLevel.containsKey(sectionName)) { - this.sessionLevel.remove(sectionName); - } - } - - /** - * Removes special settings for sessionName in sectionName. - */ - public void removeSessionPrivileges(String sectionName, String sessionName) { - if (this.sessionLevel.containsKey(sectionName) && this.sessionLevel.get(sectionName).containsKey(sessionName)) { - this.sessionLevel.get(sectionName).remove(sessionName); - } + this.sessionLevel.remove(sectionName); } private boolean isAllowedInCourseLevel(String privilegeName) { diff --git a/src/main/java/teammates/common/datatransfer/SectionDetail.java b/src/main/java/teammates/common/datatransfer/SectionDetail.java deleted file mode 100644 index 61d58dac6e7..00000000000 --- a/src/main/java/teammates/common/datatransfer/SectionDetail.java +++ /dev/null @@ -1,31 +0,0 @@ -package teammates.common.datatransfer; - -/** - * Shows more information for different types of details for each section. - */ -public enum SectionDetail { - EITHER("Show response if either the giver or evaluee is in the selected section"), - GIVER("Show response if the giver is in the selected section"), - EVALUEE("Show response if the evaluee is in the selected section"), - BOTH("Show response only if both are in the selected section"), - NOT_APPLICABLE("This option is not applicable as all sections are selected"); - - private String sectionDetail; - - SectionDetail(String sectionDetail) { - this.sectionDetail = sectionDetail; - } - - public String getSectionDetail() { - return sectionDetail; - } - - public static boolean containsSectionDetail(String selectedSectionDetail) { - for (SectionDetail sectionDetail : SectionDetail.values()) { - if (sectionDetail.name().equals(selectedSectionDetail)) { - return true; - } - } - return false; - } -} diff --git a/src/main/java/teammates/common/datatransfer/SectionDetailsBundle.java b/src/main/java/teammates/common/datatransfer/SectionDetailsBundle.java deleted file mode 100644 index 55480f067ce..00000000000 --- a/src/main/java/teammates/common/datatransfer/SectionDetailsBundle.java +++ /dev/null @@ -1,17 +0,0 @@ -package teammates.common.datatransfer; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represents details of teams in a section. - *
Contains: - *
* The section name . - *
* {@link TeamDetailsBundle} objects for all teams in the section. - */ -public class SectionDetailsBundle { - - public String name; - public List teams = new ArrayList<>(); - -} diff --git a/src/main/java/teammates/common/datatransfer/StudentResultSummary.java b/src/main/java/teammates/common/datatransfer/StudentResultSummary.java deleted file mode 100644 index 61b9c7ea2eb..00000000000 --- a/src/main/java/teammates/common/datatransfer/StudentResultSummary.java +++ /dev/null @@ -1,17 +0,0 @@ -package teammates.common.datatransfer; - -import teammates.common.util.Const; - -/** - * Represents the contribution ratings for the student for a given contribution question. - *
Contains claimed and perceived values to be shown to the student and the instructor. - */ -public class StudentResultSummary { - - /** The normalized 'claimed contribution' value to be shown to the instructor. */ - public int claimedToInstructor = Const.INT_UNINITIALIZED; - - /** The normalized 'perceived contribution' value to be shown to the instructor. */ - public int perceivedToInstructor = Const.INT_UNINITIALIZED; - -} diff --git a/src/main/java/teammates/common/datatransfer/TeamDetailsBundle.java b/src/main/java/teammates/common/datatransfer/TeamDetailsBundle.java deleted file mode 100644 index 3e132d5c70e..00000000000 --- a/src/main/java/teammates/common/datatransfer/TeamDetailsBundle.java +++ /dev/null @@ -1,19 +0,0 @@ -package teammates.common.datatransfer; - -import java.util.ArrayList; -import java.util.List; - -import teammates.common.datatransfer.attributes.StudentAttributes; - -/** - * Represents details of students in a team. - *
Contains: - *
* The team name . - *
* {@link StudentAttributes} objects for all students in the team. - */ -public class TeamDetailsBundle { - - public String name; - public List students = new ArrayList<>(); - -} diff --git a/src/main/java/teammates/common/datatransfer/TeamEvalResult.java b/src/main/java/teammates/common/datatransfer/TeamEvalResult.java index dbd5efffdcf..47dbc945b01 100644 --- a/src/main/java/teammates/common/datatransfer/TeamEvalResult.java +++ b/src/main/java/teammates/common/datatransfer/TeamEvalResult.java @@ -1,7 +1,6 @@ package teammates.common.datatransfer; import java.util.Arrays; -import java.util.List; import teammates.common.util.Assumption; import teammates.common.util.Const; @@ -34,11 +33,6 @@ public class TeamEvalResult { /** the values that were used to calculate normalizedAveragePerceived values. */ public int[][] normalizedPeerContributionRatio; - // List of student email's. - // The index of the student in the list is used as the index for the int arrays. - // The 2d int arrays are of the format [giverIndex][recipientIndex] - public List studentEmails; - public TeamEvalResult(int[][] submissionValues) { /*This is the only method that should be public. However, many of the * other methods are set as public for the ease of testing. @@ -141,7 +135,7 @@ private int[][] calculatePerceivedForStudents(int[][] claimedSanitized, return output; } - public static int[] calculatePerceivedForStudent(int[] claimedSanitizedRow, + static int[] calculatePerceivedForStudent(int[] claimedSanitizedRow, double[] normalizedAveragePerceivedAsDouble) { verify("Unsanitized value received ", isSanitized(claimedSanitizedRow)); @@ -168,7 +162,7 @@ public static int[] calculatePerceivedForStudent(int[] claimedSanitizedRow, normalizedAveragePerceivedAsDouble)); } - public static boolean isSanitized(int[] array) { + static boolean isSanitized(int[] array) { for (int value : array) { if (!isSanitized(value)) { return false; @@ -212,7 +206,7 @@ private static double[] multiplyByFactor(double factor, double[] input) { return output; } - public static double[] purgeValuesCorrespondingToSpecialValuesInFilter( + static double[] purgeValuesCorrespondingToSpecialValuesInFilter( double[] filterArray, double[] valueArray) { double[] returnValue = new double[filterArray.length]; for (int i = 0; i < filterArray.length; i++) { @@ -226,7 +220,7 @@ public static double[] purgeValuesCorrespondingToSpecialValuesInFilter( return returnValue; } - public static double sum(double[] input) { + static double sum(double[] input) { if (input.length == 0) { return 0; } @@ -244,12 +238,11 @@ public static double sum(double[] input) { return sum; } - public static int sum(int[] input) { + private static int sum(int[] input) { return (int) sum(intToDouble(input)); } - // TODO: methods like these private and use reflection to test - public static double[][] removeSelfRatings(double[][] input) { + static double[][] removeSelfRatings(double[][] input) { double[][] output = new double[input.length][input.length]; for (int i = 0; i < input.length; i++) { for (int j = 0; j < input[i].length; j++) { @@ -267,17 +260,12 @@ private static double[][] normalizeValues(double[][] input) { return output; } - // TODO: make this private and use reflection to test - public static double[] normalizeValues(double[] input) { + static double[] normalizeValues(double[] input) { double factor = calculateFactor(input); return multiplyByFactor(factor, input); } - public static double[] normalizeValues(int[] input) { - return normalizeValues(intToDouble(input)); - } - - public static int[][] normalizeValues(int[][] input) { + private static int[][] normalizeValues(int[][] input) { return doubleToInt(normalizeValues(intToDouble(input))); } @@ -315,8 +303,7 @@ private static int[][] doubleToInt(double[][] input) { return Arrays.stream(input).map(value -> doubleToInt(value)).toArray(int[][]::new); } - // TODO: make this private and use reflection to test - public static double[] averageColumns(double[][] input) { + static double[] averageColumns(double[][] input) { double[] output = new double[input.length]; for (int i = 0; i < input.length; i++) { @@ -352,7 +339,7 @@ private static double averageColumn(double[][] arrayOfArrays, int columnIndex) { return average; } - public static String pointsToString(int[][] array) { + static String pointsToString(int[][] array) { return pointsToString(intToDouble(array)).replace(".0", ""); } @@ -360,7 +347,7 @@ private String pointsToString(int[] input) { return replaceMagicNumbers(Arrays.toString(input)) + System.lineSeparator(); } - public static String pointsToString(double[][] array) { + static String pointsToString(double[][] array) { StringBuilder returnValue = new StringBuilder(); boolean isSquareArray = array.length == array[0].length; int teamSize = (array.length - 1) / 3; @@ -383,7 +370,7 @@ public static String pointsToString(double[][] array) { /** * Replaces 999 etc. with NA, NSB, NSU etc. */ - public static String replaceMagicNumbers(String returnValue) { + static String replaceMagicNumbers(String returnValue) { return returnValue.replace(NA + ".0", " NA") .replace(Integer.toString(NA), " NA") .replace(NSB + ".0", "NSB") @@ -395,7 +382,7 @@ public String toString() { return toString(0); } - public String toString(int indent) { + private String toString(int indent) { String indentString = StringHelper.getIndent(indent); String divider = "======================" + System.lineSeparator(); StringBuilder sb = new StringBuilder(200); diff --git a/src/main/java/teammates/common/datatransfer/attributes/AccountAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/AccountAttributes.java index bc0e723d1f4..60fad282a8d 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/AccountAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/AccountAttributes.java @@ -10,7 +10,6 @@ import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; import teammates.common.util.SanitizationHelper; -import teammates.common.util.StringHelper; import teammates.storage.entity.Account; /** @@ -26,7 +25,7 @@ public class AccountAttributes extends EntityAttributes { public String institute; public Instant createdAt; - AccountAttributes(String googleId) { + private AccountAttributes(String googleId) { this.googleId = googleId; } @@ -80,10 +79,6 @@ public String getEmail() { return email; } - public String getTruncatedGoogleId() { - return StringHelper.truncateLongId(googleId); - } - public String getInstitute() { return institute; } @@ -152,10 +147,6 @@ public void sanitizeForSaving() { this.institute = SanitizationHelper.sanitizeTitle(institute); } - public boolean isUserRegistered() { - return googleId != null && !googleId.isEmpty(); - } - /** * Updates with {@link UpdateOptions}. */ @@ -266,10 +257,10 @@ public UpdateOptions build() { */ private abstract static class BasicBuilder> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java index efb6e67723d..a616ad3d698 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/CourseAttributes.java @@ -2,7 +2,6 @@ import java.time.DateTimeException; import java.time.Instant; -import java.time.LocalDateTime; import java.time.ZoneId; import java.util.ArrayList; import java.util.Comparator; @@ -13,7 +12,6 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.Logger; -import teammates.common.util.TimeHelper; import teammates.storage.entity.Course; /** @@ -30,7 +28,7 @@ public class CourseAttributes extends EntityAttributes implements Compar private String id; - CourseAttributes(String courseId) { + private CourseAttributes(String courseId) { this.id = courseId; this.timeZone = Const.DEFAULT_TIME_ZONE; this.createdAt = Instant.now(); @@ -91,45 +89,6 @@ public Instant getDeletedAt() { return deletedAt; } - public String getCreatedAtDateString() { - return TimeHelper.formatDateForInstructorPages(createdAt, timeZone); - } - - public String getCreatedAtDateStamp() { - return TimeHelper.formatDateTimeToIso8601Utc(createdAt); - } - - public String getCreatedAtFullDateTimeString() { - LocalDateTime localDateTime = TimeHelper.convertInstantToLocalDateTime(createdAt, timeZone); - return TimeHelper.formatDateTimeForDisplay(localDateTime); - } - - public String getDeletedAtDateString() { - if (this.deletedAt == null) { - return Const.DELETION_DATE_NOT_APPLICABLE; - } - return TimeHelper.formatDateForInstructorPages(deletedAt, timeZone); - } - - public String getDeletedAtDateStamp() { - if (this.deletedAt == null) { - return Const.DELETION_DATE_NOT_APPLICABLE; - } - return TimeHelper.formatDateTimeToIso8601Utc(deletedAt); - } - - public String getDeletedAtFullDateTimeString() { - if (this.deletedAt == null) { - return Const.DELETION_DATE_NOT_APPLICABLE; - } - LocalDateTime localDateTime = TimeHelper.convertInstantToLocalDateTime(deletedAt, timeZone); - return TimeHelper.formatDateTimeForDisplay(localDateTime); - } - - public void resetDeletedAt() { - this.deletedAt = null; - } - public boolean isCourseDeleted() { return this.deletedAt != null; } @@ -200,11 +159,6 @@ public static void sortById(List courses) { courses.sort(Comparator.comparing(CourseAttributes::getId)); } - public static void sortByCreatedDate(List courses) { - courses.sort(Comparator.comparing((CourseAttributes course) -> course.createdAt).reversed() - .thenComparing(course -> course.getId())); - } - /** * Updates with {@link UpdateOptions}. */ @@ -297,10 +251,10 @@ public UpdateOptions build() { */ private abstract static class BasicBuilder> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/EntityAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/EntityAttributes.java index b022dd252d9..ec98a5a3b22 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/EntityAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/EntityAttributes.java @@ -47,7 +47,7 @@ public boolean isValid() { * @param error An error message, possibly empty. * @param errors A List of errors, to add {@code error} to. */ - public void addNonEmptyError(String error, List errors) { + void addNonEmptyError(String error, List errors) { if (error.isEmpty()) { return; } @@ -104,7 +104,7 @@ public static UpdateOption empty() { * @param consumer block to be executed if a value is present * @throws NullPointerException if value is present and {@code consumer} is null */ - public void ifPresent(Consumer consumer) { + void ifPresent(Consumer consumer) { if (isValuePresent) { consumer.accept(value); } diff --git a/src/main/java/teammates/common/datatransfer/attributes/FeedbackQuestionAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/FeedbackQuestionAttributes.java index 2af39e295f9..a04b0168ae3 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/FeedbackQuestionAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/FeedbackQuestionAttributes.java @@ -31,12 +31,12 @@ public class FeedbackQuestionAttributes extends EntityAttributes showResponsesTo; public List showGiverNameTo; public List showRecipientNameTo; - protected transient Instant createdAt; - protected transient Instant updatedAt; + private transient Instant createdAt; + private transient Instant updatedAt; private String feedbackQuestionId; - FeedbackQuestionAttributes() { + private FeedbackQuestionAttributes() { this.showResponsesTo = new ArrayList<>(); this.showGiverNameTo = new ArrayList<>(); this.showRecipientNameTo = new ArrayList<>(); @@ -610,10 +610,10 @@ public UpdateOptions build() { */ private abstract static class BasicBuilder> { - protected FeedbackQuestionAttributes.UpdateOptions updateOptions; - protected B thisBuilder; + FeedbackQuestionAttributes.UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseAttributes.java index 46b04f1bde7..533a06b38cc 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseAttributes.java @@ -36,12 +36,12 @@ public class FeedbackResponseAttributes extends EntityAttributes> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseCommentAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseCommentAttributes.java index d4e6ce642ab..46c41328c8c 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseCommentAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/FeedbackResponseCommentAttributes.java @@ -43,7 +43,7 @@ public class FeedbackResponseCommentAttributes extends EntityAttributes(); @@ -437,10 +437,10 @@ public UpdateOptions build() { */ private abstract static class BasicBuilder> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributes.java index 3b24e4dbfee..c9e16dae1a0 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributes.java @@ -2,10 +2,8 @@ import java.time.Duration; import java.time.Instant; -import java.time.LocalDateTime; import java.time.ZoneId; import java.util.ArrayList; -import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Objects; @@ -15,41 +13,10 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.SanitizationHelper; -import teammates.common.util.TimeHelper; import teammates.storage.entity.FeedbackSession; public class FeedbackSessionAttributes extends EntityAttributes { - /** - * Comparator to sort SessionAttributes on DESCENDING order based on - * end time, followed by start time and session name. - */ - public static final Comparator DESCENDING_ORDER = (session1, session2) -> { - - Assumption.assertNotNull(session1.getFeedbackSessionName()); - Assumption.assertNotNull(session1.getStartTime()); - Assumption.assertNotNull(session1.getEndTime()); - Assumption.assertNotNull(session2.getFeedbackSessionName()); - Assumption.assertNotNull(session2.getStartTime()); - Assumption.assertNotNull(session2.getEndTime()); - - // Compares end times - int result = session1.getEndTime().isAfter(session2.getEndTime()) ? -1 - : session1.getEndTime().isBefore(session2.getEndTime()) ? 1 : 0; - - // If the end time is same, compares start times - if (result == 0) { - result = session1.getStartTime().isAfter(session2.getStartTime()) ? -1 - : session1.getStartTime().isBefore(session2.getStartTime()) ? 1 : 0; - } - - // If both end and start time is same, compares session name - if (result == 0) { - result = session1.getFeedbackSessionName().compareTo(session2.getFeedbackSessionName()); - } - return result; - }; - private String feedbackSessionName; private String courseId; @@ -73,7 +40,7 @@ public class FeedbackSessionAttributes extends EntityAttributes private transient Set respondingInstructorList; private transient Set respondingStudentList; - FeedbackSessionAttributes(String feedbackSessionName, String courseId) { + private FeedbackSessionAttributes(String feedbackSessionName, String courseId) { this.feedbackSessionName = feedbackSessionName; this.courseId = courseId; @@ -144,22 +111,6 @@ public String getFeedbackSessionName() { return feedbackSessionName; } - public String getStartTimeString() { - return TimeHelper.formatDateTimeForDisplay(startTime, timeZone); - } - - public String getStartTimeInIso8601UtcFormat() { - return TimeHelper.formatDateTimeToIso8601Utc(startTime); - } - - public String getEndTimeString() { - return TimeHelper.formatDateTimeForDisplay(endTime, timeZone); - } - - public String getEndTimeInIso8601UtcFormat() { - return TimeHelper.formatDateTimeToIso8601Utc(endTime); - } - public String getInstructionsString() { if (instructions == null) { return null; @@ -337,14 +288,6 @@ public boolean isPublished() { return now.isAfter(publishTime) || now.equals(publishTime); } - /** - * Returns {@code true} if the session has been set by the creator to be manually published. - */ - public boolean isManuallyPublished() { - return resultsVisibleFromTime.equals(Const.TIME_REPRESENTS_LATER) - || resultsVisibleFromTime.equals(Const.TIME_REPRESENTS_NOW); - } - public boolean isCreator(String instructorEmail) { return creatorEmail.equals(instructorEmail); } @@ -396,35 +339,6 @@ public boolean equals(Object other) { } } - /** - * Sorts feedback session based courseID (ascending), then by create time (ascending), deadline - * (ascending), then by start time (ascending), then by feedback session name - * (ascending). The sort by CourseID part is to cater the case when this - * method is called with combined feedback sessions from many courses - */ - public static void sortFeedbackSessionsByCreationTime(List sessions) { - sessions.sort(Comparator.comparing((FeedbackSessionAttributes session) -> session.courseId) - .thenComparing(session -> session.createdTime) - .thenComparing(session -> session.endTime) - .thenComparing(session -> session.startTime) - .thenComparing(session -> session.feedbackSessionName)); - } - - /** - * Sorts feedback session based on create time (descending), deadline - * (descending), then by start time (descending),then by courseID (ascending),then by feedback session name - * (ascending). The sort by CourseID part is to cater the case when this - * method is called with combined feedback sessions from many courses - */ - public static void sortFeedbackSessionsByCreationTimeDescending(List sessions) { - sessions.sort(Comparator.comparing((FeedbackSessionAttributes session) -> - session.createdTime, Comparator.reverseOrder()) - .thenComparing(session -> session.endTime, Comparator.nullsFirst(Comparator.reverseOrder())) - .thenComparing(session -> session.startTime, Comparator.reverseOrder()) - .thenComparing(session -> session.courseId) - .thenComparing(session -> session.feedbackSessionName)); - } - public void setFeedbackSessionName(String feedbackSessionName) { this.feedbackSessionName = feedbackSessionName; } @@ -449,41 +363,6 @@ public void setInstructions(String instructions) { this.instructions = instructions; } - public String getCreatedTimeDateString() { - return TimeHelper.formatDateForInstructorPages(createdTime, timeZone); - } - - public String getCreatedTimeDateStamp() { - return TimeHelper.formatDateTimeToIso8601Utc(createdTime); - } - - public String getCreatedTimeFullDateTimeString() { - LocalDateTime localDateTime = TimeHelper.convertInstantToLocalDateTime(createdTime, timeZone); - return TimeHelper.formatDateTimeForDisplay(localDateTime); - } - - public String getDeletedTimeDateString() { - if (this.deletedTime == null) { - return Const.DELETION_DATE_NOT_APPLICABLE; - } - return TimeHelper.formatDateForInstructorPages(deletedTime, timeZone); - } - - public String getDeletedTimeDateStamp() { - if (this.deletedTime == null) { - return Const.DELETION_DATE_NOT_APPLICABLE; - } - return TimeHelper.formatDateTimeToIso8601Utc(deletedTime); - } - - public String getDeletedTimeFullDateTimeString() { - if (this.deletedTime == null) { - return Const.DELETION_DATE_NOT_APPLICABLE; - } - LocalDateTime localDateTime = TimeHelper.convertInstantToLocalDateTime(deletedTime, timeZone); - return TimeHelper.formatDateTimeForDisplay(localDateTime); - } - public Instant getCreatedTime() { return createdTime; } @@ -500,10 +379,6 @@ public void setDeletedTime(Instant deletedTime) { this.deletedTime = deletedTime; } - public void resetDeletedTime() { - this.deletedTime = null; - } - public boolean isSessionDeleted() { return this.deletedTime != null; } @@ -512,10 +387,6 @@ public Instant getStartTime() { return startTime; } - public LocalDateTime getStartTimeLocal() { - return TimeHelper.convertInstantToLocalDateTime(startTime, timeZone); - } - public void setStartTime(Instant startTime) { this.startTime = startTime; } @@ -524,10 +395,6 @@ public Instant getEndTime() { return endTime; } - public LocalDateTime getEndTimeLocal() { - return TimeHelper.convertInstantToLocalDateTime(endTime, timeZone); - } - public void setEndTime(Instant endTime) { this.endTime = endTime; } @@ -536,10 +403,6 @@ public Instant getSessionVisibleFromTime() { return sessionVisibleFromTime; } - public LocalDateTime getSessionVisibleFromTimeLocal() { - return TimeHelper.convertInstantToLocalDateTime(sessionVisibleFromTime, timeZone); - } - public void setSessionVisibleFromTime(Instant sessionVisibleFromTime) { this.sessionVisibleFromTime = sessionVisibleFromTime; } @@ -548,10 +411,6 @@ public Instant getResultsVisibleFromTime() { return resultsVisibleFromTime; } - public LocalDateTime getResultsVisibleFromTimeLocal() { - return TimeHelper.convertInstantToLocalDateTime(resultsVisibleFromTime, timeZone); - } - public void setResultsVisibleFromTime(Instant resultsVisibleFromTime) { this.resultsVisibleFromTime = resultsVisibleFromTime; } @@ -915,10 +774,10 @@ public UpdateOptions build() { */ private abstract static class BasicBuilder> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java index 9ed403ece6c..07563dac584 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/InstructorAttributes.java @@ -38,7 +38,7 @@ public class InstructorAttributes extends EntityAttributes { public boolean isDisplayedToStudents; public InstructorPrivileges privileges; - InstructorAttributes(String courseId, String email) { + private InstructorAttributes(String courseId, String email) { this.courseId = courseId; this.email = email; @@ -251,22 +251,6 @@ public boolean hasCoownerPrivileges() { return privileges.hasCoownerPrivileges(); } - public boolean hasManagerPrivileges() { - return privileges.hasManagerPrivileges(); - } - - public boolean hasObserverPrivileges() { - return privileges.hasObserverPrivileges(); - } - - public boolean hasTutorPrivileges() { - return privileges.hasTutorPrivileges(); - } - - public boolean isCustomRole() { - return Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_CUSTOM.equals(role); - } - public String getCourseId() { return courseId; } @@ -481,12 +465,12 @@ public UpdateOptionsWithGoogleId build() { */ private static class UpdateOptions { - protected UpdateOption nameOption = UpdateOption.empty(); - protected UpdateOption isArchivedOption = UpdateOption.empty(); - protected UpdateOption roleOption = UpdateOption.empty(); - protected UpdateOption isDisplayedToStudentsOption = UpdateOption.empty(); - protected UpdateOption displayedNameOption = UpdateOption.empty(); - protected UpdateOption instructorPrivilegesOption = UpdateOption.empty(); + UpdateOption nameOption = UpdateOption.empty(); + UpdateOption isArchivedOption = UpdateOption.empty(); + UpdateOption roleOption = UpdateOption.empty(); + UpdateOption isDisplayedToStudentsOption = UpdateOption.empty(); + UpdateOption displayedNameOption = UpdateOption.empty(); + UpdateOption instructorPrivilegesOption = UpdateOption.empty(); @Override public String toString() { @@ -509,10 +493,10 @@ public String toString() { */ private abstract static class BasicBuilder> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/StudentAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/StudentAttributes.java index e6a5cc3b2a3..272106ac273 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/StudentAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/StudentAttributes.java @@ -30,7 +30,7 @@ public class StudentAttributes extends EntityAttributes { private transient Instant createdAt; private transient Instant updatedAt; - StudentAttributes(String courseId, String email) { + private StudentAttributes(String courseId, String email) { this.course = courseId; this.email = email; @@ -86,16 +86,6 @@ public StudentAttributes getCopy() { return studentAttributes; } - public String toEnrollmentString() { - String enrollmentStringSeparator = "|"; - - return this.section + enrollmentStringSeparator - + this.team + enrollmentStringSeparator - + this.name + enrollmentStringSeparator - + this.email + enrollmentStringSeparator - + this.comments; - } - public boolean isRegistered() { return googleId != null && !googleId.trim().isEmpty(); } @@ -152,15 +142,6 @@ public String getComments() { return comments; } - public boolean isEnrollInfoSameAs(StudentAttributes otherStudent) { - return otherStudent != null && otherStudent.email.equals(this.email) - && otherStudent.course.equals(this.course) - && otherStudent.name.equals(this.name) - && otherStudent.comments.equals(this.comments) - && otherStudent.team.equals(this.team) - && otherStudent.section.equals(this.section); - } - @Override public boolean equals(Object other) { if (other == null) { @@ -219,37 +200,6 @@ public static void sortByTeamName(List students) { .thenComparing(student -> student.name)); } - public static void sortByNameAndThenByEmail(List students) { - students.sort(Comparator.comparing((StudentAttributes student) -> student.name) - .thenComparing(student -> student.email)); - } - - public void updateWithExistingRecord(StudentAttributes originalStudent) { - if (this.email == null) { - this.email = originalStudent.email; - } - - if (this.name == null) { - this.name = originalStudent.name; - } - - if (this.googleId == null) { - this.googleId = originalStudent.googleId; - } - - if (this.team == null) { - this.team = originalStudent.team; - } - - if (this.comments == null) { - this.comments = originalStudent.comments; - } - - if (this.section == null) { - this.section = originalStudent.section; - } - } - @Override public CourseStudent toEntity() { return new CourseStudent(email, name, googleId, comments, course, team, section); @@ -265,15 +215,7 @@ public int hashCode() { @Override public String toString() { - return toString(0); - } - - public String toString(int indent) { - String indentString = StringHelper.getIndent(indent); - StringBuilder sb = new StringBuilder(); - sb.append(indentString + "Student:" + name + "[" + email + "]" + System.lineSeparator()); - - return sb.toString(); + return "Student:" + name + "[" + email + "]"; } @Override @@ -283,13 +225,6 @@ public void sanitizeForSaving() { comments = SanitizationHelper.sanitizeTextField(comments); } - public String getStudentStatus() { - if (isRegistered()) { - return Const.STUDENT_COURSE_STATUS_JOINED; - } - return Const.STUDENT_COURSE_STATUS_YET_TO_JOIN; - } - public Instant getCreatedAt() { return createdAt; } @@ -306,27 +241,6 @@ public void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; } - /** - * Returns true if section value has changed from its original value. - */ - public boolean isSectionChanged(StudentAttributes originalStudentAttribute) { - return this.section != null && !this.section.equals(originalStudentAttribute.section); - } - - /** - * Returns true if team value has changed from its original value. - */ - public boolean isTeamChanged(StudentAttributes originalStudentAttribute) { - return this.team != null && !this.team.equals(originalStudentAttribute.team); - } - - /** - * Returns true if email value has changed from its original value. - */ - public boolean isEmailChanged(StudentAttributes originalStudentAttribute) { - return this.email != null && !this.email.equals(originalStudentAttribute.email); - } - /** * Updates with {@link UpdateOptions}. */ @@ -452,10 +366,10 @@ public UpdateOptions build() { */ private abstract static class BasicBuilder> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/attributes/StudentProfileAttributes.java b/src/main/java/teammates/common/datatransfer/attributes/StudentProfileAttributes.java index 966a0293945..a1e5d0fe517 100644 --- a/src/main/java/teammates/common/datatransfer/attributes/StudentProfileAttributes.java +++ b/src/main/java/teammates/common/datatransfer/attributes/StudentProfileAttributes.java @@ -29,7 +29,7 @@ public class StudentProfileAttributes extends EntityAttributes { public String pictureKey; public Instant modifiedDate; - StudentProfileAttributes(String googleId) { + private StudentProfileAttributes(String googleId) { this.googleId = googleId; this.shortName = ""; this.email = ""; @@ -332,10 +332,10 @@ public UpdateOptions build() { */ private abstract static class BasicBuilder> { - protected UpdateOptions updateOptions; - protected B thisBuilder; + UpdateOptions updateOptions; + B thisBuilder; - protected BasicBuilder(UpdateOptions updateOptions) { + BasicBuilder(UpdateOptions updateOptions) { this.updateOptions = updateOptions; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumQuestionDetails.java index ee9c5d2371e..a4dba518bf4 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumQuestionDetails.java @@ -1,7 +1,9 @@ package teammates.common.datatransfer.questions; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.Const; @@ -33,8 +35,7 @@ public boolean shouldChangesRequireResponseDeletion( FeedbackQuestionDetails newDetails) { FeedbackConstantSumQuestionDetails newConstSumDetails = (FeedbackConstantSumQuestionDetails) newDetails; - if (this.numOfConstSumOptions != newConstSumDetails.numOfConstSumOptions - || !this.constSumOptions.containsAll(newConstSumDetails.constSumOptions) + if (!this.constSumOptions.containsAll(newConstSumDetails.constSumOptions) || !newConstSumDetails.constSumOptions.containsAll(this.constSumOptions)) { return true; } @@ -61,7 +62,7 @@ public boolean shouldChangesRequireResponseDeletion( @Override public List validateQuestionDetails() { List errors = new ArrayList<>(); - if (!distributeToRecipients && numOfConstSumOptions < Const.FeedbackQuestion.CONST_SUM_MIN_NUM_OF_OPTIONS) { + if (!distributeToRecipients && constSumOptions.size() < Const.FeedbackQuestion.CONST_SUM_MIN_NUM_OF_OPTIONS) { errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_NOT_ENOUGH_OPTIONS + Const.FeedbackQuestion.CONST_SUM_MIN_NUM_OF_OPTIONS + "."); } @@ -78,6 +79,120 @@ public List validateQuestionDetails() { return errors; } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors; + + int numOptions = distributeToRecipients ? numRecipients : constSumOptions.size(); + int totalPoints = pointsPerOption ? points * numOptions : points; + + if (distributeToRecipients) { + errors = getErrorsForConstSumRecipients(responses, totalPoints); + } else { + errors = getErrorsForConstSumOptions(responses, totalPoints); + } + + return errors; + } + + private List getErrorsForConstSumOptions(List responses, int totalPoints) { + for (FeedbackResponseDetails response : responses) { + List errors = new ArrayList<>(); + + FeedbackConstantSumResponseDetails details = (FeedbackConstantSumResponseDetails) response; + + if (details.getAnswers().size() != constSumOptions.size()) { + errors.add(Const.FeedbackQuestion.CONST_SUM_ANSWER_OPTIONS_NOT_MATCH); + return errors; + } + + List givenPoints = details.getAnswers(); + errors = getErrors(givenPoints, totalPoints); + + // Return an error if any response is erroneous + if (!errors.isEmpty()) { + return errors; + } + } + return new ArrayList<>(); + } + + private List getErrorsForConstSumRecipients(List responses, int totalPoints) { + List givenPoints = new ArrayList<>(); + + for (FeedbackResponseDetails response : responses) { + FeedbackConstantSumResponseDetails details = (FeedbackConstantSumResponseDetails) response; + + List errors = new ArrayList<>(); + + if (details.getAnswers().size() != 1) { + // Distribute to recipient must have array size one + errors.add(Const.FeedbackQuestion.CONST_SUM_ANSWER_RECIPIENT_NOT_MATCH); + } + + // Return an error if any response is erroneous + if (!errors.isEmpty()) { + return errors; + } + + int givenPoint = details.getAnswers().get(0); + givenPoints.add(givenPoint); + } + + return getErrors(givenPoints, totalPoints); + } + + private List getErrors(List givenPoints, int totalPoints) { + List errors = new ArrayList<>(); + + // Check that all points are >= 0 + int sum = 0; + for (int i : givenPoints) { + if (i < 0) { + errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_NEGATIVE); + return errors; + } + + sum += i; + } + + // Check that points sum up properly + if (sum != totalPoints) { + errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_MISMATCH); + return errors; + } + + // Check that points are given unevenly for all/at least some options as per the question settings + Set answerSet = new HashSet<>(); + if (distributePointsFor.equals( + FeedbackConstantSumDistributePointsType.DISTRIBUTE_SOME_UNEVENLY.getDisplayedOption())) { + boolean hasDifferentPoints = false; + for (int i : givenPoints) { + if (!answerSet.isEmpty() && !answerSet.contains(i)) { + hasDifferentPoints = true; + break; + } + answerSet.add(i); + } + + if (!hasDifferentPoints) { + errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_SOME_UNIQUE); + return errors; + } + } else if (forceUnevenDistribution || distributePointsFor.equals( + FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption())) { + for (int i : givenPoints) { + if (answerSet.contains(i)) { + errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_UNIQUE); + return errors; + } + answerSet.add(i); + } + } + + return errors; + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return false; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumResponseDetails.java index 6c7ced82c03..62a000c63f6 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackConstantSumResponseDetails.java @@ -1,12 +1,6 @@ package teammates.common.datatransfer.questions; -import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.util.Const; public class FeedbackConstantSumResponseDetails extends FeedbackResponseDetails { @@ -22,88 +16,6 @@ public String getAnswerString() { return listString.substring(1, listString.length() - 1); //remove [] } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - FeedbackConstantSumQuestionDetails questionDetails = - (FeedbackConstantSumQuestionDetails) correspondingQuestion.getQuestionDetails(); - - List errors = new ArrayList<>(); - - if (questionDetails.isDistributeToRecipients()) { - if (answers.size() != 1) { - // distribute to recipient must have array size one - errors.add(Const.FeedbackQuestion.CONST_SUM_ANSWER_RECIPIENT_NOT_MATCH); - return errors; - } - - if (answers.get(0) < 0) { - errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_NEGATIVE); - return errors; - } - - // difficult to do cross-responses validation - return errors; - } - - if (answers.size() != questionDetails.getNumOfConstSumOptions()) { - errors.add(Const.FeedbackQuestion.CONST_SUM_ANSWER_OPTIONS_NOT_MATCH); - return errors; - } - - //Check that all points are >= 0 - int sum = 0; - for (int i : answers) { - if (i < 0) { - errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_NEGATIVE); - return errors; - } - - sum += i; - } - - int numOptions = questionDetails.getNumOfConstSumOptions(); - int totalPoints = questionDetails.isPointsPerOption() - ? questionDetails.getPoints() * numOptions : questionDetails.getPoints(); - - //Check that points sum up properly - if (sum != totalPoints) { - errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_MISMATCH); - return errors; - } - - //Check that points are given unevenly for all/at least some options as per the question settings - Set answerSet = new HashSet<>(); - if (questionDetails.getDistributePointsFor().equals( - FeedbackConstantSumDistributePointsType.DISTRIBUTE_SOME_UNEVENLY.getDisplayedOption())) { - boolean hasDifferentPoints = false; - for (int i : answers) { - if (!answerSet.isEmpty() && !answerSet.contains(i)) { - hasDifferentPoints = true; - break; - } - answerSet.add(i); - } - - if (!hasDifferentPoints) { - errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_SOME_UNIQUE); - return errors; - } - } - - if (questionDetails.getDistributePointsFor().equals( - FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption())) { - for (int i : answers) { - if (answerSet.contains(i)) { - errors.add(Const.FeedbackQuestion.CONST_SUM_ERROR_UNIQUE); - return errors; - } - answerSet.add(i); - } - } - - return errors; - } - public List getAnswers() { return answers; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java index 23a5cba5f22..0f6a56d089b 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetails.java @@ -13,7 +13,6 @@ import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.datatransfer.SessionResultsBundle; -import teammates.common.datatransfer.StudentResultSummary; import teammates.common.datatransfer.TeamEvalResult; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; @@ -24,6 +23,9 @@ public class FeedbackContributionQuestionDetails extends FeedbackQuestionDetails { + private static final int SUMMARY_INDEX_CLAIMED = 0; + private static final int SUMMARY_INDEX_PERCEIVED = 1; + private static final Logger log = Logger.getLogger(); private boolean isNotSureAllowed; @@ -48,9 +50,6 @@ public boolean isIndividualResponsesShownToStudents() { public String getQuestionResultStatisticsJson( FeedbackQuestionAttributes question, String studentEmail, SessionResultsBundle bundle) { List responses = bundle.getQuestionResponseMap().get(question.getId()); - if (responses.isEmpty()) { - return ""; - } boolean isStudent = studentEmail != null; @@ -73,30 +72,30 @@ public String getQuestionResultStatisticsJson( Map teamSubmissionArray = getTeamSubmissionArray(teamNames, teamMembersEmail, teamResponses); // Each team's contribution question results. - Map teamResults = getTeamResults(teamNames, teamSubmissionArray, teamMembersEmail); + Map teamResults = getTeamResults(teamNames, teamSubmissionArray); ContributionStatistics output = new ContributionStatistics(); if (isStudent) { String currentUserTeam = bundle.getRoster().getInfoForIdentifier(studentEmail).getTeamName(); TeamEvalResult currentUserTeamResults = teamResults.get(currentUserTeam); if (currentUserTeamResults != null) { - int currentUserIndex = teamMembersEmail.get(currentUserTeam).indexOf(studentEmail); + List teamEmails = teamMembersEmail.get(currentUserTeam); + int currentUserIndex = teamEmails.indexOf(studentEmail); int[] claimedNumbers = currentUserTeamResults.claimed[currentUserIndex]; int[] perceivedNumbers = currentUserTeamResults.denormalizedAveragePerceived[currentUserIndex]; int claimed = 0; int perceived = 0; - List claimedOthers = new ArrayList<>(); + Map claimedOthers = new HashMap<>(); List perceivedOthers = new ArrayList<>(); for (int i = 0; i < claimedNumbers.length; i++) { if (i == currentUserIndex) { claimed = claimedNumbers[i]; } else { - claimedOthers.add(claimedNumbers[i]); + claimedOthers.put(teamEmails.get(i), claimedNumbers[i]); } } - claimedOthers.sort(Comparator.reverseOrder()); for (int i = 0; i < perceivedNumbers.length; i++) { if (i == currentUserIndex) { @@ -108,62 +107,61 @@ public String getQuestionResultStatisticsJson( perceivedOthers.sort(Comparator.reverseOrder()); output.results.put(studentEmail, new ContributionStatisticsEntry(claimed, perceived, - claimedOthers.stream().mapToInt(i -> i).toArray(), + claimedOthers, perceivedOthers.stream().mapToInt(i -> i).toArray())); } } else { - Map studentResults = getStudentResults(teamMembersEmail, teamResults); + Map studentResults = getStudentResults(teamMembersEmail, teamResults); - for (Map.Entry entry : studentResults.entrySet()) { - StudentResultSummary summary = entry.getValue(); + for (Map.Entry entry : studentResults.entrySet()) { + int[] summary = entry.getValue(); String email = entry.getKey(); String team = bundle.getRoster().getStudentForEmail(email).getTeam(); List teamEmails = teamMembersEmail.get(team); TeamEvalResult teamResult = teamResults.get(team); int studentIndex = teamEmails.indexOf(email); + Map claimedOthers = new HashMap<>(); List perceivedOthers = new ArrayList<>(); for (int i = 0; i < teamResult.normalizedPeerContributionRatio.length; i++) { if (i != studentIndex) { + claimedOthers.put(teamEmails.get(i), teamResult.normalizedPeerContributionRatio[studentIndex][i]); perceivedOthers.add(teamResult.normalizedPeerContributionRatio[i][studentIndex]); } } perceivedOthers.sort(Comparator.reverseOrder()); - output.results.put(email, new ContributionStatisticsEntry(summary.claimedToInstructor, - summary.perceivedToInstructor, - new int[] {}, perceivedOthers.stream().mapToInt(i -> i).toArray())); + output.results.put(email, new ContributionStatisticsEntry(summary[SUMMARY_INDEX_CLAIMED], + summary[SUMMARY_INDEX_PERCEIVED], + claimedOthers, perceivedOthers.stream().mapToInt(i -> i).toArray())); } } return JsonUtils.toJson(output); } - private Map getStudentResults( + private Map getStudentResults( Map> teamMembersEmail, Map teamResults) { - Map studentResults = new LinkedHashMap<>(); + Map studentResults = new LinkedHashMap<>(); teamResults.forEach((key, teamResult) -> { List teamEmails = teamMembersEmail.get(key); - int i = 0; - for (String studentEmail : teamEmails) { - StudentResultSummary summary = new StudentResultSummary(); - summary.claimedToInstructor = teamResult.normalizedClaimed[i][i]; - summary.perceivedToInstructor = teamResult.normalizedAveragePerceived[i]; + for (int i = 0; i < teamEmails.size(); i++) { + String studentEmail = teamEmails.get(i); + int[] summary = new int[2]; + summary[SUMMARY_INDEX_CLAIMED] = teamResult.normalizedClaimed[i][i]; + summary[SUMMARY_INDEX_PERCEIVED] = teamResult.normalizedAveragePerceived[i]; studentResults.put(studentEmail, summary); - - i++; } }); return studentResults; } private Map getTeamResults(List teamNames, - Map teamSubmissionArray, Map> teamMembersEmail) { + Map teamSubmissionArray) { Map teamResults = new LinkedHashMap<>(); for (String team : teamNames) { TeamEvalResult teamEvalResult = new TeamEvalResult(teamSubmissionArray.get(team)); - teamEvalResult.studentEmails = teamMembersEmail.get(team); teamResults.put(team, teamEvalResult); } return teamResults; @@ -240,6 +238,32 @@ public List validateQuestionDetails() { return new ArrayList<>(); } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors = new ArrayList<>(); + + for (FeedbackResponseDetails response : responses) { + FeedbackContributionResponseDetails details = (FeedbackContributionResponseDetails) response; + boolean validAnswer = false; + + // Valid answers: 0, 10, 20, .... 190, 200 + boolean isValidRange = details.getAnswer() >= 0 && details.getAnswer() <= 200; + boolean isMultipleOf10 = details.getAnswer() % 10 == 0; + + if (isValidRange && isMultipleOf10) { + validAnswer = true; + } + if (details.getAnswer() == Const.POINTS_NOT_SURE && isNotSureAllowed + || details.getAnswer() == Const.POINTS_NOT_SUBMITTED) { + validAnswer = true; + } + if (!validAnswer) { + errors.add(Const.FeedbackQuestion.CONTRIB_ERROR_INVALID_OPTION); + } + } + return errors; + } + @Override public String validateGiverRecipientVisibility(FeedbackQuestionAttributes feedbackQuestionAttributes) { String errorMsg = ""; @@ -310,10 +334,11 @@ public Map getResults() { public static class ContributionStatisticsEntry { public final int claimed; public final int perceived; - public final int[] claimedOthers; + public final Map claimedOthers; public final int[] perceivedOthers; - public ContributionStatisticsEntry(int claimed, int perceived, int[] claimedOthers, int[] perceivedOthers) { + public ContributionStatisticsEntry(int claimed, int perceived, Map claimedOthers, + int[] perceivedOthers) { this.claimed = claimed; this.perceived = perceived; this.claimedOthers = claimedOthers; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionResponseDetails.java index 1de3b95c1e5..c9326fe90dc 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackContributionResponseDetails.java @@ -1,9 +1,5 @@ package teammates.common.datatransfer.questions; -import java.util.ArrayList; -import java.util.List; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.Const; public class FeedbackContributionResponseDetails extends FeedbackResponseDetails { @@ -23,29 +19,6 @@ public String getAnswerString() { return Integer.toString(answer); } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - List errors = new ArrayList<>(); - boolean validAnswer = false; - - // Valid answers: 0, 10, 20, .... 190, 200 - boolean isValidRange = answer >= 0 && answer <= 200; - boolean isMultipleOf10 = answer % 10 == 0; - boolean isNotSureAllowed = ((FeedbackContributionQuestionDetails) correspondingQuestion - .getQuestionDetails()).isNotSureAllowed(); - - if (isValidRange && isMultipleOf10) { - validAnswer = true; - } - if (answer == Const.POINTS_NOT_SURE && isNotSureAllowed || answer == Const.POINTS_NOT_SUBMITTED) { - validAnswer = true; - } - if (!validAnswer) { - errors.add(Const.FeedbackQuestion.CONTRIB_ERROR_INVALID_OPTION); - } - return errors; - } - public int getAnswer() { return answer; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetails.java index 7894ddf65f9..e8325dc1b09 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetails.java @@ -107,6 +107,27 @@ public List validateQuestionDetails() { return errors; } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors = new ArrayList<>(); + + for (FeedbackResponseDetails response : responses) { + FeedbackMcqResponseDetails details = (FeedbackMcqResponseDetails) response; + + // if other option is not selected and selected answer is not part of Mcq option list trigger this error. + if (!details.isOther() && !mcqChoices.contains(details.getAnswerString())) { + errors.add(details.getAnswerString() + " " + Const.FeedbackQuestion.MCQ_ERROR_INVALID_OPTION); + } + + // if other option is selected but not text is provided trigger this error + if (details.isOther() && "".equals(details.getAnswerString().trim())) { + errors.add(Const.FeedbackQuestion.MCQ_ERROR_OTHER_CONTENT_NOT_PROVIDED); + } + } + + return errors; + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return true; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqResponseDetails.java index d7d876cb8c7..2361457d617 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqResponseDetails.java @@ -1,11 +1,5 @@ package teammates.common.datatransfer.questions; -import java.util.ArrayList; -import java.util.List; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.util.Const; - public class FeedbackMcqResponseDetails extends FeedbackResponseDetails { private String answer; private boolean isOther; @@ -26,25 +20,6 @@ public String getAnswerString() { return answer; } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - List errors = new ArrayList<>(); - List mcqChoices = ((FeedbackMcqQuestionDetails) correspondingQuestion - .getQuestionDetails()).getMcqChoices(); - - // if other option is not selected and selected answer is not part of Mcq option list trigger this error. - if (!isOther && !mcqChoices.contains(getAnswerString())) { - errors.add(getAnswerString() + " " + Const.FeedbackQuestion.MCQ_ERROR_INVALID_OPTION); - } - - // if other option is selected but not text is provided trigger this error - if (isOther && getAnswerString().trim().equals("")) { - errors.add(Const.FeedbackQuestion.MCQ_ERROR_OTHER_CONTENT_NOT_PROVIDED); - } - - return errors; - } - public String getAnswer() { return answer; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java index 885683eef34..33e550ba73c 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java @@ -159,6 +159,75 @@ public List validateQuestionDetails() { return errors; } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors = new ArrayList<>(); + + for (FeedbackResponseDetails response : responses) { + FeedbackMsqResponseDetails details = (FeedbackMsqResponseDetails) response; + + // number of Msq options selected including other option + int totalChoicesSelected = details.getAnswers().size(); + boolean isMaxSelectableEnabled = maxSelectableChoices != Integer.MIN_VALUE; + boolean isMinSelectableEnabled = minSelectableChoices != Integer.MIN_VALUE; + boolean isNoneOfTheAboveOptionEnabled = + details.getAnswers().contains(Const.FeedbackQuestion.MSQ_ANSWER_NONE_OF_THE_ABOVE); + + // if other is not enabled and other is selected as an answer trigger this error + if (details.isOther() && !otherEnabled) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); + } + + // if other is not chosen while other field is not empty trigger this error + if (otherEnabled && !details.isOther() && !details.getOtherFieldContent().isEmpty()) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); + } + + List validChoices = new ArrayList<>(msqChoices); + if (otherEnabled && details.isOther()) { + // other field content becomes a valid choice if other is enabled + validChoices.add(details.getOtherFieldContent()); + } + // if selected answers are not a part of the Msq option list trigger this error + boolean isAnswersPartOfChoices = validChoices.containsAll(details.getAnswers()); + if (!isAnswersPartOfChoices && !isNoneOfTheAboveOptionEnabled) { + errors.add(details.getAnswerString() + " " + Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); + } + + // if other option is selected but no text is provided trigger this error + if (details.isOther() && "".equals(details.getOtherFieldContent().trim())) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_OTHER_CONTENT_NOT_PROVIDED); + } + + // if other option is selected but not in the answer list trigger this error + if (details.isOther() && !details.getAnswers().contains(details.getOtherFieldContent())) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_OTHER_CONTENT_NOT_PROVIDED); + } + + // if total choices selected exceed maximum choices allowed trigger this error + if (isMaxSelectableEnabled && totalChoicesSelected > maxSelectableChoices) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_NUM_SELECTED_MORE_THAN_MAXIMUM + maxSelectableChoices); + } + + if (isMinSelectableEnabled) { + // if total choices selected is less than the minimum required choices + if (totalChoicesSelected < minSelectableChoices) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_NUM_SELECTED_LESS_THAN_MINIMUM + minSelectableChoices); + } + // if minimumSelectableChoices is enabled and None of the Above is selected as an answer trigger this error + if (isNoneOfTheAboveOptionEnabled) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); + } + } else { + // if none of the above is selected AND other options are selected trigger this error + if ((details.getAnswers().size() > 1 || details.isOther()) && isNoneOfTheAboveOptionEnabled) { + errors.add(Const.FeedbackQuestion.MSQ_ERROR_NONE_OF_THE_ABOVE_ANSWER); + } + } + } + return errors; + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return false; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqResponseDetails.java index 429346362a4..90cdfd17375 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqResponseDetails.java @@ -3,8 +3,6 @@ import java.util.ArrayList; import java.util.List; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.util.Const; import teammates.common.util.StringHelper; public class FeedbackMsqResponseDetails extends FeedbackResponseDetails { @@ -24,80 +22,6 @@ public String getAnswerString() { return StringHelper.toString(answers, ", "); } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - List errors = new ArrayList<>(); - FeedbackMsqQuestionDetails msqQuestionDetails = (FeedbackMsqQuestionDetails) correspondingQuestion - .getQuestionDetails(); - List msqChoices = msqQuestionDetails.getMsqChoices(); - int maxSelectableChoices = msqQuestionDetails.getMaxSelectableChoices(); - int minSelectableChoices = msqQuestionDetails.getMinSelectableChoices(); - boolean isOtherEnabled = msqQuestionDetails.isOtherEnabled(); - - // number of Msq options selected including other option - int totalChoicesSelected = answers.size() + (isOther ? 1 : 0); - boolean isMaxSelectableEnabled = maxSelectableChoices != Integer.MIN_VALUE; - boolean isMinSelectableEnabled = minSelectableChoices != Integer.MIN_VALUE; - boolean isNoneOfTheAboveOptionEnabled = answers.contains(Const.FeedbackQuestion.MSQ_ANSWER_NONE_OF_THE_ABOVE); - - // if other is not enabled and other is selected as an answer trigger this error - if (isOther && !isOtherEnabled) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); - } - - // if other is not chosen while other field is not empty trigger this error - if (isOtherEnabled && !isOther && !getOtherFieldContent().isEmpty()) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); - } - - List validChoices = new ArrayList<>(msqChoices); - if (isOtherEnabled && isOther) { - // other field content becomes a valid choice if other is enabled - validChoices.add(getOtherFieldContent()); - } - // if selected answers are not a part of the Msq option list trigger this error - boolean isAnswersPartOfChoices = validChoices.containsAll(answers); - if (!isAnswersPartOfChoices && !isNoneOfTheAboveOptionEnabled) { - errors.add(getAnswerString() + " " + Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); - } - - // if other option is selected but no text is provided trigger this error - if (isOther && getOtherFieldContent().trim().equals("")) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_OTHER_CONTENT_NOT_PROVIDED); - } - - // if other option is selected but not in the answer list trigger this error - if (isOther && !answers.contains(otherFieldContent)) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_OTHER_CONTENT_NOT_PROVIDED); - } - - // if total choices selected exceed maximum choices allowed trigger this error - if (isMaxSelectableEnabled && totalChoicesSelected > maxSelectableChoices) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_NUM_SELECTED_MORE_THAN_MAXIMUM + maxSelectableChoices); - } - - if (isMinSelectableEnabled) { - // if total choices selected is less than the minimum required choices - if (totalChoicesSelected < minSelectableChoices) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_NUM_SELECTED_LESS_THAN_MINIMUM + minSelectableChoices); - } - // if minimumSelectableChoices is enabled and None of the Above is selected as an answer trigger this error - if (isNoneOfTheAboveOptionEnabled) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION); - } - } else { - // if none of the above is selected AND other options are selected trigger this error - if ((answers.size() > 1 || isOther) && isNoneOfTheAboveOptionEnabled) { - errors.add(Const.FeedbackQuestion.MSQ_ERROR_NONE_OF_THE_ABOVE_ANSWER); - } - } - return errors; - } - - public Boolean isOtherOptionAnswer() { - return isOther; - } - public List getAnswers() { return answers; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleQuestionDetails.java index 20026f04575..8cb859307b2 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleQuestionDetails.java @@ -41,6 +41,40 @@ public List validateQuestionDetails() { return errors; } + private static double convertTo5dp(double num) { + return Double.valueOf(String.format("%.5f", num)); + } + + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors = new ArrayList<>(); + + for (FeedbackResponseDetails response : responses) { + FeedbackNumericalScaleResponseDetails details = (FeedbackNumericalScaleResponseDetails) response; + + // out of range + boolean isAnswerOutOfRange = details.getAnswer() < minScale || details.getAnswer() > maxScale; + if (isAnswerOutOfRange) { + errors.add(details.getAnswerString() + Const.FeedbackQuestion.NUMSCALE_ERROR_OUT_OF_RANGE + + "(min=" + minScale + ", max=" + maxScale + ")"); + } + + // when the answer is within range but not one of the possible values + double interval = details.getAnswer() - minScale; + double remainder = convertTo5dp(interval - Math.floor(interval / step) * step); + boolean isAnswerNotAPossibleValueWithinRange = remainder != 0.0 && !isAnswerOutOfRange; + + if (isAnswerNotAPossibleValueWithinRange) { + double nextPossibleValueLessThanCurrent = convertTo5dp(details.getAnswer() - remainder); + double nextPossibleValueGreaterThanCurrent = convertTo5dp(nextPossibleValueLessThanCurrent + step); + errors.add("Please enter a valid value. The two nearest valid values are " + + nextPossibleValueLessThanCurrent + " and " + nextPossibleValueGreaterThanCurrent + "."); + } + } + + return errors; + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return false; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleResponseDetails.java index 02230d638d8..f2a819ff7df 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleResponseDetails.java @@ -1,10 +1,5 @@ package teammates.common.datatransfer.questions; -import java.util.ArrayList; -import java.util.List; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.util.Const; import teammates.common.util.StringHelper; public class FeedbackNumericalScaleResponseDetails extends FeedbackResponseDetails { @@ -20,39 +15,6 @@ public String getAnswerString() { return StringHelper.toDecimalFormatString(answer); } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - - List errors = new ArrayList<>(); - int minScale = ((FeedbackNumericalScaleQuestionDetails) correspondingQuestion - .getQuestionDetails()).getMinScale(); - - int maxScale = ((FeedbackNumericalScaleQuestionDetails) correspondingQuestion - .getQuestionDetails()).getMaxScale(); - - double step = ((FeedbackNumericalScaleQuestionDetails) correspondingQuestion - .getQuestionDetails()).getStep(); - - // out of range - boolean isAnswerOutOfRange = answer < minScale || answer > maxScale; - if (isAnswerOutOfRange) { - errors.add(getAnswerString() + Const.FeedbackQuestion.NUMSCALE_ERROR_OUT_OF_RANGE - + "(min=" + minScale + ", max=" + maxScale + ")"); - } - - // when the answer is within range but not one of the possible values - double remainder = (answer - minScale) % step; - boolean isAnswerNotAPossibleValueWithinRange = remainder != 0.0 && !isAnswerOutOfRange; - - if (isAnswerNotAPossibleValueWithinRange) { - double nextPossibleValueLessThanCurrent = answer - remainder; - double nextPossibleValueGreaterThanCurrent = nextPossibleValueLessThanCurrent + step; - errors.add("Please enter a valid value. The two nearest valid values are " - + nextPossibleValueLessThanCurrent + " and " + nextPossibleValueGreaterThanCurrent + "."); - } - return errors; - } - public double getAnswer() { return answer; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackQuestionDetails.java index d94431839ba..9cf1b22e063 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackQuestionDetails.java @@ -63,6 +63,13 @@ public boolean isIndividualResponsesShownToStudents() { */ public abstract List validateQuestionDetails(); + /** + * Validates the list of response details. + * @return A {@code List} of error messages (to show as status message to user) if any, or an + * empty list if all response details are valid. + */ + public abstract List validateResponsesDetails(List responseDetails, int numRecipients); + /** * Validates if giverType and recipientType are valid for the question type. * Validates visibility options as well. diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsQuestionDetails.java index d46156a6f7c..9070009a080 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsQuestionDetails.java @@ -1,7 +1,9 @@ package teammates.common.datatransfer.questions; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.Const; @@ -83,6 +85,41 @@ public List validateQuestionDetails() { return errors; } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors = new ArrayList<>(); + + boolean isMinOptionsEnabled = minOptionsToBeRanked != Integer.MIN_VALUE; + boolean isMaxOptionsEnabled = maxOptionsToBeRanked != Integer.MIN_VALUE; + + for (FeedbackResponseDetails response : responses) { + FeedbackRankOptionsResponseDetails details = (FeedbackRankOptionsResponseDetails) response; + List filteredAnswers = details.getFilteredSortedAnswerList(); + Set set = new HashSet<>(filteredAnswers); + boolean isAnswerContainsDuplicates = set.size() < filteredAnswers.size(); + + // if duplicate ranks are not allowed but have been assigned trigger this error + if (isAnswerContainsDuplicates && !areDuplicatesAllowed) { + errors.add("Duplicate Ranks are not allowed."); + } + // if number of options ranked is less than the minimum required trigger this error + if (isMinOptionsEnabled && filteredAnswers.size() < minOptionsToBeRanked) { + errors.add("You must rank at least " + minOptionsToBeRanked + " options."); + } + // if number of options ranked is more than the maximum possible trigger this error + if (isMaxOptionsEnabled && filteredAnswers.size() > maxOptionsToBeRanked) { + errors.add("You can rank at most " + maxOptionsToBeRanked + " options."); + } + // if rank assigned is invalid trigger this error + boolean isRankInvalid = filteredAnswers.stream().anyMatch(answer -> answer < 1 || answer > options.size()); + if (isRankInvalid) { + errors.add("Invalid rank assigned."); + } + } + + return errors; + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return false; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsResponseDetails.java index 940b3aabb84..e4ffe232758 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankOptionsResponseDetails.java @@ -1,14 +1,11 @@ package teammates.common.datatransfer.questions; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; -import java.util.Set; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.Const; -public class FeedbackRankOptionsResponseDetails extends FeedbackRankResponseDetails { +public class FeedbackRankOptionsResponseDetails extends FeedbackResponseDetails { private List answers; public FeedbackRankOptionsResponseDetails() { @@ -37,44 +34,6 @@ public String getAnswerString() { return listString.substring(1, listString.length() - 1); //remove [] } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - List errors = new ArrayList<>(); - FeedbackRankQuestionDetails rankQuestionDetails = (FeedbackRankQuestionDetails) correspondingQuestion - .getQuestionDetails(); - boolean areDuplicatesAllowed = rankQuestionDetails.areDuplicatesAllowed(); - int minOptionsToBeRanked = rankQuestionDetails.minOptionsToBeRanked; - int maxOptionsToBeRanked = rankQuestionDetails.maxOptionsToBeRanked; - List options = ((FeedbackRankOptionsQuestionDetails) correspondingQuestion - .getQuestionDetails()).getOptions(); - - boolean isMinOptionsEnabled = minOptionsToBeRanked != Integer.MIN_VALUE; - boolean isMaxOptionsEnabled = maxOptionsToBeRanked != Integer.MIN_VALUE; - - List filteredAnswers = getFilteredSortedAnswerList(); - Set set = new HashSet<>(filteredAnswers); - boolean isAnswerContainsDuplicates = set.size() < filteredAnswers.size(); - - // if duplicate ranks are not allowed but have been assigned trigger this error - if (isAnswerContainsDuplicates && !areDuplicatesAllowed) { - errors.add("Duplicate Ranks are not allowed."); - } - // if number of options ranked is less than the minimum required trigger this error - if (isMinOptionsEnabled && filteredAnswers.size() < minOptionsToBeRanked) { - errors.add("You must rank at least " + minOptionsToBeRanked + " options."); - } - // if number of options ranked is more than the maximum possible trigger this error - if (isMaxOptionsEnabled && filteredAnswers.size() > maxOptionsToBeRanked) { - errors.add("You can rank at most " + maxOptionsToBeRanked + " options."); - } - // if rank assigned is invalid trigger this error - boolean isRankInvalid = filteredAnswers.stream().anyMatch(answer -> answer < 1 || answer > options.size()); - if (isRankInvalid) { - errors.add("Invalid rank assigned."); - } - return errors; - } - public List getAnswers() { return answers; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankQuestionDetails.java index 7c2fb87d02d..23970a5f637 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankQuestionDetails.java @@ -5,7 +5,7 @@ public abstract class FeedbackRankQuestionDetails extends FeedbackQuestionDetail static final transient int NO_VALUE = Integer.MIN_VALUE; protected int minOptionsToBeRanked; protected int maxOptionsToBeRanked; - private boolean areDuplicatesAllowed; + protected boolean areDuplicatesAllowed; FeedbackRankQuestionDetails(FeedbackQuestionType questionType) { super(questionType); diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsQuestionDetails.java index 774e43075dd..1f76d42bab3 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsQuestionDetails.java @@ -1,7 +1,9 @@ package teammates.common.datatransfer.questions; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; @@ -21,6 +23,36 @@ public List validateQuestionDetails() { return new ArrayList<>(); } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors = new ArrayList<>(); + + boolean isMinOptionsEnabled = minOptionsToBeRanked != Integer.MIN_VALUE; + boolean isMaxOptionsEnabled = maxOptionsToBeRanked != Integer.MIN_VALUE; + + Set responseRank = new HashSet<>(); + for (FeedbackResponseDetails response : responses) { + FeedbackRankRecipientsResponseDetails details = (FeedbackRankRecipientsResponseDetails) response; + + if (responseRank.contains(details.getAnswer()) && !areDuplicatesAllowed) { + errors.add("Duplicate rank " + details.getAnswer() + " in question"); + } else if (details.getAnswer() > numRecipients || details.getAnswer() < 1) { + errors.add("Invalid rank " + details.getAnswer() + " in question"); + } + responseRank.add(details.getAnswer()); + } + // if number of options ranked is less than the minimum required trigger this error + if (isMinOptionsEnabled && responses.size() < minOptionsToBeRanked) { + errors.add("You must rank at least " + minOptionsToBeRanked + " options."); + } + // if number of options ranked is more than the maximum possible trigger this error + if (isMaxOptionsEnabled && responses.size() > maxOptionsToBeRanked) { + errors.add("You can rank at most " + maxOptionsToBeRanked + " options."); + } + + return errors; + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return false; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsResponseDetails.java index 6a8e75ef289..506f537b362 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsResponseDetails.java @@ -1,11 +1,6 @@ package teammates.common.datatransfer.questions; -import java.util.ArrayList; -import java.util.List; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; - -public class FeedbackRankRecipientsResponseDetails extends FeedbackRankResponseDetails { +public class FeedbackRankRecipientsResponseDetails extends FeedbackResponseDetails { private int answer; public FeedbackRankRecipientsResponseDetails() { @@ -17,11 +12,6 @@ public String getAnswerString() { return Integer.toString(answer); } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - return new ArrayList<>(); - } - public int getAnswer() { return answer; } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRankResponseDetails.java deleted file mode 100644 index 7ebe59a6b49..00000000000 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRankResponseDetails.java +++ /dev/null @@ -1,7 +0,0 @@ -package teammates.common.datatransfer.questions; - -public abstract class FeedbackRankResponseDetails extends FeedbackResponseDetails { - public FeedbackRankResponseDetails(FeedbackQuestionType questionType) { - super(questionType); - } -} diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackResponseDetails.java index e094db154a2..2fb40bcad16 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackResponseDetails.java @@ -1,8 +1,5 @@ package teammates.common.datatransfer.questions; -import java.util.List; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.Assumption; import teammates.common.util.JsonUtils; @@ -23,11 +20,6 @@ public FeedbackResponseDetails(FeedbackQuestionType questionType) { public abstract String getAnswerString(); - /** - * Validates the response details. - */ - public abstract List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion); - public String getJsonString() { Assumption.assertNotNull(questionType); if (questionType == FeedbackQuestionType.TEXT) { diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetails.java index f89dea48649..58f6a8e669f 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetails.java @@ -123,6 +123,34 @@ public List validateQuestionDetails() { return errors; } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + List errors = new ArrayList<>(); + + for (FeedbackResponseDetails response : responses) { + FeedbackRubricResponseDetails details = (FeedbackRubricResponseDetails) response; + if (details.getAnswer().isEmpty()) { + errors.add(Const.FeedbackQuestion.RUBRIC_EMPTY_ANSWER); + } + + if (details.getAnswer().size() != numOfRubricSubQuestions) { + errors.add(Const.FeedbackQuestion.RUBRIC_INVALID_ANSWER); + } + + if (details.getAnswer().stream().anyMatch(choice -> + choice != Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN + && (choice < 0 || choice >= numOfRubricChoices))) { + errors.add(Const.FeedbackQuestion.RUBRIC_INVALID_ANSWER); + } + + if (details.getAnswer().stream().allMatch(choice -> choice == Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN)) { + errors.add(Const.FeedbackQuestion.RUBRIC_INVALID_ANSWER); + } + } + + return errors; + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return false; diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricResponseDetails.java index 6cc61f8325f..bec4063921b 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackRubricResponseDetails.java @@ -1,11 +1,7 @@ package teammates.common.datatransfer.questions; -import java.util.ArrayList; import java.util.List; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.util.Const; - public class FeedbackRubricResponseDetails extends FeedbackResponseDetails { /** @@ -23,36 +19,8 @@ public String getAnswerString() { return this.answer.toString(); } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - List errors = new ArrayList<>(); - - FeedbackRubricQuestionDetails questionDetails = - (FeedbackRubricQuestionDetails) correspondingQuestion.getQuestionDetails(); - - if (answer.isEmpty()) { - errors.add(Const.FeedbackQuestion.RUBRIC_EMPTY_ANSWER); - } - - if (answer.size() != questionDetails.getNumOfRubricSubQuestions()) { - errors.add(Const.FeedbackQuestion.RUBRIC_INVALID_ANSWER); - } - - if (answer.stream().anyMatch(choice -> - choice != Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN - && (choice < 0 || choice >= questionDetails.getNumOfRubricChoices()))) { - errors.add(Const.FeedbackQuestion.RUBRIC_INVALID_ANSWER); - } - - if (answer.stream().allMatch(choice -> choice == Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN)) { - errors.add(Const.FeedbackQuestion.RUBRIC_INVALID_ANSWER); - } - - return errors; - } - - public int getAnswer(int subQuestionIndex) { - return answer.get(subQuestionIndex); + public List getAnswer() { + return answer; } public void setAnswer(List answer) { diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackTextQuestionDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackTextQuestionDetails.java index 7336b8ecaa6..97b6eb8c403 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackTextQuestionDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackTextQuestionDetails.java @@ -3,21 +3,24 @@ import java.util.ArrayList; import java.util.List; +import javax.annotation.Nullable; + import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.Const; public class FeedbackTextQuestionDetails extends FeedbackQuestionDetails { - private int recommendedLength; + @Nullable + private Integer recommendedLength; public FeedbackTextQuestionDetails() { super(FeedbackQuestionType.TEXT); - recommendedLength = 0; + recommendedLength = null; } public FeedbackTextQuestionDetails(String questionText) { super(FeedbackQuestionType.TEXT, questionText); - recommendedLength = 0; + recommendedLength = null; } @Override @@ -28,12 +31,17 @@ public boolean shouldChangesRequireResponseDeletion(FeedbackQuestionDetails newD @Override public List validateQuestionDetails() { List errors = new ArrayList<>(); - if (recommendedLength < 0) { + if (recommendedLength != null && recommendedLength < 1) { errors.add(Const.FeedbackQuestion.TEXT_ERROR_INVALID_RECOMMENDED_LENGTH); } return errors; } + @Override + public List validateResponsesDetails(List responses, int numRecipients) { + return new ArrayList<>(); + } + @Override public boolean isFeedbackParticipantCommentsOnResponsesAllowed() { return false; @@ -44,11 +52,11 @@ public String validateGiverRecipientVisibility(FeedbackQuestionAttributes feedba return ""; } - public int getRecommendedLength() { + public Integer getRecommendedLength() { return recommendedLength; } - public void setRecommendedLength(int recommendedLength) { + public void setRecommendedLength(Integer recommendedLength) { this.recommendedLength = recommendedLength; } } diff --git a/src/main/java/teammates/common/datatransfer/questions/FeedbackTextResponseDetails.java b/src/main/java/teammates/common/datatransfer/questions/FeedbackTextResponseDetails.java index e439758d3c8..3cb02277c6e 100644 --- a/src/main/java/teammates/common/datatransfer/questions/FeedbackTextResponseDetails.java +++ b/src/main/java/teammates/common/datatransfer/questions/FeedbackTextResponseDetails.java @@ -1,9 +1,5 @@ package teammates.common.datatransfer.questions; -import java.util.ArrayList; -import java.util.List; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.util.SanitizationHelper; public class FeedbackTextResponseDetails extends FeedbackResponseDetails { @@ -26,12 +22,6 @@ public String getAnswerString() { return SanitizationHelper.sanitizeForRichText(answer); } - @Override - public List validateResponseDetails(FeedbackQuestionAttributes correspondingQuestion) { - // no need to do validation - return new ArrayList<>(); - } - public String getAnswer() { return answer; } diff --git a/src/main/java/teammates/common/exception/EntityDoesNotExistException.java b/src/main/java/teammates/common/exception/EntityDoesNotExistException.java index 86e7d7ca256..dbbf70fafa4 100644 --- a/src/main/java/teammates/common/exception/EntityDoesNotExistException.java +++ b/src/main/java/teammates/common/exception/EntityDoesNotExistException.java @@ -10,7 +10,4 @@ public EntityDoesNotExistException(String message) { super(message); } - public EntityDoesNotExistException(Throwable cause) { - super(cause); - } } diff --git a/src/main/java/teammates/common/exception/ExceedingRangeException.java b/src/main/java/teammates/common/exception/ExceedingRangeException.java deleted file mode 100644 index 9d9b5704d7c..00000000000 --- a/src/main/java/teammates/common/exception/ExceedingRangeException.java +++ /dev/null @@ -1,13 +0,0 @@ -package teammates.common.exception; - -/** - * Exception thrown when an operation may result in overloading the performance limit of the system. - */ -@SuppressWarnings("serial") -public class ExceedingRangeException extends Exception { - - public ExceedingRangeException(String message) { - super(message); - } - -} diff --git a/src/main/java/teammates/common/exception/RequestExceedingRangeException.java b/src/main/java/teammates/common/exception/RequestExceedingRangeException.java deleted file mode 100644 index 5ec80a23d40..00000000000 --- a/src/main/java/teammates/common/exception/RequestExceedingRangeException.java +++ /dev/null @@ -1,13 +0,0 @@ -package teammates.common.exception; - -/** - * Runtime exception wrapper for {@link ExceedingRangeException}. - */ -@SuppressWarnings("serial") -public class RequestExceedingRangeException extends RuntimeException { - - public RequestExceedingRangeException(ExceedingRangeException e) { - super(e.getMessage()); - } - -} diff --git a/src/main/java/teammates/common/util/AppUrl.java b/src/main/java/teammates/common/util/AppUrl.java index 604f03bf000..8cf9e6a9302 100644 --- a/src/main/java/teammates/common/util/AppUrl.java +++ b/src/main/java/teammates/common/util/AppUrl.java @@ -38,17 +38,8 @@ public AppUrl withStudentEmail(String email) { return withParam(Const.ParamsNames.STUDENT_EMAIL, email); } - public AppUrl withInstructorId(String instructorId) { - return withParam(Const.ParamsNames.INSTRUCTOR_ID, instructorId); - } - - public AppUrl withQuestionNumber(String questionNumber) { - return withParam(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER, questionNumber); - } - - @Deprecated - public AppUrl withEnableSessionEditDetails(boolean shouldLoadInEditMode) { - return withParam(Const.ParamsNames.FEEDBACK_SESSION_ENABLE_EDIT, Boolean.toString(shouldLoadInEditMode)); + public AppUrl withEntityType(String entityType) { + return withParam(Const.ParamsNames.ENTITY_TYPE, entityType); } } diff --git a/src/main/java/teammates/common/util/Config.java b/src/main/java/teammates/common/util/Config.java index 9d951c730dc..8f0d83a1300 100644 --- a/src/main/java/teammates/common/util/Config.java +++ b/src/main/java/teammates/common/util/Config.java @@ -78,6 +78,9 @@ public final class Config { /** The value of the "app.enable.datastore.backup" in build.properties file. */ public static final boolean ENABLE_DATASTORE_BACKUP; + /** The value of the "app.maintenance" in build.properties file. */ + public static final boolean MAINTENANCE; + static { APP_URL = readAppUrl(); Properties properties = new Properties(); @@ -106,6 +109,7 @@ public final class Config { MAILJET_APIKEY = properties.getProperty("app.mailjet.apikey"); MAILJET_SECRETKEY = properties.getProperty("app.mailjet.secretkey"); ENABLE_DATASTORE_BACKUP = Boolean.parseBoolean(properties.getProperty("app.enable.datastore.backup", "false")); + MAINTENANCE = Boolean.parseBoolean(properties.getProperty("app.maintenance", "false")); } private Config() { @@ -166,7 +170,7 @@ public static AppUrl getFrontEndAppUrl(String relativeUrl) { * The base URL will be the application back-end URL. * {@code relativeUrl} must start with a "/". */ - public static AppUrl getBackEndAppUrl(String relativeUrl) { + private static AppUrl getBackEndAppUrl(String relativeUrl) { return new AppUrl(APP_URL + relativeUrl); } diff --git a/src/main/java/teammates/common/util/Const.java b/src/main/java/teammates/common/util/Const.java index ca20d37c930..8fb5799e104 100644 --- a/src/main/java/teammates/common/util/Const.java +++ b/src/main/java/teammates/common/util/Const.java @@ -23,8 +23,6 @@ public final class Const { * This section holds constants that are defined as constants primarily * because they are repeated in many places. */ - @Deprecated - public static final String HTML_BR_TAG = "
"; public static final String USER_NOBODY_TEXT = "-"; public static final String USER_UNKNOWN_TEXT = "Unknown user"; @@ -292,7 +290,7 @@ public static class FeedbackQuestion { public static final String RUBRIC_INVALID_ANSWER = "The answer for the rubric question is not valid."; // Text Question - public static final String TEXT_ERROR_INVALID_RECOMMENDED_LENGTH = "Recommended length must be 0 or greater"; + public static final String TEXT_ERROR_INVALID_RECOMMENDED_LENGTH = "Recommended length must be 1 or greater"; } public static class FeedbackQuestionTypeNames { @@ -308,14 +306,6 @@ public static class FeedbackQuestionTypeNames { public static final String RUBRIC = "Rubric question"; } - public static class FeedbackSessionResults { - public static final String QUESTION_SORT_TYPE = "question"; - public static final String GRQ_SORT_TYPE = "giver-recipient-question"; - public static final String RGQ_SORT_TYPE = "recipient-giver-question"; - public static final String GQR_SORT_TYPE = "giver-question-recipient"; - public static final String RQG_SORT_TYPE = "recipient-question-giver"; - } - public static class InstructorPermissionRoleNames { public static final String INSTRUCTOR_PERMISSION_ROLE_COOWNER = "Co-owner"; public static final String INSTRUCTOR_PERMISSION_ROLE_MANAGER = "Manager"; @@ -392,8 +382,6 @@ public static class ParamsNames { public static final String FEEDBACK_SESSION_SENDREMINDEREMAIL = "sendreminderemail"; public static final String FEEDBACK_SESSION_INSTRUCTIONS = "instructions"; public static final String FEEDBACK_SESSION_MODERATED_PERSON = "moderatedperson"; - @Deprecated - public static final String FEEDBACK_SESSION_ENABLE_EDIT = "editsessiondetails"; public static final String FEEDBACK_QUESTION_ID = "questionid"; public static final String FEEDBACK_QUESTION_NUMBER = "questionnum"; @@ -522,25 +510,8 @@ public static class ParamsNames { public static final String USER_ID = "user"; public static final String HINT = "hint"; - //Email parameters - public static final String EMAIL_RECEIVER = "user"; - public static final String EMAIL_COURSE = "course"; - public static final String EMAIL_FEEDBACK = "feedback"; - - public static final String EMAIL_CONTENT = "content"; - public static final String EMAIL_SENDER = "sender"; - public static final String EMAIL_SENDERNAME = "sendername"; - public static final String EMAIL_SUBJECT = "subject"; - public static final String EMAIL_REPLY_TO_ADDRESS = "reply"; - public static final String SEND_SUBMISSION_EMAIL = "sendsubmissionemail"; - //Submission parameters for Task Queue - public static final String SUBMISSION_COURSE = "course"; - public static final String SUBMISSION_FEEDBACK = "feedback"; - public static final String SUBMISSION_REMIND_USERLIST = "usersToRemind"; - public static final String SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST = "usersToResendEmail"; - public static final String SEARCH_KEY = "searchkey"; public static final String RESPONDENT_EMAIL = "respondentemail"; @@ -550,6 +521,8 @@ public static class ParamsNames { public static final String SESSION_LINKS_RECOVERY_EMAIL = "sessionlinksrecoveryemail"; public static final String USER_CAPTCHA_RESPONSE = "captcharesponse"; + public static final String EMAIL_TYPE = "emailtype"; + //Parameters for checking persistence of data during Eventual Consistency public static final String CHECK_PERSISTENCE_COURSE = "persistencecourse"; @@ -658,109 +631,115 @@ public static class ResourceURIs { public static final String URI_PREFIX = "/webapi"; public static final String LOGOUT = "/logout"; - public static final String DATABUNDLE = "/databundle"; - public static final String DATABUNDLE_DOCUMENTS = "/databundle/documents"; - public static final String EXCEPTION = "/exception"; - public static final String ERROR_REPORT = "/errorreport"; - public static final String AUTH = "/auth"; - public static final String AUTH_REGKEY = "/auth/regkey"; - public static final String ACCOUNT = "/account"; - public static final String ACCOUNT_RESET = "/account/reset"; - public static final String ACCOUNT_DOWNGRADE = "/account/downgrade"; - public static final String RESPONSE_COMMENT = "/responsecomment"; - public static final String COURSE = "/course"; - public static final String COURSE_ARCHIVE = "/course/archive"; - public static final String BIN_COURSE = "/bin/course"; - public static final String COURSE_SECTIONS = "/course/sections"; - public static final String COURSES = "/courses"; - public static final String INSTRUCTORS = "/instructors"; - public static final String INSTRUCTOR = "/instructor"; - public static final String INSTRUCTOR_PRIVILEGE = "/instructor/privilege"; - public static final String RESULT = "/result"; - public static final String STUDENTS = "/students"; - public static final String STUDENT = "/student"; - public static final String SESSIONS_ONGOING = "/sessions/ongoing"; - public static final String SESSION = "/session"; - public static final String SESSION_PUBLISH = "/session/publish"; - public static final String SESSION_REMIND_SUBMISSION = "/session/remind/submission"; - public static final String SESSION_REMIND_RESULT = "/session/remind/result"; - public static final String SESSION_STATS = "/session/stats"; - public static final String SESSION_SUBMITTED_GIVER_SET = "/session/submitted/giverset"; - public static final String SESSIONS = "/sessions"; - public static final String SEARCH_COMMENTS = "/search/comments"; - public static final String SEARCH_INSTRUCTORS = "/search/instructors"; - public static final String SEARCH_STUDENTS = "/search/students"; - public static final String BIN_SESSION = "/bin/session"; - public static final String QUESTIONS = "/questions"; - public static final String QUESTION = "/question"; - public static final String QUESTION_RECIPIENTS = "/question/recipients"; - public static final String RESPONSE = "/response"; - public static final String RESPONSES = "/responses"; - public static final String HAS_RESPONSES = "/hasResponses"; - public static final String SUBMISSION_CONFIRMATION = "/submission/confirmation"; - public static final String JOIN = "/join"; - public static final String JOIN_REMIND = "/join/remind"; - public static final String TIMEZONE = "/timezone"; - public static final String LOCAL_DATE_TIME = "/localdatetime"; - public static final String SESSION_LINKS_RECOVERY = "/sessionlinksrecovery"; - public static final String NATIONALITIES = "/nationalities"; - - public static final String STUDENT_PROFILE_PICTURE = "/student/profilePic"; - public static final String STUDENT_PROFILE = "/student/profile"; - public static final String STUDENT_COURSE_LINKS_REGENERATION = "/student/courselinks/regeneration"; + public static final String DATABUNDLE = URI_PREFIX + "/databundle"; + public static final String DATABUNDLE_DOCUMENTS = URI_PREFIX + "/databundle/documents"; + public static final String EXCEPTION = URI_PREFIX + "/exception"; + public static final String ERROR_REPORT = URI_PREFIX + "/errorreport"; + public static final String AUTH = URI_PREFIX + "/auth"; + public static final String AUTH_REGKEY = URI_PREFIX + "/auth/regkey"; + public static final String ACCOUNT = URI_PREFIX + "/account"; + public static final String ACCOUNT_RESET = URI_PREFIX + "/account/reset"; + public static final String ACCOUNT_DOWNGRADE = URI_PREFIX + "/account/downgrade"; + public static final String RESPONSE_COMMENT = URI_PREFIX + "/responsecomment"; + public static final String COURSE = URI_PREFIX + "/course"; + public static final String COURSE_ARCHIVE = URI_PREFIX + "/course/archive"; + public static final String BIN_COURSE = URI_PREFIX + "/bin/course"; + public static final String COURSE_SECTIONS = URI_PREFIX + "/course/sections"; + public static final String COURSES = URI_PREFIX + "/courses"; + public static final String INSTRUCTORS = URI_PREFIX + "/instructors"; + public static final String INSTRUCTOR = URI_PREFIX + "/instructor"; + public static final String INSTRUCTOR_PRIVILEGE = URI_PREFIX + "/instructor/privilege"; + public static final String RESULT = URI_PREFIX + "/result"; + public static final String STUDENTS = URI_PREFIX + "/students"; + public static final String STUDENT = URI_PREFIX + "/student"; + public static final String SESSIONS_ONGOING = URI_PREFIX + "/sessions/ongoing"; + public static final String SESSION = URI_PREFIX + "/session"; + public static final String SESSION_PUBLISH = URI_PREFIX + "/session/publish"; + public static final String SESSION_REMIND_SUBMISSION = URI_PREFIX + "/session/remind/submission"; + public static final String SESSION_REMIND_RESULT = URI_PREFIX + "/session/remind/result"; + public static final String SESSION_STATS = URI_PREFIX + "/session/stats"; + public static final String SESSION_SUBMITTED_GIVER_SET = URI_PREFIX + "/session/submitted/giverset"; + public static final String SESSIONS = URI_PREFIX + "/sessions"; + public static final String SEARCH_COMMENTS = URI_PREFIX + "/search/comments"; + public static final String SEARCH_INSTRUCTORS = URI_PREFIX + "/search/instructors"; + public static final String SEARCH_STUDENTS = URI_PREFIX + "/search/students"; + public static final String BIN_SESSION = URI_PREFIX + "/bin/session"; + public static final String QUESTIONS = URI_PREFIX + "/questions"; + public static final String QUESTION = URI_PREFIX + "/question"; + public static final String QUESTION_RECIPIENTS = URI_PREFIX + "/question/recipients"; + public static final String RESPONSES = URI_PREFIX + "/responses"; + public static final String HAS_RESPONSES = URI_PREFIX + "/hasResponses"; + public static final String SUBMISSION_CONFIRMATION = URI_PREFIX + "/submission/confirmation"; + public static final String JOIN = URI_PREFIX + "/join"; + public static final String JOIN_REMIND = URI_PREFIX + "/join/remind"; + public static final String TIMEZONE = URI_PREFIX + "/timezone"; + public static final String LOCAL_DATE_TIME = URI_PREFIX + "/localdatetime"; + public static final String SESSION_LINKS_RECOVERY = URI_PREFIX + "/sessionlinksrecovery"; + public static final String NATIONALITIES = URI_PREFIX + "/nationalities"; + public static final String EMAIL = URI_PREFIX + "/email"; + + public static final String STUDENT_PROFILE_PICTURE = URI_PREFIX + "/student/profilePic"; + public static final String STUDENT_PROFILE = URI_PREFIX + "/student/profile"; + public static final String STUDENT_COURSE_LINKS_REGENERATION = URI_PREFIX + "/student/courselinks/regeneration"; } public static class CronJobURIs { - public static final String AUTOMATED_EXCEPTION_TEST = "/auto/exception"; - public static final String AUTOMATED_LOG_COMPILATION = "/auto/compileLogs"; - public static final String AUTOMATED_DATASTORE_BACKUP = "/auto/datastoreBackup"; - public static final String AUTOMATED_FEEDBACK_OPENING_REMINDERS = "/auto/feedbackSessionOpeningReminders"; - public static final String AUTOMATED_FEEDBACK_CLOSED_REMINDERS = "/auto/feedbackSessionClosedReminders"; - public static final String AUTOMATED_FEEDBACK_CLOSING_REMINDERS = "/auto/feedbackSessionClosingReminders"; - public static final String AUTOMATED_FEEDBACK_PUBLISHED_REMINDERS = "/auto/feedbackSessionPublishedReminders"; + public static final String URI_PREFIX = "/auto"; + + public static final String AUTOMATED_LOG_COMPILATION = URI_PREFIX + "/compileLogs"; + public static final String AUTOMATED_DATASTORE_BACKUP = URI_PREFIX + "/datastoreBackup"; + public static final String AUTOMATED_FEEDBACK_OPENING_REMINDERS = + URI_PREFIX + "/feedbackSessionOpeningReminders"; + public static final String AUTOMATED_FEEDBACK_CLOSED_REMINDERS = + URI_PREFIX + "/feedbackSessionClosedReminders"; + public static final String AUTOMATED_FEEDBACK_CLOSING_REMINDERS = + URI_PREFIX + "/feedbackSessionClosingReminders"; + public static final String AUTOMATED_FEEDBACK_PUBLISHED_REMINDERS = + URI_PREFIX + "/feedbackSessionPublishedReminders"; } /** * Configurations for task queue. */ public static class TaskQueue { + public static final String URI_PREFIX = "/worker"; public static final String FEEDBACK_SESSION_PUBLISHED_EMAIL_QUEUE_NAME = "feedback-session-published-email-queue"; public static final String FEEDBACK_SESSION_PUBLISHED_EMAIL_WORKER_URL = - "/worker/feedbackSessionPublishedEmail"; + URI_PREFIX + "/feedbackSessionPublishedEmail"; public static final String FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_QUEUE_NAME = "feedback-session-resend-published-email-queue"; public static final String FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL = - "/worker/feedbackSessionResendPublishedEmail"; + URI_PREFIX + "/feedbackSessionResendPublishedEmail"; public static final String FEEDBACK_SESSION_REMIND_EMAIL_QUEUE_NAME = "feedback-session-remind-email-queue"; - public static final String FEEDBACK_SESSION_REMIND_EMAIL_WORKER_URL = "/worker/feedbackSessionRemindEmail"; + public static final String FEEDBACK_SESSION_REMIND_EMAIL_WORKER_URL = URI_PREFIX + "/feedbackSessionRemindEmail"; public static final String FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_QUEUE_NAME = "feedback-session-remind-particular-users-email-queue"; public static final String FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_WORKER_URL = - "/worker/feedbackSessionRemindParticularUsersEmail"; + URI_PREFIX + "/feedbackSessionRemindParticularUsersEmail"; public static final String FEEDBACK_SESSION_UNPUBLISHED_EMAIL_QUEUE_NAME = "feedback-session-unpublished-email-queue"; public static final String FEEDBACK_SESSION_UNPUBLISHED_EMAIL_WORKER_URL = - "/worker/feedbackSessionUnpublishedEmail"; + URI_PREFIX + "/feedbackSessionUnpublishedEmail"; public static final String FEEDBACK_SESSION_UPDATE_RESPONDENT_QUEUE_NAME = "feedback-session-update-respondent-queue"; public static final String FEEDBACK_SESSION_UPDATE_RESPONDENT_WORKER_URL = - "/worker/feedbackSessionUpdateRespondent"; + URI_PREFIX + "/feedbackSessionUpdateRespondent"; public static final String INSTRUCTOR_COURSE_JOIN_EMAIL_QUEUE_NAME = "instructor-course-join-email-queue"; - public static final String INSTRUCTOR_COURSE_JOIN_EMAIL_WORKER_URL = "/worker/instructorCourseJoinEmail"; + public static final String INSTRUCTOR_COURSE_JOIN_EMAIL_WORKER_URL = URI_PREFIX + "/instructorCourseJoinEmail"; public static final String SEND_EMAIL_QUEUE_NAME = "send-email-queue"; - public static final String SEND_EMAIL_WORKER_URL = "/worker/sendEmail"; + public static final String SEND_EMAIL_WORKER_URL = URI_PREFIX + "/sendEmail"; public static final String STUDENT_COURSE_JOIN_EMAIL_QUEUE_NAME = "student-course-join-email-queue"; - public static final String STUDENT_COURSE_JOIN_EMAIL_WORKER_URL = "/worker/studentCourseJoinEmail"; + public static final String STUDENT_COURSE_JOIN_EMAIL_WORKER_URL = URI_PREFIX + "/studentCourseJoinEmail"; } diff --git a/src/main/java/teammates/common/util/FieldValidator.java b/src/main/java/teammates/common/util/FieldValidator.java index 6d69c353be3..affb3c18b5d 100644 --- a/src/main/java/teammates/common/util/FieldValidator.java +++ b/src/main/java/teammates/common/util/FieldValidator.java @@ -27,7 +27,6 @@ public final class FieldValidator { public static final int PERSON_NAME_MAX_LENGTH = 100; public static final String NATIONALITY_FIELD_NAME = "nationality"; - public static final int NATIONALITY_MAX_LENGTH = 55; // one more than longest official nationality name public static final String COURSE_NAME_FIELD_NAME = "course name"; public static final int COURSE_NAME_MAX_LENGTH = 64; @@ -48,12 +47,6 @@ public final class FieldValidator { public static final String EMAIL_FIELD_NAME = "email"; public static final int EMAIL_MAX_LENGTH = 254; - public static final String EMAIL_SUBJECT_FIELD_NAME = "email subject"; - public static final int EMAIL_SUBJECT_MAX_LENGTH = 200; - - public static final String EMAIL_CONTENT_FIELD_NAME = "email content"; - public static final String EMAIL_CONTENT_ERROR_MESSAGE = EMAIL_CONTENT_FIELD_NAME + " should not be empty."; - // others public static final String STUDENT_ROLE_COMMENTS_FIELD_NAME = "comments about a student enrolled in a course"; public static final int STUDENT_ROLE_COMMENTS_MAX_LENGTH = 500; @@ -104,8 +97,6 @@ public final class FieldValidator { // ERROR MESSAGES // //////////////////// - // possible reasons for invalidity - public static final String REASON_EMPTY = "is empty"; public static final String REASON_TOO_LONG = "is too long"; public static final String REASON_INCORRECT_FORMAT = "is not in the correct format"; public static final String REASON_CONTAINS_INVALID_CHAR = "contains invalid characters"; @@ -147,15 +138,16 @@ public final class FieldValidator { "The provided ${fieldName} is not acceptable to TEAMMATES as it contains only whitespace " + "or contains extra spaces at the beginning or at the end of the text."; public static final String NON_HTML_FIELD_ERROR_MESSAGE = - SanitizationHelper.sanitizeForHtml("The provided ${fieldName} is not acceptable to TEAMMATES " - + "as it cannot contain the following special html characters" - + " in brackets: (< > \" / ' &)"); + "The provided ${fieldName} is not acceptable to TEAMMATES " + + "as it cannot contain the following special html characters" + + " in brackets: (< > \" / ' &)"; public static final String NON_NULL_FIELD_ERROR_MESSAGE = "The provided ${fieldName} is not acceptable to TEAMMATES as it cannot be empty."; // field-specific error messages public static final String HINT_FOR_CORRECT_EMAIL = - "An email address contains some text followed by one '@' sign followed by some more text. " + "An email address contains some text followed by one '@' sign followed by some more text, and should end " + + "with a top level domain address like .com. " + HINT_FOR_CORRECT_FORMAT_FOR_SIZE_CAPPED_NON_EMPTY_NO_SPACES; public static final String EMAIL_ERROR_MESSAGE = ERROR_INFO + " " + HINT_FOR_CORRECT_EMAIL; @@ -221,52 +213,22 @@ public final class FieldValidator { */ public static final String REGEX_COURSE_ID = "[a-zA-Z0-9_.$-]+"; - /** - * A normal course ID followed by the word '-demo' and then followed any amount of digits. - */ - public static final String REGEX_SAMPLE_COURSE_ID = REGEX_COURSE_ID + "-demo\\d*"; - /** * Local part: *
  • Can only start with letters, digits, hyphen or plus sign; *
  • Special characters allowed are ! # $ % & ' * + - / = ? ^ _ ` { } ~ *
  • Dot can only appear between any 2 characters and cannot appear continuously
    * Domain part: - *
  • Only allow letters, digits, hyphen and dot; Must end with letters + *
  • Only allow letters, digits, hyphen and dot; Must end with letters; Must have TLD */ public static final String REGEX_EMAIL = "^[\\w+-][\\w+!#$%&'*/=?^_`{}~-]*+(\\.[\\w+!#$%&'*/=?^_`{}~-]+)*+" - + "@([A-Za-z0-9-]+\\.)*[A-Za-z]+$"; + + "@([A-Za-z0-9-]+\\.)+[A-Za-z]+$"; /** * Allows English alphabet, numbers, underscore, dot and hyphen. */ public static final String REGEX_GOOGLE_ID_NON_EMAIL = "[a-zA-Z0-9_.-]+"; - /* - * ======================================================================= - * Regex used for checking header column name in enroll lines - */ - public static final List REGEX_COLUMN_SECTION = Collections.unmodifiableList( - Arrays.asList( - new String[] {"sections?", "sect?", "courses?\\s+sec(tion)?s?"})); - public static final List REGEX_COLUMN_TEAM = Collections.unmodifiableList( - Arrays.asList( - new String[] { - "teams?", "groups?", "students?\\s+teams?", "students?\\s+groups?", "courses?\\s+teams?", - })); - public static final List REGEX_COLUMN_NAME = Collections.unmodifiableList( - Arrays.asList( - new String[] {"names?", "students?\\s+names?", "full\\s+names?", "students?\\s+full\\s+names?"})); - public static final List REGEX_COLUMN_EMAIL = Collections.unmodifiableList( - Arrays.asList( - new String[] { - "emails?", "mails?", "e-mails?", "e\\s+mails?", "emails?\\s+address(es)?", - "e-mails?\\s+address(es)?", "contacts?", - })); - public static final List REGEX_COLUMN_COMMENT = Collections.unmodifiableList( - Arrays.asList( - new String[] {"comments?", "notes?"})); - private FieldValidator() { // utility class // Intentional private constructor to prevent instantiation. @@ -276,30 +238,6 @@ private FieldValidator() { // VALIDATION METHODS FOR EXTERNAL USE // ///////////////////////////////////////// - /** - * Checks if {@code emailContent} is not null and not empty. - * @return An explanation of why the {@code emailContent} is not acceptable. - * Returns an empty string if the {@code emailContent} is acceptable. - */ - public static String getInvalidityInfoForEmailContent(String emailContent) { - Assumption.assertNotNull("Non-null value expected", emailContent); - if (emailContent.isEmpty()) { - return EMAIL_CONTENT_ERROR_MESSAGE; - } - return ""; - } - - /** - * Checks if {@code emailSubject} is a non-null non-empty string no longer than the specified length - * {@code EMAIL_SUBJECT_MAX_LENGTH}, and also does not contain any invalid characters (| or %). - * @return An explanation of why the {@code emailSubject} is not acceptable. - * Returns an empty string if the {@code emailSubject} is acceptable. - */ - public static String getInvalidityInfoForEmailSubject(String emailSubject) { - return getValidityInfoForAllowedName( - EMAIL_SUBJECT_FIELD_NAME, EMAIL_SUBJECT_MAX_LENGTH, emailSubject); - } - /** * Checks if {@code email} is not null, not empty, not longer than {@code EMAIL_MAX_LENGTH}, and is a * valid email address according to {@code REGEX_EMAIL}. @@ -309,7 +247,6 @@ public static String getInvalidityInfoForEmailSubject(String emailSubject) { public static String getInvalidityInfoForEmail(String email) { Assumption.assertNotNull("Non-null value expected", email); - String sanitizedValue = SanitizationHelper.sanitizeForHtml(email); if (email.isEmpty()) { return getPopulatedEmptyStringErrorMessage(EMAIL_ERROR_MESSAGE_EMPTY_STRING, EMAIL_FIELD_NAME, @@ -317,10 +254,10 @@ public static String getInvalidityInfoForEmail(String email) { } else if (isUntrimmed(email)) { return WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE.replace("${fieldName}", EMAIL_FIELD_NAME); } else if (email.length() > EMAIL_MAX_LENGTH) { - return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, sanitizedValue, EMAIL_FIELD_NAME, + return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, email, EMAIL_FIELD_NAME, REASON_TOO_LONG, EMAIL_MAX_LENGTH); } else if (!isValidEmailAddress(email)) { - return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, sanitizedValue, EMAIL_FIELD_NAME, + return getPopulatedErrorMessage(EMAIL_ERROR_MESSAGE, email, EMAIL_FIELD_NAME, REASON_INCORRECT_FORMAT, EMAIL_MAX_LENGTH); } return ""; @@ -350,7 +287,6 @@ public static String getInvalidityInfoForGoogleId(String googleId) { Assumption.assertNotNull("Non-null value expected", googleId); Assumption.assertTrue("\"" + googleId + "\"" + "is not expected to be a gmail address.", !googleId.toLowerCase().endsWith("@gmail.com")); - String sanitizedValue = SanitizationHelper.sanitizeForHtml(googleId); boolean isValidFullEmail = isValidEmailAddress(googleId); boolean isValidEmailWithoutDomain = StringHelper.isMatching(googleId, REGEX_GOOGLE_ID_NON_EMAIL); @@ -361,10 +297,10 @@ public static String getInvalidityInfoForGoogleId(String googleId) { } else if (isUntrimmed(googleId)) { return WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE.replace("${fieldName}", GOOGLE_ID_FIELD_NAME); } else if (googleId.length() > GOOGLE_ID_MAX_LENGTH) { - return getPopulatedErrorMessage(GOOGLE_ID_ERROR_MESSAGE, sanitizedValue, GOOGLE_ID_FIELD_NAME, + return getPopulatedErrorMessage(GOOGLE_ID_ERROR_MESSAGE, googleId, GOOGLE_ID_FIELD_NAME, REASON_TOO_LONG, GOOGLE_ID_MAX_LENGTH); } else if (!(isValidFullEmail || isValidEmailWithoutDomain)) { - return getPopulatedErrorMessage(GOOGLE_ID_ERROR_MESSAGE, sanitizedValue, GOOGLE_ID_FIELD_NAME, + return getPopulatedErrorMessage(GOOGLE_ID_ERROR_MESSAGE, googleId, GOOGLE_ID_FIELD_NAME, REASON_INCORRECT_FORMAT, GOOGLE_ID_MAX_LENGTH); } return ""; @@ -388,13 +324,12 @@ public static String getInvalidityInfoForCourseId(String courseId) { return WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE.replace("${fieldName}", COURSE_NAME_FIELD_NAME); } - String sanitizedValue = SanitizationHelper.sanitizeForHtml(courseId); if (courseId.length() > COURSE_ID_MAX_LENGTH) { - return getPopulatedErrorMessage(COURSE_ID_ERROR_MESSAGE, sanitizedValue, COURSE_ID_FIELD_NAME, + return getPopulatedErrorMessage(COURSE_ID_ERROR_MESSAGE, courseId, COURSE_ID_FIELD_NAME, REASON_TOO_LONG, COURSE_ID_MAX_LENGTH); } if (!StringHelper.isMatching(courseId, REGEX_COURSE_ID)) { - return getPopulatedErrorMessage(COURSE_ID_ERROR_MESSAGE, sanitizedValue, COURSE_ID_FIELD_NAME, + return getPopulatedErrorMessage(COURSE_ID_ERROR_MESSAGE, courseId, COURSE_ID_FIELD_NAME, REASON_INCORRECT_FORMAT, COURSE_ID_MAX_LENGTH); } return ""; @@ -475,7 +410,7 @@ public static String getInvalidityInfoForCourseName(String courseName) { public static String getInvalidityInfoForNationality(String nationality) { Assumption.assertNotNull("Non-null value expected", nationality); if (!NationalityHelper.getNationalities().contains(nationality)) { - return String.format(NATIONALITY_ERROR_MESSAGE, SanitizationHelper.sanitizeForHtml(nationality)); + return String.format(NATIONALITY_ERROR_MESSAGE, nationality); } return ""; } @@ -510,9 +445,8 @@ public static String getInvalidityInfoForPersonName(String personName) { public static String getInvalidityInfoForTimeZone(String timeZoneValue) { Assumption.assertNotNull("Non-null value expected", timeZoneValue); if (!ZoneId.getAvailableZoneIds().contains(timeZoneValue)) { - String sanitizedValue = SanitizationHelper.sanitizeForHtml(timeZoneValue); return getPopulatedErrorMessage(TIME_ZONE_ERROR_MESSAGE, - sanitizedValue, TIME_ZONE_FIELD_NAME, REASON_UNAVAILABLE_AS_CHOICE); + timeZoneValue, TIME_ZONE_FIELD_NAME, REASON_UNAVAILABLE_AS_CHOICE); } return ""; } @@ -525,10 +459,9 @@ public static String getInvalidityInfoForTimeZone(String timeZoneValue) { */ public static String getInvalidityInfoForRole(String role) { Assumption.assertNotNull("Non-null value expected", role); - String sanitizedValue = SanitizationHelper.sanitizeForHtml(role); if (!ROLE_ACCEPTED_VALUES.contains(role)) { - return String.format(ROLE_ERROR_MESSAGE, sanitizedValue); + return String.format(ROLE_ERROR_MESSAGE, role); } return ""; } @@ -547,7 +480,7 @@ public static String getInvalidityInfoForRole(String role) { * @return An explanation of why the {@code value} is not acceptable. * Returns an empty string "" if the {@code value} is acceptable. */ - public static String getValidityInfoForAllowedName(String fieldName, int maxLength, String value) { + static String getValidityInfoForAllowedName(String fieldName, int maxLength, String value) { Assumption.assertNotNull("Non-null value expected for " + fieldName, value); @@ -564,25 +497,24 @@ public static String getValidityInfoForAllowedName(String fieldName, int maxLeng if (isUntrimmed(value)) { return WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE.replace("${fieldName}", fieldName); } - String sanitizedValue = SanitizationHelper.sanitizeForHtml(value); if (value.length() > maxLength) { - return getPopulatedErrorMessage(SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, sanitizedValue, + return getPopulatedErrorMessage(SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE, value, fieldName, REASON_TOO_LONG, maxLength); } if (!Character.isLetterOrDigit(value.codePointAt(0))) { boolean hasStartingBrace = value.charAt(0) == '{' && value.contains("}"); if (!hasStartingBrace) { - return getPopulatedErrorMessage(INVALID_NAME_ERROR_MESSAGE, sanitizedValue, + return getPopulatedErrorMessage(INVALID_NAME_ERROR_MESSAGE, value, fieldName, REASON_START_WITH_NON_ALPHANUMERIC_CHAR); } if (!StringHelper.isMatching(value.substring(1), REGEX_NAME)) { - return getPopulatedErrorMessage(INVALID_NAME_ERROR_MESSAGE, sanitizedValue, fieldName, + return getPopulatedErrorMessage(INVALID_NAME_ERROR_MESSAGE, value, fieldName, REASON_CONTAINS_INVALID_CHAR); } return ""; } if (!StringHelper.isMatching(value, REGEX_NAME)) { - return getPopulatedErrorMessage(INVALID_NAME_ERROR_MESSAGE, sanitizedValue, fieldName, + return getPopulatedErrorMessage(INVALID_NAME_ERROR_MESSAGE, value, fieldName, REASON_CONTAINS_INVALID_CHAR); } return ""; @@ -601,15 +533,14 @@ public static String getValidityInfoForAllowedName(String fieldName, int maxLeng * @return An explanation of why the {@code value} is not acceptable. * Returns an empty string "" if the {@code value} is acceptable. */ - public static String getValidityInfoForSizeCappedPossiblyEmptyString(String fieldName, int maxLength, String value) { + static String getValidityInfoForSizeCappedPossiblyEmptyString(String fieldName, int maxLength, String value) { Assumption.assertNotNull("Non-null value expected for " + fieldName, value); if (isUntrimmed(value)) { return WHITESPACE_ONLY_OR_EXTRA_WHITESPACE_ERROR_MESSAGE.replace("${fieldName}", fieldName); } if (value.length() > maxLength) { - String sanitizedValue = SanitizationHelper.sanitizeForHtml(value); - return getPopulatedErrorMessage(SIZE_CAPPED_POSSIBLY_EMPTY_STRING_ERROR_MESSAGE, sanitizedValue, + return getPopulatedErrorMessage(SIZE_CAPPED_POSSIBLY_EMPTY_STRING_ERROR_MESSAGE, value, fieldName, REASON_TOO_LONG, maxLength); } return ""; @@ -764,7 +695,7 @@ public static List getValidityInfoForFeedbackResponseVisibility( return errors; } - public static String getValidityInfoForNonHtmlField(String fieldName, String value) { + static String getValidityInfoForNonHtmlField(String fieldName, String value) { String sanitizedValue = SanitizationHelper.sanitizeForHtml(value); //Fails if sanitized value is not same as value return value.equals(sanitizedValue) ? "" : NON_HTML_FIELD_ERROR_MESSAGE.replace("${fieldName}", fieldName); @@ -774,7 +705,7 @@ public static String getValidityInfoForNonNullField(String fieldName, Object val return value == null ? NON_NULL_FIELD_ERROR_MESSAGE.replace("${fieldName}", fieldName) : ""; } - public static boolean isUntrimmed(String value) { + private static boolean isUntrimmed(String value) { return value.length() != value.trim().length(); } @@ -783,7 +714,7 @@ public static boolean isUntrimmed(String value) { * @param email text input which needs the validation * @return true if it is a valid email address, else false. */ - public static boolean isValidEmailAddress(String email) { + private static boolean isValidEmailAddress(String email) { return StringHelper.isMatching(email, REGEX_EMAIL); } @@ -797,7 +728,7 @@ public static boolean areElementsUnique(Collection elements) { return uniqueElements.size() == elements.size(); } - public static String getPopulatedErrorMessage( + private static String getPopulatedErrorMessage( String messageTemplate, String userInput, String fieldName, String errorReason, int maxLength) { return getPopulatedErrorMessage(messageTemplate, userInput, fieldName, errorReason) .replace("${maxLength}", String.valueOf(maxLength)); diff --git a/src/main/java/teammates/common/util/HttpRequestHelper.java b/src/main/java/teammates/common/util/HttpRequestHelper.java index 4d805d223c2..c4e23d5a6ca 100644 --- a/src/main/java/teammates/common/util/HttpRequestHelper.java +++ b/src/main/java/teammates/common/util/HttpRequestHelper.java @@ -20,15 +20,6 @@ private HttpRequestHelper() { // utility class } - /** - * Returns the first value for the key in the parameter map, or null if key not found. - * - * @param paramMap A parameter map (e.g., the kind found in HttpServletRequests) - */ - public static String getValueFromParamMap(Map paramMap, String key) { - return paramMap.getOrDefault(key, new String[] { null })[0]; - } - /** * Gets the parameters of the given HTTP request as key-value (possibly multi-values) mapping string. */ @@ -59,21 +50,7 @@ private static String getDisplayedJsonInOneLine(Map map) { transformed.put(key, values.length == 1 ? values[0] : values); } }); - return JsonUtils.toJson(transformed).replaceAll("([^,])\r?\n *", "$1") - .replaceAll(",\r?\n *", ", "); - } - - /** - * Returns the URL used for the HTTP request but without the domain, e.g. "/page/studentHome?user=james" - */ - public static String getRequestedUrl(HttpServletRequest req) { - String link = req.getRequestURI(); - String query = req.getQueryString(); - - if (query != null && !query.trim().isEmpty()) { - return link + "?" + query; - } - return link; + return JsonUtils.toCompactJson(transformed); } /** diff --git a/src/main/java/teammates/common/util/JsonUtils.java b/src/main/java/teammates/common/util/JsonUtils.java index c19ceb8770f..bf2db180791 100644 --- a/src/main/java/teammates/common/util/JsonUtils.java +++ b/src/main/java/teammates/common/util/JsonUtils.java @@ -33,34 +33,45 @@ private JsonUtils() { * This creates a Gson object that can handle the Date format we use in the * Json file and also reformat the Json string in pretty-print format. */ - private static Gson getTeammatesGson() { - return new GsonBuilder() - .registerTypeAdapter(Instant.class, new TeammatesInstantAdapter()) - .registerTypeAdapter(ZoneId.class, new TeammatesZoneIdAdapter()) - .registerTypeAdapter(Duration.class, new TeammatesDurationMinutesAdapter()) - .registerTypeAdapter(FeedbackQuestionDetails.class, new TeammatesFeedbackQuestionDetailsAdapter()) - .registerTypeAdapter(FeedbackResponseDetails.class, new TeammatesFeedbackResponseDetailsAdapter()) - .setPrettyPrinting() - .disableHtmlEscaping() - .create(); + private static Gson getGsonInstance(boolean prettyPrint) { + GsonBuilder builder = new GsonBuilder() + .registerTypeAdapter(Instant.class, new InstantAdapter()) + .registerTypeAdapter(ZoneId.class, new ZoneIdAdapter()) + .registerTypeAdapter(Duration.class, new DurationMinutesAdapter()) + .registerTypeAdapter(FeedbackQuestionDetails.class, new FeedbackQuestionDetailsAdapter()) + .registerTypeAdapter(FeedbackResponseDetails.class, new FeedbackResponseDetailsAdapter()) + .disableHtmlEscaping(); + if (prettyPrint) { + builder.setPrettyPrinting(); + } + return builder.create(); } /** - * Serializes the specified object into its equivalent JSON string. + * Serializes and pretty-prints the specified object into its equivalent JSON string. * * @see Gson#toJson(Object, Type) */ public static String toJson(Object src, Type typeOfSrc) { - return getTeammatesGson().toJson(src, typeOfSrc); + return getGsonInstance(true).toJson(src, typeOfSrc); } /** - * Serializes the specified object into its equivalent JSON string. + * Serializes and pretty-prints the specified object into its equivalent JSON string. * * @see Gson#toJson(Object) */ public static String toJson(Object src) { - return getTeammatesGson().toJson(src); + return getGsonInstance(true).toJson(src); + } + + /** + * Serializes the specified object into its equivalent JSON string. + * + * @see Gson#toJson(Object) + */ + public static String toCompactJson(Object src) { + return getGsonInstance(false).toJson(src); } /** @@ -69,20 +80,19 @@ public static String toJson(Object src) { * @see Gson#fromJson(String, Type) */ public static T fromJson(String json, Type typeOfT) { - return getTeammatesGson().fromJson(json, typeOfT); + return getGsonInstance(false).fromJson(json, typeOfT); } /** * Parses the specified JSON string into a {@link JsonElement} object. * - * @see JsonParser#parse(String) + * @see JsonParser#parseString(String) */ public static JsonElement parse(String json) { - JsonParser parser = new JsonParser(); - return parser.parse(json); + return JsonParser.parseString(json); } - private static class TeammatesInstantAdapter implements JsonSerializer, JsonDeserializer { + private static class InstantAdapter implements JsonSerializer, JsonDeserializer { @Override public JsonElement serialize(Instant instant, Type type, JsonSerializationContext context) { @@ -99,7 +109,7 @@ public Instant deserialize(JsonElement element, Type type, JsonDeserializationCo } } - private static class TeammatesZoneIdAdapter implements JsonSerializer, JsonDeserializer { + private static class ZoneIdAdapter implements JsonSerializer, JsonDeserializer { @Override public JsonElement serialize(ZoneId zoneId, Type type, JsonSerializationContext context) { @@ -116,7 +126,7 @@ public ZoneId deserialize(JsonElement element, Type type, JsonDeserializationCon } } - private static class TeammatesDurationMinutesAdapter implements JsonSerializer, JsonDeserializer { + private static class DurationMinutesAdapter implements JsonSerializer, JsonDeserializer { @Override public JsonElement serialize(Duration duration, Type type, JsonSerializationContext context) { @@ -133,7 +143,7 @@ public Duration deserialize(JsonElement element, Type type, JsonDeserializationC } } - private static class TeammatesFeedbackResponseDetailsAdapter implements JsonSerializer, + private static class FeedbackResponseDetailsAdapter implements JsonSerializer, JsonDeserializer { @Override @@ -150,7 +160,7 @@ public FeedbackResponseDetails deserialize(JsonElement json, Type typeOfT, JsonD } - private static class TeammatesFeedbackQuestionDetailsAdapter implements JsonSerializer, + private static class FeedbackQuestionDetailsAdapter implements JsonSerializer, JsonDeserializer { @Override diff --git a/src/main/java/teammates/common/util/RecaptchaVerifier.java b/src/main/java/teammates/common/util/RecaptchaVerifier.java index e0dc37db9eb..545c3b78803 100644 --- a/src/main/java/teammates/common/util/RecaptchaVerifier.java +++ b/src/main/java/teammates/common/util/RecaptchaVerifier.java @@ -59,7 +59,7 @@ public boolean isVerificationSuccessful(String captchaResponse) { } } - protected String getApiResponse(String captchaResponse, String secretKey) throws URISyntaxException, IOException { + String getApiResponse(String captchaResponse, String secretKey) throws URISyntaxException, IOException { URIBuilder urlb = new URIBuilder(VERIFY_URL); urlb.setParameter("secret", secretKey); urlb.setParameter("response", captchaResponse); diff --git a/src/main/java/teammates/common/util/SanitizationHelper.java b/src/main/java/teammates/common/util/SanitizationHelper.java index 71e63b8490e..360d3fb3337 100644 --- a/src/main/java/teammates/common/util/SanitizationHelper.java +++ b/src/main/java/teammates/common/util/SanitizationHelper.java @@ -2,11 +2,6 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; import org.owasp.html.HtmlPolicyBuilder; import org.owasp.html.PolicyFactory; @@ -100,23 +95,6 @@ public static String sanitizeTextField(String rawText) { return StringHelper.trimIfNotNull(rawText); } - /** - * Escape the string for inserting into javascript code. - * This automatically calls {@link #sanitizeForHtml} so make it safe for HTML too. - * - * @return the sanitized string or null (if the parameter was null). - */ - public static String sanitizeForJs(String str) { - if (str == null) { - return null; - } - return SanitizationHelper.sanitizeForHtml( - str.replace("\\", "\\\\") - .replace("\"", "\\\"") - .replace("'", "\\'") - .replace("#", "\\#")); - } - /** * Sanitizes the string with rich-text. * Removes disallowed elements based on defined policy. @@ -146,18 +124,6 @@ public static String sanitizeForHtml(String unsanitizedString) { .replaceAll("&(?!(amp;)|(lt;)|(gt;)|(quot;)|(#x2f;)|(#39;))", "&"); } - /** - * Sanitizes a list of strings for inserting into HTML. - */ - public static List sanitizeForHtml(List unsanitizedStringList) { - if (unsanitizedStringList == null) { - return null; - } - return unsanitizedStringList.stream() - .map(s -> sanitizeForHtml(s)) - .collect(Collectors.toCollection(ArrayList::new)); - } - /** * Recovers a html-sanitized string using {@link #sanitizeForHtml} * to original encoding for appropriate display.
    @@ -166,7 +132,7 @@ public static List sanitizeForHtml(List unsanitizedStringList) { * * @return recovered string */ - public static String desanitizeFromHtml(String sanitizedString) { + static String desanitizeFromHtml(String sanitizedString) { if (sanitizedString == null) { return null; @@ -180,39 +146,12 @@ public static String desanitizeFromHtml(String sanitizedString) { .replace("&", "&"); } - /** - * This recovers a set of html-sanitized string using {@link #sanitizeForHtml} - * to original encoding for appropriate display.
    - * It restores encoding for < > \ / ' &
    - * The method should only be used once on sanitized html - * - * @return recovered string set - */ - public static Set desanitizeFromHtml(Set sanitizedStringSet) { - if (sanitizedStringSet == null) { - return null; - } - return sanitizedStringSet.stream() - .map(s -> desanitizeFromHtml(s)) - .collect(Collectors.toCollection(HashSet::new)); - } - - /** - * Escapes HTML tag safely. This function can be applied multiple times. - */ - public static String sanitizeForHtmlTag(String string) { - if (string == null) { - return null; - } - return string.replace("<", "<").replace(">", ">"); - } - /** * Converts a string to be put in URL (replaces some characters). */ public static String sanitizeForUri(String uri) { try { - return URLEncoder.encode(uri, Const.SystemParams.ENCODING); + return URLEncoder.encode(uri, Const.SystemParams.ENCODING).replaceAll("\\+", "%20"); } catch (UnsupportedEncodingException wontHappen) { log.warning("Unexpected UnsupportedEncodingException in " + "SanitizationHelper.sanitizeForUri(" + uri + ", " + Const.SystemParams.ENCODING + ")"); @@ -220,100 +159,6 @@ public static String sanitizeForUri(String uri) { } } - /** - * Sanitizes the given URL for the parameter {@link Const.ParamsNames#NEXT_URL}. - * The following characters will be sanitized: - *
      - *
    • &, to prevent the parameters of the next URL from being considered as - * part of the original URL
    • - *
    • %2B (encoded +), to prevent Google from decoding it back to +, - * which is used to encode whitespace in some cases
    • - *
    • %23 (encoded #), to prevent Google from decoding it back to #, - * which is used to traverse the HTML document to a certain id
    • - *
    - * - * @return the sanitized url or null (if the parameter was null). - */ - public static String sanitizeForNextUrl(String url) { - if (url == null) { - return null; - } - return url.replace("&", "${amp}").replace("%2B", "${plus}").replace("%23", "${hash}"); - } - - /** - * Recovers the URL from sanitization due to {@link SanitizationHelper#sanitizeForNextUrl}. - * In addition, any un-encoded whitespace (they may be there due to Google's - * behind-the-screen decoding process) will be encoded again to +. - * @return the unsanitized url or null (if the parameter was null). - */ - public static String desanitizeFromNextUrl(String sanitizedUrl) { - if (sanitizedUrl == null) { - return null; - } - return sanitizedUrl.replace("${amp}", "&") - .replace("${plus}", "%2B") - .replace("${hash}", "%23") - .replace(" ", "+"); - } - - /** - * Sanitize the string for searching. - */ - public static String sanitizeForSearch(String str) { - if (str == null) { - return null; - } - return str - //general case for punctuation - .replace("`", " ").replace("!", " ").replace("#", " ").replace("$", " ").replace("%", " ").replace("^", " ") - .replace("&", " ").replace("[", " ").replace("]", " ").replace("{", " ").replace("}", " ").replace("|", " ") - .replace(";", " ").replace("*", " ").replace(".", " ").replace("?", " ").replace("'", " ").replace("/", " ") - //to prevent injection - .replace("=", " ") - .replace(":", " ") - .replace("<", "<") - .replace(">", ">"); - } - - /** - * Convert the string to a safer version for XPath - * For example: - * Will o' The Wisp => concat('Will o' , "'" , ' The Wisp' , '') - * This will result in the same string when read by XPath. - * - *

    This is used when writing the test case for some special characters - * such as ' and " - * - * @return safer version of the text for XPath - */ - public static String sanitizeStringForXPath(String text) { - StringBuilder result = new StringBuilder(); - int startOfChain = 0; - int textLength = text.length(); - boolean isSingleQuotationChain = false; - // currentPos iterates one position beyond text length to include last chain - for (int currentPos = 0; currentPos <= textLength; currentPos++) { - boolean isChainBroken = currentPos >= textLength - || isSingleQuotationChain && text.charAt(currentPos) != '\'' - || !isSingleQuotationChain && text.charAt(currentPos) == '\''; - if (isChainBroken && startOfChain < currentPos) { - // format text.substring(startOfChain, currentPos) and append to result - char wrapper = isSingleQuotationChain ? '\"' : '\''; - result.append(wrapper).append(text.substring(startOfChain, currentPos)).append(wrapper).append(','); - startOfChain = currentPos; - } - // flip isSingleQuotationChain if chain is broken - if (isChainBroken) { - isSingleQuotationChain = !isSingleQuotationChain; - } - } - if (result.length() == 0) { - return "''"; - } - return "concat(" + result.toString() + "'')"; - } - /** * Returns true if the {@code string} has evidence of having been sanitized. * A string is considered sanitized if it does not contain any of the chars '<', '>', '/', '\"', '\'', diff --git a/src/main/java/teammates/common/util/StringHelper.java b/src/main/java/teammates/common/util/StringHelper.java index 77911c22bba..08d9006d8b6 100644 --- a/src/main/java/teammates/common/util/StringHelper.java +++ b/src/main/java/teammates/common/util/StringHelper.java @@ -5,7 +5,6 @@ import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -43,18 +42,11 @@ public static boolean isEmpty(String s) { /** * Generates a string which consists of {@code length} copies of {@code character} without space. */ - public static String generateStringOfLength(int length, char character) { + static String generateStringOfLength(int length, char character) { Assumption.assertTrue(length >= 0); return String.join("", Collections.nCopies(length, String.valueOf(character))); } - /** - * Returns true if the given string is empty or consists of only whitespace. - */ - public static boolean isWhiteSpace(String string) { - return string.trim().isEmpty(); - } - /** * Checks whether the input string matches the regex. * @param input The string to be matched @@ -73,20 +65,6 @@ public static String getIndent(int length) { return generateStringOfLength(length, ' '); } - /** - * Checks whether the {@code inputString} is longer than a specified length - * if so returns the truncated name appended by ellipsis, - * otherwise returns the original input.
    - * E.g., "12345678" truncated to length 6 returns "123..." - */ - public static String truncate(String inputString, int truncateLength) { - if (inputString.length() <= truncateLength) { - return inputString; - } - - return inputString.substring(0, truncateLength - 3) + "..."; - } - /** * Trims head of the String if it is longer than specified Length. * E.g., String "12345678" with maximumStringLength = 6, returns "345678" @@ -101,27 +79,6 @@ public static String truncateHead(String inputString, int maximumStringLength) { return inputString.substring(inputStringLength - maximumStringLength); } - /** - * Checks whether the {@code longId} is longer than the length specified - * in {@link Const.SystemParams}, - * if so returns the truncated longId appended by ellipsis, - * otherwise returns the original longId. - */ - public static String truncateLongId(String longId) { - return truncate(longId, Const.SystemParams.USER_ID_MAX_DISPLAY_LENGTH); - } - - /** - * Substitutes the middle third of the given string with dots - * and returns the "obscured" string. - */ - public static String obscure(String inputString) { - Assumption.assertNotNull(inputString); - String frontPart = inputString.substring(0, inputString.length() / 3); - String endPart = inputString.substring(2 * inputString.length() / 3); - return frontPart + ".." + endPart; - } - /** * Generates the HMAC SHA-1 signature for a supplied string. * @@ -323,7 +280,7 @@ public static String replaceIllegalChars(String str, String regex, char replacem /** * Converts a byte array to hexadecimal string. */ - public static String byteArrayToHexString(byte[] bytes) { + static String byteArrayToHexString(byte[] bytes) { StringBuilder sb = new StringBuilder(bytes.length * 2); for (byte b : bytes) { int v = b & 0xff; @@ -354,18 +311,6 @@ public static String trimIfNotNull(String string) { return string == null ? null : string.trim(); } - /** - * Counts the number of empty strings passed as the argument. Null is - * considered an empty string, while whitespace is not. - * - * @return number of empty strings passed - */ - public static int countEmptyStrings(String... strings) { - return Math.toIntExact(Arrays.stream(strings) - .filter(s -> isEmpty(s)) - .count()); - } - /** * Converts null input to empty string. Non-null inputs will be left as is. * This method is for displaying purpose. @@ -376,71 +321,6 @@ public static String convertToEmptyStringIfNull(String str) { return str == null ? "" : str; } - /** - * Removes the outermost enclosing square brackets surrounding a string. - * - * @return the string without the outermost enclosing square brackets - * if the given string is enclosed by square brackets
    - * the string itself if the given string is not enclosed by square brackets
    - * null if the given string is null - */ - public static String removeEnclosingSquareBrackets(String str) { - if (str == null) { - return null; - } - - Pattern p = Pattern.compile("^\\[(.*)]$"); - Matcher m = p.matcher(str); - return m.find() ? m.group(1) : str; - } - - /** - * Returns a String array after removing white spaces leading and - * trailing any string in the input array. - */ - public static String[] trim(String[] stringsToTrim) { - return Arrays.stream(stringsToTrim) - .map(s -> s.trim()) - .toArray(size -> new String[size]); - } - - /** - * Returns a String array after converting them to lower case. - */ - public static String[] toLowerCase(String[] stringsToConvertToLowerCase) { - return Arrays.stream(stringsToConvertToLowerCase) - .map(s -> s.toLowerCase()) - .toArray(size -> new String[size]); - } - - /** - * Returns text with all non-ASCII characters removed. - */ - public static String removeNonAscii(String text) { - return text.replaceAll("[^\\x00-\\x7F]", ""); - } - - /** - * Returns a new String composed of copies of the String elements joined together - * with a copy of the specified delimiter. - */ - public static String join(String delimiter, List elements) { - return String.join(delimiter, toStringArray(elements)); - } - - /** - * Converts list of integer to array of strings. - */ - private static String[] toStringArray(List elements) { - if (elements == null) { - throw new IllegalArgumentException("Provided arguments cannot be null"); - } - - return elements.stream() - .map(s -> String.valueOf(s)) - .toArray(size -> new String[size]); - } - /** * Returns true if {@code text} contains at least one of the {@code strings} or if {@code strings} is empty. * If {@code text} is null, false is returned. diff --git a/src/main/java/teammates/common/util/TaskWrapper.java b/src/main/java/teammates/common/util/TaskWrapper.java index e4e699824ad..34f96defe12 100644 --- a/src/main/java/teammates/common/util/TaskWrapper.java +++ b/src/main/java/teammates/common/util/TaskWrapper.java @@ -9,12 +9,14 @@ public class TaskWrapper { private final String queueName; private final String workerUrl; - private final Map paramMap; + private final Map paramMap; + private final Object requestBody; - public TaskWrapper(String queueName, String workerUrl, Map paramMap) { + public TaskWrapper(String queueName, String workerUrl, Map paramMap, Object requestBody) { this.queueName = queueName; this.workerUrl = workerUrl; this.paramMap = paramMap; + this.requestBody = requestBody; } public String getQueueName() { @@ -25,8 +27,12 @@ public String getWorkerUrl() { return workerUrl; } - public Map getParamMap() { + public Map getParamMap() { return paramMap; } + public Object getRequestBody() { + return requestBody; + } + } diff --git a/src/main/java/teammates/common/util/TimeHelper.java b/src/main/java/teammates/common/util/TimeHelper.java index a3d3cb85ae5..bc1e50bf91b 100644 --- a/src/main/java/teammates/common/util/TimeHelper.java +++ b/src/main/java/teammates/common/util/TimeHelper.java @@ -1,16 +1,12 @@ package teammates.common.util; import java.lang.reflect.Field; -import java.time.DateTimeException; import java.time.Duration; import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; -import java.time.temporal.ChronoUnit; import java.time.zone.ZoneRulesProvider; import java.util.Locale; @@ -74,142 +70,6 @@ public static Instant getInstantDaysOffsetFromNow(long offsetInDays) { return Instant.now().plus(Duration.ofDays(offsetInDays)); } - /** - * Converts the {@code localDateTime} to {@code Instant} using the {@code timeZone}. - */ - public static Instant convertLocalDateTimeToInstant(LocalDateTime localDateTime, ZoneId timeZone) { - return localDateTime == null ? null : localDateTime.atZone(timeZone).toInstant(); - } - - /** - * Converts the {@code Instant} at the specified {@code timeZone} to {@code localDateTime}. - */ - public static LocalDateTime convertInstantToLocalDateTime(Instant instant, ZoneId timeZoneId) { - return instant == null ? null : instant.atZone(timeZoneId).toLocalDateTime(); - } - - /** - * Formats a datetime stamp from a {@code LocalDateTime} using a formatting pattern. - * - *

    Note: a formatting pattern containing 'a' (for the period; AM/PM) is treated differently at noon/midday. - * Using that pattern with a datetime whose time falls on "12:00 PM" will cause it to be formatted as "12:00 NOON".

    - * - * @param localDateTime the LocalDateTime to be formatted - * @param pattern formatting pattern, see Oracle docs for DateTimeFormatter for pattern table - * @return the formatted datetime stamp string - */ - private static String formatLocalDateTime(LocalDateTime localDateTime, String pattern) { - if (localDateTime == null || pattern == null) { - return ""; - } - String processedPattern = pattern; - if (localDateTime.getHour() == 12 && localDateTime.getMinute() == 0) { - processedPattern = pattern.replace("a", "'NOON'"); - } - DateTimeFormatter formatter = DateTimeFormatter.ofPattern(processedPattern); - return localDateTime.format(formatter); - } - - /** - * Formats a datetime stamp from a {@code localDateTime}. - * Example: Sun, 01 Apr 2018, 12:01 PM - * - *

    Note: a datetime with time "12:00 PM" is specially formatted to "12:00 NOON" - * Example: Sun, 01 Apr 2018, 12:00 NOON

    - * - * @param localDateTime the LocalDateTime to be formatted - * @return the formatted datetime stamp string - */ - public static String formatDateTimeForDisplay(LocalDateTime localDateTime) { - return formatLocalDateTime(localDateTime, "EEE, dd MMM yyyy, hh:mm a"); - } - - /** - * Formats a datetime stamp from an {@code instant} including time zone name. - * Example: Sun, 01 Apr 2018, 11:21 PM SGT - * - *

    Note: a datetime with time "12:00 PM" is specially formatted to "12:00 NOON" - * Example: Sun, 01 Apr 2018, 12:00 NOON SGT

    - * - * @param instant the instant to be formatted - * @param sessionTimeZone the time zone to compute local datetime - * @return the formatted datetime stamp string - */ - public static String formatDateTimeForDisplay(Instant instant, ZoneId sessionTimeZone) { - return formatInstant(instant, sessionTimeZone, "EEE, dd MMM yyyy, hh:mm a z"); - } - - /** - * Formats a date stamp from a {@code localDateTime} for populating the sessions form. - * Example: Sun, 01 Apr, 2018 - * - *

    This method discards the time stored in the {@code localDateTime}.

    - * - * @param localDateTime the LocalDateTime to be formatted - * @return the formatted date stamp string - */ - public static String formatDateForSessionsForm(LocalDateTime localDateTime) { - return formatLocalDateTime(localDateTime, "EEE, dd MMM, yyyy"); - } - - /** - * Formats a short datetime stamp from a {@code localDateTime} for the instructor's home page. - * Example: 5 Apr 12:01 PM - * - *

    Note: a datetime with time "12:00 PM" is specially formatted to "12:00 NOON" - * Example: 5 Apr 12:01 NOON

    - * - * @param localDateTime the LocalDateTime to be formatted - * @return the formatted datetime stamp string - */ - public static String formatDateTimeForInstructorHomePage(LocalDateTime localDateTime) { - return formatLocalDateTime(localDateTime, "d MMM h:mm a"); - } - - /** - * Convenience method to perform {@link #adjustLocalDateTimeForSessionsFormInputs} followed by - * {@link #formatDateForSessionsForm} on a {@link LocalDateTime}. - * @see #adjustAndFormatDateForSessionsFormInputs - * @see #formatDateForSessionsForm - */ - public static String adjustAndFormatDateForSessionsFormInputs(LocalDateTime localDateTime) { - return formatDateForSessionsForm(adjustLocalDateTimeForSessionsFormInputs(localDateTime)); - } - - /** - * Returns a copy of the {@link LocalDateTime} adjusted to be compatible with the format output by - * {@link #parseDateTimeFromSessionsForm}, i.e. either the time is 23:59, or the minute is 0 and the hour is not 0. - * The date time is first rounded to the nearest hour, then the special case 00:00 is handled. - * @param ldt The {@link LocalDateTime} to be adjusted for compatibility. - * @return a copy of {@code ldt} adjusted for compatibility, or null if {@code ldt} is null. - * @see #parseDateTimeFromSessionsForm - */ - public static LocalDateTime adjustLocalDateTimeForSessionsFormInputs(LocalDateTime ldt) { - if (ldt == null) { - return null; - } - if (ldt.getMinute() == 0 && ldt.getHour() != 0 || ldt.getMinute() == 59 && ldt.getHour() == 23) { - return ldt; - } - - // Round to the nearest hour - LocalDateTime rounded; - LocalDateTime floor = ldt.truncatedTo(ChronoUnit.HOURS); - LocalDateTime ceiling = floor.plusHours(1); - Duration distanceToCeiling = Duration.between(ldt, ceiling); - if (distanceToCeiling.compareTo(Duration.ofMinutes(30)) <= 0) { - rounded = ceiling; - } else { - rounded = floor; - } - - // Adjust 00:00 -> 23:59 - if (rounded.getHour() == 0) { - return rounded.minusMinutes(1); - } - return rounded; - } - /** * Formats a datetime stamp from an {@code instant} using a formatting pattern. * @@ -221,7 +81,7 @@ public static LocalDateTime adjustLocalDateTimeForSessionsFormInputs(LocalDateTi * @param pattern formatting pattern, see Oracle docs for DateTimeFormatter for pattern table * @return the formatted datetime stamp string */ - private static String formatInstant(Instant instant, ZoneId timeZone, String pattern) { + public static String formatInstant(Instant instant, ZoneId timeZone, String pattern) { if (instant == null || timeZone == null || pattern == null) { return ""; } @@ -234,47 +94,6 @@ private static String formatInstant(Instant instant, ZoneId timeZone, String pat return zonedDateTime.format(formatter); } - /** - * Formats a datetime stamp from an {@code instant} including time zone name and offset. - * Example: Sun, 01 Apr 2018, 11:23 PM SGT (UTC+0800) - * - *

    Note: a datetime with time "12:00 PM" is specially formatted to "12:00 NOON" - * Example: Sun, 01 Apr 2018, 12:00 NOON SGT (UTC+0800)

    - * - * @param instant the interpreted instant to be formatted - * @param zone the time zone to compute local datetime - * @return the formatted datetime stamp string - */ - public static String formatDateTimeForDisplayFull(Instant instant, ZoneId zone) { - return formatInstant(instant, zone, "EEE, dd MMM yyyy, hh:mm a z ('UTC'Z)"); - } - - /** - * Formats a date stamp from an {@code instant} for the instructor's pages. - * Example: 5 May 2017 - * - * @param instant the instant to be formatted - * @param zoneId the time zone to calculate local date - * @return the formatted date stamp string - */ - public static String formatDateForInstructorPages(Instant instant, ZoneId zoneId) { - return formatInstant(instant, zoneId, "d MMM yyyy"); - } - - /** - * Formats {@code instant} using the ISO8601 format in UTC. - * Example: 2011-12-03T10:15:30Z - * - *

    Used to inject a standardized date into date elements in Teammates for sortable tables. - * Should not be used for anything user-facing.

    - * - * @param instant the instant to be formatted - * @return the formatted datetime ISO8601 stamp in UTC - */ - public static String formatDateTimeToIso8601Utc(Instant instant) { - return instant == null ? null : DateTimeFormatter.ISO_INSTANT.format(instant); - } - /** * Returns whether the given {@code instant} is being used as a special representation, signifying its face value * should not be used without proper processing. @@ -312,74 +131,4 @@ public static Instant parseInstant(String dateTimeString) { } } - /** - * Parses a {@code LocalDate} object from a date string and parsing pattern. - * - * @param dateString the string containing the date - * @param pattern the parsing pattern of the datetime string - * @return the parsed {@code LocalDate} object, or {@code null} if there are errors - */ - public static LocalDate parseLocalDate(String dateString, String pattern) { - if (dateString == null || pattern == null) { - return null; - } - - DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern); - try { - return LocalDate.parse(dateString, formatter); - } catch (DateTimeParseException e) { - return null; - } - } - - /** - * Parses a {@code LocalDate} object from a date string. - * Example: date "Tue, 01 Apr, 2014" - * - * @param date date in format "EEE, dd MMM, yyyy" - * @return the parsed {@code LocalDate} object, or {@code null} if there are errors - */ - public static LocalDate parseDateFromSessionsForm(String date) { - return parseLocalDate(date, "EEE, dd MMM, yyyy"); - } - - /** - * Parses a {@code LocalDateTime} object from separated date, hour and minute strings. - * Example: date "Tue, 01 Apr, 2014", hour "23", min "59" - * - * @param date date in format "EEE, dd MMM, yyyy" - * @param hour hour-of-day (0-23) - * @param min minute-of-hour (0-59) - * @return the parsed {@code LocalDateTime} object, or {@code null} if there are errors - */ - public static LocalDateTime parseDateTimeFromSessionsForm(String date, String hour, String min) { - LocalDate localDate = parseDateFromSessionsForm(date); - if (localDate == null) { - return null; - } - if (hour == null || min == null) { - return null; - } - try { - return localDate.atTime(Integer.parseInt(hour), Integer.parseInt(min)); - } catch (DateTimeException | NumberFormatException e) { - return null; - } - } - - /** - * Parses a date string and a time string of only the hour into a LocalDateTime object. - * If the {@code inputTimeHours} is "24", it is converted to "23:59". - * - * @param inputDate date in format "EEE, dd MMM, yyyy" - * @param inputTimeHours hour-of-day (0-24) - * @return the parsed {@code LocalDateTime} at the specified date and hour, or null for invalid parameters - */ - public static LocalDateTime parseDateTimeFromSessionsForm(String inputDate, String inputTimeHours) { - if ("24".equals(inputTimeHours)) { - return parseDateTimeFromSessionsForm(inputDate, "23", "59"); - } - return parseDateTimeFromSessionsForm(inputDate, inputTimeHours, "0"); - } - } diff --git a/src/main/java/teammates/common/util/Url.java b/src/main/java/teammates/common/util/Url.java index 9cc2a273c0a..713fe4fac32 100644 --- a/src/main/java/teammates/common/util/Url.java +++ b/src/main/java/teammates/common/util/Url.java @@ -33,8 +33,8 @@ public Url(String urlString) { * authority (host name + port number if specified) but before the query.
    * Example: *
      - *
    • new Url("http://localhost:8080/index.jsp").getRelativeUrl() - * returns /index.jsp
    • + *
    • new Url("http://localhost:8080/index.html").getRelativeUrl() + * returns /index.html
    • *
    • new Url("http://google.com").getRelativeUrl() * returns [empty string]
    • *
    • new Url("https://teammatesv4.appspot.com/page/studentHomePage?user=abc").getRelativeUrl() @@ -50,9 +50,9 @@ public String getRelativeUrl() { * authority (host name + port number if specified) but not the path.
      * Example: *
        - *
      • new Url("http://localhost:8080/index.jsp").getBaseUrl() + *
      • new Url("http://localhost:8080/index.html").getBaseUrl() * returns http://localhost:8080
      • - *
      • new Url("https://teammatesv4.appspot.com/index.jsp").getBaseUrl() + *
      • new Url("https://teammatesv4.appspot.com/index.html").getBaseUrl() * returns https://teammatesv4.appspot.com
      • *
      */ @@ -87,15 +87,15 @@ public T withParam(String paramName, String paramValue) { * Unchanged if either the key or value is null, or the key already exists
      * Example: *
        - *
      • addParam("index.jsp","action","add") returns - * index.jsp?action=add
      • - *
      • addParam("index.jsp?action=add","courseid","cs1101") - * returns index.jsp?action=add&courseid=cs1101
      • - *
      • addParam("index.jsp","message",null) returns - * index.jsp
      • + *
      • addParam("index.html","action","add") returns + * index.html?action=add
      • + *
      • addParam("index.html?action=add","courseid","cs1101") + * returns index.html?action=add&courseid=cs1101
      • + *
      • addParam("index.html","message",null) returns + * index.html
      • *
      */ - public static String addParamToUrl(String url, String key, String value) { + static String addParamToUrl(String url, String key, String value) { if (key == null || key.isEmpty() || value == null || value.isEmpty() || url.contains("?" + key + "=") || url.contains("&" + key + "=")) { // return the url if any of the key or the value is null or empty @@ -105,10 +105,6 @@ public static String addParamToUrl(String url, String key, String value) { return url + (url.contains("?") ? "&" : "?") + key + "=" + SanitizationHelper.sanitizeForUri(value); } - public static String trimTrailingSlash(String url) { - return url.trim().replaceAll("/(?=$)", ""); - } - @Override public String toString() { return relativeUrl + query; diff --git a/src/main/java/teammates/common/util/retry/RetryManager.java b/src/main/java/teammates/common/util/retry/RetryManager.java index e1ed215d633..29d3f4a2969 100644 --- a/src/main/java/teammates/common/util/retry/RetryManager.java +++ b/src/main/java/teammates/common/util/retry/RetryManager.java @@ -57,7 +57,7 @@ public boolean isSuccessful(Retryable task) throw /** * Checks whether the {@code task} ran successfully based based on the {@code SuccessCondition}. */ - public abstract boolean isSuccessful(Retryable task) throws E; + protected abstract boolean isSuccessful(Retryable task) throws E; } /** diff --git a/src/main/java/teammates/common/util/retry/Retryable.java b/src/main/java/teammates/common/util/retry/Retryable.java index 3ebc0432e20..db73172fc5b 100644 --- a/src/main/java/teammates/common/util/retry/Retryable.java +++ b/src/main/java/teammates/common/util/retry/Retryable.java @@ -7,8 +7,6 @@ */ public abstract class Retryable { - protected String name; - /** * An optional final message to show in the {@link MaximumRetriesExceededException} thrown * should the task fail after maximum retries. @@ -21,7 +19,9 @@ public abstract class Retryable { */ protected Object finalData; - public Retryable(String name) { + private String name; + + Retryable(String name) { this.name = name; } diff --git a/src/main/java/teammates/logic/api/EmailGenerator.java b/src/main/java/teammates/logic/api/EmailGenerator.java index a1bd223e05b..72383423ac2 100644 --- a/src/main/java/teammates/logic/api/EmailGenerator.java +++ b/src/main/java/teammates/logic/api/EmailGenerator.java @@ -60,6 +60,8 @@ public class EmailGenerator { private static final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); private static final StudentsLogic studentsLogic = StudentsLogic.inst(); + private static final String DATETIME_DISPLAY_FORMAT = "EEE, dd MMM yyyy, hh:mm a z"; + /** * Generates the feedback session opening emails for the given {@code session}. */ @@ -108,6 +110,21 @@ public List generateFeedbackSessionReminderEmails( return emails; } + /** + * Generates the feedback session reminder emails for the given {@code student}. + */ + public EmailWrapper generateFeedbackSessionStudentReminderEmail( + FeedbackSessionAttributes session, StudentAttributes student) { + + CourseAttributes course = coursesLogic.getCourse(session.getCourseId()); + String template = EmailTemplates.USER_FEEDBACK_SESSION.replace("${status}", FEEDBACK_STATUS_SESSION_OPEN); + String additionalContactInformation = HTML_NO_ACTION_REQUIRED + getAdditionalContactInformationFragment(course); + + return generateFeedbackSessionEmailBaseForStudents(course, session, student, template, + EmailType.FEEDBACK_SESSION_REMINDER.getSubject(), + FEEDBACK_ACTION_SUBMIT_EDIT_OR_VIEW, additionalContactInformation); + } + /** * Generates the email containing the summary of the feedback sessions * email for the given {@code courseId} for {@code student}. @@ -168,7 +185,8 @@ public EmailWrapper generateFeedbackSessionSummaryOfCourse( linksFragmentValue.append(Templates.populateTemplate( EmailTemplates.FRAGMENT_SINGLE_FEEDBACK_SESSION_LINKS, "${feedbackSessionName}", fsa.getFeedbackSessionName(), - "${deadline}", fsa.getEndTimeString() + (fsa.isClosed() ? " (Passed)" : ""), + "${deadline}", TimeHelper.formatInstant(fsa.getEndTime(), fsa.getTimeZone(), DATETIME_DISPLAY_FORMAT) + + (fsa.isClosed() ? " (Passed)" : ""), "${submitUrl}", submitUrlHtml, "${reportUrl}", reportUrlHtml)); } @@ -272,10 +290,11 @@ private EmailWrapper generateSubmissionConfirmationEmail( "${courseName}", SanitizationHelper.sanitizeForHtml(course.getName()), "${courseId}", SanitizationHelper.sanitizeForHtml(course.getId()), "${feedbackSessionName}", SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()), - "${deadline}", SanitizationHelper.sanitizeForHtml(session.getEndTimeString()), + "${deadline}", SanitizationHelper.sanitizeForHtml( + TimeHelper.formatInstant(session.getEndTime(), session.getTimeZone(), DATETIME_DISPLAY_FORMAT)), "${submitUrl}", submitUrl, "${timeStamp}", SanitizationHelper.sanitizeForHtml( - TimeHelper.formatDateTimeForDisplay(timestamp, session.getTimeZone())), + TimeHelper.formatInstant(timestamp, session.getTimeZone(), DATETIME_DISPLAY_FORMAT)), "${additionalContactInformation}", additionalContactInformation); EmailWrapper email = getEmptyEmailAddressedToEmail(userEmail); @@ -415,7 +434,8 @@ private EmailWrapper generateFeedbackSessionEmailBaseForInstructorReminders( "${courseName}", SanitizationHelper.sanitizeForHtml(course.getName()), "${courseId}", SanitizationHelper.sanitizeForHtml(course.getId()), "${feedbackSessionName}", SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()), - "${deadline}", SanitizationHelper.sanitizeForHtml(session.getEndTimeString()), + "${deadline}", SanitizationHelper.sanitizeForHtml( + TimeHelper.formatInstant(session.getEndTime(), session.getTimeZone(), DATETIME_DISPLAY_FORMAT)), "${instructorFragment}", "", "${sessionInstructions}", session.getInstructionsString(), "${submitUrl}", submitUrl, @@ -555,16 +575,16 @@ private List generateFeedbackSessionEmailBases( private List generateFeedbackSessionEmailBases( CourseAttributes course, FeedbackSessionAttributes session, List students, List instructors, String template, String subject, String feedbackAction, - String addtionalContactInformation) { + String additionalContactInformation) { List emails = new ArrayList<>(); for (StudentAttributes student : students) { emails.add(generateFeedbackSessionEmailBaseForStudents(course, session, student, - template, subject, feedbackAction, addtionalContactInformation)); + template, subject, feedbackAction, additionalContactInformation)); } for (InstructorAttributes instructor : instructors) { emails.add(generateFeedbackSessionEmailBaseForInstructors(course, session, instructor, - template, subject, feedbackAction, addtionalContactInformation)); + template, subject, feedbackAction, additionalContactInformation)); } return emails; } @@ -592,7 +612,8 @@ private EmailWrapper generateFeedbackSessionEmailBaseForStudents( "${courseName}", SanitizationHelper.sanitizeForHtml(course.getName()), "${courseId}", SanitizationHelper.sanitizeForHtml(course.getId()), "${feedbackSessionName}", SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()), - "${deadline}", SanitizationHelper.sanitizeForHtml(session.getEndTimeString()), + "${deadline}", SanitizationHelper.sanitizeForHtml( + TimeHelper.formatInstant(session.getEndTime(), session.getTimeZone(), DATETIME_DISPLAY_FORMAT)), "${instructorFragment}", "", "${sessionInstructions}", session.getInstructionsString(), "${submitUrl}", submitUrl, @@ -632,7 +653,8 @@ private EmailWrapper generateFeedbackSessionEmailBaseForInstructors( "${courseName}", SanitizationHelper.sanitizeForHtml(course.getName()), "${courseId}", SanitizationHelper.sanitizeForHtml(course.getId()), "${feedbackSessionName}", SanitizationHelper.sanitizeForHtml(session.getFeedbackSessionName()), - "${deadline}", SanitizationHelper.sanitizeForHtml(session.getEndTimeString()), + "${deadline}", SanitizationHelper.sanitizeForHtml( + TimeHelper.formatInstant(session.getEndTime(), session.getTimeZone(), DATETIME_DISPLAY_FORMAT)), "${instructorFragment}", instructorFragment, "${sessionInstructions}", session.getInstructionsString(), "${submitUrl}", "{in the actual email sent to the students, this will be the unique link}", diff --git a/src/main/java/teammates/logic/api/GateKeeper.java b/src/main/java/teammates/logic/api/GateKeeper.java index 2daa60cc0df..86ceb9d24a8 100644 --- a/src/main/java/teammates/logic/api/GateKeeper.java +++ b/src/main/java/teammates/logic/api/GateKeeper.java @@ -6,7 +6,6 @@ import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.datatransfer.UserInfo; -import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; @@ -31,7 +30,7 @@ public class GateKeeper { private static final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); private static final StudentsLogic studentsLogic = StudentsLogic.inst(); - public boolean isUserLoggedOn() { + private boolean isUserLoggedOn() { return userService.getCurrentUser() != null; } @@ -107,39 +106,6 @@ public void verifyLoggedInUserPrivileges() { throw new UnauthorizedAccessException("User is not logged in"); } - /** - * Verifies that the logged in user is the admin and there is no - * masquerading going on. - */ - public void verifyAdminPrivileges(AccountAttributes account) { - if (isUserLoggedOn() && userService.isUserAdmin() - && getCurrentGoogleUser().getNickname().equals(account.googleId)) { - return; - } - - throw new UnauthorizedAccessException("User " + getCurrentGoogleUser().getNickname() - + " does not have admin privilleges"); - } - - /** - * Verifies that the nominal user has instructor privileges. - */ - public void verifyInstructorPrivileges(AccountAttributes account) { - if (account.isInstructor) { - return; - } - throw new UnauthorizedAccessException("User " + account.googleId - + " does not have instructor privilleges"); - } - - /** - * Verifies that the nominal user has student privileges. Currently, all - * logged in users as student privileges. - */ - public void verifyStudentPrivileges(AccountAttributes account) { - verifyLoggedInUserPrivileges(); - } - // These methods ensures that the nominal user specified has access to a given entity /** diff --git a/src/main/java/teammates/logic/api/Logic.java b/src/main/java/teammates/logic/api/Logic.java index b2a5f78f0f6..c540e821006 100644 --- a/src/main/java/teammates/logic/api/Logic.java +++ b/src/main/java/teammates/logic/api/Logic.java @@ -7,18 +7,12 @@ import javax.annotation.Nullable; -import teammates.common.datatransfer.CourseDetailsBundle; -import teammates.common.datatransfer.CourseSummaryBundle; import teammates.common.datatransfer.DataBundle; import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.datatransfer.FeedbackResponseCommentSearchResultBundle; -import teammates.common.datatransfer.FeedbackSessionDetailsBundle; -import teammates.common.datatransfer.InstructorPrivileges; import teammates.common.datatransfer.InstructorSearchResultBundle; -import teammates.common.datatransfer.SectionDetailsBundle; import teammates.common.datatransfer.SessionResultsBundle; import teammates.common.datatransfer.StudentSearchResultBundle; -import teammates.common.datatransfer.TeamDetailsBundle; import teammates.common.datatransfer.UserRole; import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; @@ -53,17 +47,17 @@ */ public class Logic { - private static final AccountsLogic accountsLogic = AccountsLogic.inst(); - private static final StudentsLogic studentsLogic = StudentsLogic.inst(); - private static final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - private static final FeedbackSessionsLogic feedbackSessionsLogic = FeedbackSessionsLogic.inst(); - private static final FeedbackQuestionsLogic feedbackQuestionsLogic = FeedbackQuestionsLogic.inst(); - private static final FeedbackResponsesLogic feedbackResponsesLogic = FeedbackResponsesLogic.inst(); - private static final FeedbackResponseCommentsLogic feedbackResponseCommentsLogic = + protected static final AccountsLogic accountsLogic = AccountsLogic.inst(); + protected static final StudentsLogic studentsLogic = StudentsLogic.inst(); + protected static final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); + protected static final CoursesLogic coursesLogic = CoursesLogic.inst(); + protected static final FeedbackSessionsLogic feedbackSessionsLogic = FeedbackSessionsLogic.inst(); + protected static final FeedbackQuestionsLogic feedbackQuestionsLogic = FeedbackQuestionsLogic.inst(); + protected static final FeedbackResponsesLogic feedbackResponsesLogic = FeedbackResponsesLogic.inst(); + protected static final FeedbackResponseCommentsLogic feedbackResponseCommentsLogic = FeedbackResponseCommentsLogic.inst(); - private static final ProfilesLogic profilesLogic = ProfilesLogic.inst(); - private static final DataBundleLogic dataBundleLogic = DataBundleLogic.inst(); + protected static final ProfilesLogic profilesLogic = ProfilesLogic.inst(); + protected static final DataBundleLogic dataBundleLogic = DataBundleLogic.inst(); /** * Preconditions:
      @@ -134,27 +128,6 @@ public void deletePictureKey(String googleId) { profilesLogic.deletePictureKey(googleId); } - /** - * Add an instructor for a course.
      - * Preconditions:
      - * * All parameters are non-null. - */ - @Deprecated - public void addInstructor(String courseId, String name, String email, String role) - throws InvalidParametersException, EntityAlreadyExistsException { - - Assumption.assertNotNull(courseId); - Assumption.assertNotNull(name); - Assumption.assertNotNull(email); - - InstructorAttributes instructor = InstructorAttributes.builder(courseId, email) - .withName(name) - .withRole(role) - .withPrivileges(new InstructorPrivileges(role)) - .build(); - instructorsLogic.createInstructor(instructor); - } - /** * Creates an instructor. * @@ -275,51 +248,11 @@ public List getInstructorsForCourse(String courseId) { return instructorsLogic.getInstructorsForCourse(courseId); } - /** - * Get the encrypted registration key for the instructor. - * Preconditions:
      - * * All parameters are non-null. - */ - public String getEncryptedKeyForInstructor(String courseId, String email) - throws EntityDoesNotExistException { - - Assumption.assertNotNull(courseId); - Assumption.assertNotNull(email); - - return instructorsLogic.getEncryptedKeyForInstructor(courseId, email); - } - public List getAllOngoingSessions(Instant rangeStart, Instant rangeEnd) { return feedbackSessionsLogic.getAllOngoingSessions(rangeStart, rangeEnd); } - /** - * Returns true if this user has instructor privileges. - */ - public boolean isInstructor(String googleId) { - - return accountsLogic.isAccountAnInstructor(googleId); - } - - /** - * Returns true if this user is an instructor of the course. - */ - public boolean isInstructorOfCourse(String googleId, String courseId) { - - return instructorsLogic.isGoogleIdOfInstructorOfCourse(googleId, courseId); - } - - /** - * Returns true if the instructor is a new user. - * - * @see InstructorsLogic#isNewInstructor(String) - */ - public boolean isNewInstructor(String googleId) { - - return instructorsLogic.isNewInstructor(googleId); - } - /** * Updates an instructor by {@link InstructorAttributes.UpdateOptionsWithGoogleId}. * @@ -428,16 +361,6 @@ public CourseAttributes getCourse(String courseId) { return coursesLogic.getCourse(courseId); } - /** - * Returns a detailed version of course data.
      - * Preconditions:
      - * * All parameters are non-null. - */ - public CourseDetailsBundle getCourseDetails(String courseId) throws EntityDoesNotExistException { - Assumption.assertNotNull(courseId); - return coursesLogic.getCourseSummary(courseId); - } - /** * Preconditions:
      * * All parameters are non-null. @@ -447,57 +370,6 @@ public List getCoursesForStudentAccount(String googleId) { return coursesLogic.getCoursesForStudentAccount(googleId); } - /** - * Omits archived courses if omitArchived == true
      - * Preconditions:
      - * * All parameters are non-null. - * @return A less detailed version of courses for this instructor without stats. - * Returns an empty list if none found. - */ - public Map getCourseSummariesWithoutStatsForInstructor(String googleId, - boolean omitArchived) { - - Assumption.assertNotNull(googleId); - return coursesLogic.getCoursesSummaryWithoutStatsForInstructor(googleId, omitArchived); - } - - /** - * Preconditions:
      - * * All parameters are non-null. - * @return A less detailed version of courses for this instructor. - * Returns an empty list if none found. - */ - public Map getCourseSummariesForInstructor(String googleId) - throws EntityDoesNotExistException { - - Assumption.assertNotNull(googleId); - return coursesLogic.getCourseSummariesForInstructor(googleId, false); - } - - /** - * Preconditions:
      - * * All parameters are non-null. - * - * @return Courses the instructor is in. - */ - public List getCoursesForInstructor(String googleId) { - - return getCoursesForInstructor(googleId, false); - } - - /** - * Omits archived courses if omitArchived == true
      - * Preconditions:
      - * * All parameters are non-null. - * - * @return Courses the instructor is in. - */ - public List getCoursesForInstructor(String googleId, boolean omitArchived) { - - Assumption.assertNotNull(googleId); - return coursesLogic.getCoursesForInstructor(googleId, omitArchived); - } - /** * Preconditions:
      * * All parameters are non-null. @@ -522,12 +394,6 @@ public List getSoftDeletedCoursesForInstructors(ListPreconditions:
      - * * All parameters are non-null. - */ - public void restoreAllCoursesFromRecycleBin(List instructorList) - throws EntityDoesNotExistException { - Assumption.assertNotNull(instructorList); - - coursesLogic.restoreAllCoursesFromRecycleBin(instructorList); - } - /** * Search for students. Preconditions: all parameters are non-null. * @param instructors a list of InstructorAttributes associated to a googleId, @@ -675,18 +521,6 @@ public StudentAttributes getStudentForEmail(String courseId, String email) { return studentsLogic.getStudentForEmail(courseId, email); } - /** - * Preconditions:
      - * * All parameters are non-null. - * - * @return an empty list if no match found. - */ - public List getAllStudentForEmail(String email) { - Assumption.assertNotNull(email); - - return studentsLogic.getAllStudentsForEmail(email); - } - /** * Preconditions:
      * * All parameters are non-null. @@ -747,49 +581,6 @@ public List getSectionNamesForCourse(String courseId) throws EntityDoesN return coursesLogic.getSectionsNameForCourse(courseId); } - /** - * Returns a list of {@link SectionDetailsBundle} for a given course using courseId. - * - *

      Preconditions:
      - * * All parameters are non-null. - * - * @see CoursesLogic#getSectionsForCourseWithoutStats(String) - */ - public List getSectionsForCourse(String courseId) throws EntityDoesNotExistException { - Assumption.assertNotNull(courseId); - return coursesLogic.getSectionsForCourseWithoutStats(courseId); - } - - /** - * Preconditions:
      - * * All parameters are non-null. - */ - public List getTeamsForCourse(String courseId) throws EntityDoesNotExistException { - Assumption.assertNotNull(courseId); - return coursesLogic.getTeamsForCourse(courseId); - } - - /** - * Preconditions:
      - * * All parameters are non-null. - */ - public TeamDetailsBundle getTeamDetailsForStudent(StudentAttributes student) { - Assumption.assertNotNull(student); - return studentsLogic.getTeamDetailsForStudent(student); - } - - /** - * Preconditions:
      - * * All parameters are non-null. - */ - public String getEncryptedKeyForStudent(String courseId, String email) throws EntityDoesNotExistException { - - Assumption.assertNotNull(courseId); - Assumption.assertNotNull(email); - - return studentsLogic.getEncryptedKeyForStudent(courseId, email); - } - /** * Populates fields that need dynamic generation in a question. * @@ -955,16 +746,6 @@ public void deleteStudentsInCourseCascade(String courseId) { studentsLogic.deleteStudentsInCourseCascade(courseId); } - /** - * Checks if a course has sections for each team - * Preconditions:
      - * * All parameters are non-null. - */ - public boolean hasIndicatedSections(String courseId) throws EntityDoesNotExistException { - Assumption.assertNotNull(courseId); - return coursesLogic.hasIndicatedSections(courseId); - } - /** * Validates sections for any limit violations and teams for any team name violations. * @@ -1056,16 +837,25 @@ public List getFeedbackSessionsForCourse(String cours } /** - * Preconditions:
      + * Gets the expected number of submissions for a feedback session. + * + *
      Preconditions:
      * * All parameters are non-null. */ - public FeedbackSessionDetailsBundle getFeedbackSessionDetails(String feedbackSessionName, String courseId) - throws EntityDoesNotExistException { - - Assumption.assertNotNull(feedbackSessionName); - Assumption.assertNotNull(courseId); + public int getExpectedTotalSubmission(FeedbackSessionAttributes fsa) { + Assumption.assertNotNull(fsa); + return feedbackSessionsLogic.getExpectedTotalSubmission(fsa); + } - return feedbackSessionsLogic.getFeedbackSessionDetails(feedbackSessionName, courseId); + /** + * Gets the actual number of submissions for a feedback session. + * + *
      Preconditions:
      + * * All parameters are non-null. + */ + public int getActualTotalSubmission(FeedbackSessionAttributes fsa) { + Assumption.assertNotNull(fsa); + return feedbackSessionsLogic.getActualTotalSubmission(fsa); } /** @@ -1102,15 +892,6 @@ public Map getRecipientsOfQuestion( return feedbackQuestionsLogic.getRecipientsOfQuestion(question, instructorGiver, studentGiver, null); } - public FeedbackQuestionAttributes getFeedbackQuestion(String feedbackSessionName, - String courseId, - int questionNumber) { - Assumption.assertNotNull(feedbackSessionName); - Assumption.assertNotNull(courseId); - - return feedbackQuestionsLogic.getFeedbackQuestion(feedbackSessionName, courseId, questionNumber); - } - /** * Preconditions:
      * * All parameters are non-null.
      @@ -1440,17 +1221,6 @@ public FeedbackResponseAttributes getFeedbackResponse(String feedbackResponseId) return feedbackResponsesLogic.getFeedbackResponse(feedbackResponseId); } - public FeedbackResponseAttributes getFeedbackResponse(String feedbackQuestionId, - String giverEmail, - String recipient) { - - Assumption.assertNotNull(feedbackQuestionId); - Assumption.assertNotNull(giverEmail); - Assumption.assertNotNull(recipient); - - return feedbackResponsesLogic.getFeedbackResponse(feedbackQuestionId, giverEmail, recipient); - } - /** * Creates a feedback response. * @@ -1537,19 +1307,6 @@ public FeedbackResponseCommentAttributes getFeedbackResponseComment(Long feedbac return feedbackResponseCommentsLogic.getFeedbackResponseComment(feedbackResponseCommentId); } - /** - * Preconditions:
      - * * All parameters are non-null. - */ - public FeedbackResponseCommentAttributes getFeedbackResponseComment( - String responseId, String giverEmail, Instant creationDate) { - Assumption.assertNotNull(responseId); - Assumption.assertNotNull(giverEmail); - Assumption.assertNotNull(creationDate); - - return feedbackResponseCommentsLogic.getFeedbackResponseComment(responseId, giverEmail, creationDate); - } - public List getFeedbackResponseCommentForGiver(String courseId, String giverEmail) { Assumption.assertNotNull(courseId); @@ -1572,15 +1329,6 @@ public FeedbackResponseCommentAttributes getFeedbackResponseCommentForResponseFr return feedbackResponseCommentsLogic.getFeedbackResponseCommentForResponseFromParticipant(feedbackResponseId); } - /** - * Creates or updates document for the given comment. - * - * @see FeedbackResponseCommentsLogic#putDocument(FeedbackResponseCommentAttributes) - */ - public void putDocument(FeedbackResponseCommentAttributes comment) { - feedbackResponseCommentsLogic.putDocument(comment); - } - /** * Batch creates or updates documents for the given comments. * @@ -1628,13 +1376,6 @@ public void deleteFeedbackResponseComment(long commentId) { feedbackResponseCommentsLogic.deleteFeedbackResponseComment(commentId); } - public List getArchivedCourseIds(List allCourses, - Map instructorsForCourses) { - Assumption.assertNotNull(allCourses); - Assumption.assertNotNull(instructorsForCourses); - return coursesLogic.getArchivedCourseIds(allCourses, instructorsForCourses); - } - /** * Returns returns a list of sessions that were closed within past hour. * diff --git a/src/main/java/teammates/logic/api/TaskQueuer.java b/src/main/java/teammates/logic/api/TaskQueuer.java index a21c536f691..5edc22b3037 100644 --- a/src/main/java/teammates/logic/api/TaskQueuer.java +++ b/src/main/java/teammates/logic/api/TaskQueuer.java @@ -10,6 +10,8 @@ import teammates.common.util.Logger; import teammates.common.util.TaskWrapper; import teammates.logic.core.TaskQueuesLogic; +import teammates.ui.request.FeedbackSessionRemindRequest; +import teammates.ui.request.SendEmailRequest; /** * Allows for adding specific type of tasks to the task queue. @@ -22,26 +24,17 @@ public class TaskQueuer { // Using this method, the actual logic can still be black-boxed // while at the same time allowing this API to be mocked during test. - protected void addTask(String queueName, String workerUrl, Map paramMap) { - Map multisetParamMap = new HashMap<>(); - paramMap.forEach((key, value) -> multisetParamMap.put(key, new String[] { value })); - TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap); + protected void addTask(String queueName, String workerUrl, Map paramMap, Object requestBody) { + TaskWrapper task = new TaskWrapper(queueName, workerUrl, paramMap, requestBody); new TaskQueuesLogic().addTask(task); } - protected void addDeferredTask(String queueName, String workerUrl, Map paramMap, + protected void addDeferredTask(String queueName, String workerUrl, Map paramMap, Object requestBody, long countdownTime) { - Map multisetParamMap = new HashMap<>(); - paramMap.forEach((key, value) -> multisetParamMap.put(key, new String[] { value })); - TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap); + TaskWrapper task = new TaskWrapper(queueName, workerUrl, paramMap, requestBody); new TaskQueuesLogic().addDeferredTask(task, countdownTime); } - protected void addTaskMultisetParam(String queueName, String workerUrl, Map paramMap) { - TaskWrapper task = new TaskWrapper(queueName, workerUrl, paramMap); - new TaskQueuesLogic().addTask(task); - } - /** * Gets the tasks added to the queue. * This method is used only for testing, where it is overridden. @@ -74,12 +67,12 @@ public Map getNumberOfTasksAdded() { public void scheduleFeedbackSessionReminders(String courseId, String feedbackSessionName, String googleIdOfRequestingInstructor) { Map paramMap = new HashMap<>(); - paramMap.put(ParamsNames.USER_ID, googleIdOfRequestingInstructor); - paramMap.put(ParamsNames.SUBMISSION_FEEDBACK, feedbackSessionName); - paramMap.put(ParamsNames.SUBMISSION_COURSE, courseId); + paramMap.put(ParamsNames.INSTRUCTOR_ID, googleIdOfRequestingInstructor); + paramMap.put(ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); + paramMap.put(ParamsNames.COURSE_ID, courseId); addTask(TaskQueue.FEEDBACK_SESSION_REMIND_EMAIL_QUEUE_NAME, - TaskQueue.FEEDBACK_SESSION_REMIND_EMAIL_WORKER_URL, paramMap); + TaskQueue.FEEDBACK_SESSION_REMIND_EMAIL_WORKER_URL, paramMap, null); } /** @@ -92,15 +85,12 @@ public void scheduleFeedbackSessionReminders(String courseId, String feedbackSes */ public void scheduleFeedbackSessionRemindersForParticularUsers(String courseId, String feedbackSessionName, String[] usersToRemind, - String googleIdOfRequestingInstructor) { - Map paramMap = new HashMap<>(); - paramMap.put(ParamsNames.SUBMISSION_FEEDBACK, new String[] { feedbackSessionName }); - paramMap.put(ParamsNames.SUBMISSION_COURSE, new String[] { courseId }); - paramMap.put(ParamsNames.SUBMISSION_REMIND_USERLIST, usersToRemind); - paramMap.put(ParamsNames.USER_ID, new String[] { googleIdOfRequestingInstructor }); - - addTaskMultisetParam(TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_QUEUE_NAME, - TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_WORKER_URL, paramMap); + String requestingInstructorId) { + FeedbackSessionRemindRequest remindRequest = + new FeedbackSessionRemindRequest(courseId, feedbackSessionName, requestingInstructorId, usersToRemind); + + addTask(TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_QUEUE_NAME, + TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_WORKER_URL, new HashMap<>(), remindRequest); } /** @@ -111,11 +101,11 @@ public void scheduleFeedbackSessionRemindersForParticularUsers(String courseId, */ public void scheduleFeedbackSessionPublishedEmail(String courseId, String feedbackSessionName) { Map paramMap = new HashMap<>(); - paramMap.put(ParamsNames.EMAIL_COURSE, courseId); - paramMap.put(ParamsNames.EMAIL_FEEDBACK, feedbackSessionName); + paramMap.put(ParamsNames.COURSE_ID, courseId); + paramMap.put(ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); addTask(TaskQueue.FEEDBACK_SESSION_PUBLISHED_EMAIL_QUEUE_NAME, - TaskQueue.FEEDBACK_SESSION_PUBLISHED_EMAIL_WORKER_URL, paramMap); + TaskQueue.FEEDBACK_SESSION_PUBLISHED_EMAIL_WORKER_URL, paramMap, null); } /** @@ -128,13 +118,11 @@ public void scheduleFeedbackSessionPublishedEmail(String courseId, String feedba */ public void scheduleFeedbackSessionResendPublishedEmail(String courseId, String feedbackSessionName, String[] usersToEmail) { - Map paramMap = new HashMap<>(); - paramMap.put(ParamsNames.SUBMISSION_FEEDBACK, new String[] { feedbackSessionName }); - paramMap.put(ParamsNames.SUBMISSION_COURSE, new String[] { courseId }); - paramMap.put(ParamsNames.SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST, usersToEmail); + FeedbackSessionRemindRequest remindRequest = + new FeedbackSessionRemindRequest(courseId, feedbackSessionName, null, usersToEmail); - addTaskMultisetParam(TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_QUEUE_NAME, - TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL, paramMap); + addTask(TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_QUEUE_NAME, + TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL, new HashMap<>(), remindRequest); } /** @@ -145,11 +133,11 @@ public void scheduleFeedbackSessionResendPublishedEmail(String courseId, String */ public void scheduleFeedbackSessionUnpublishedEmail(String courseId, String feedbackSessionName) { Map paramMap = new HashMap<>(); - paramMap.put(ParamsNames.EMAIL_COURSE, courseId); - paramMap.put(ParamsNames.EMAIL_FEEDBACK, feedbackSessionName); + paramMap.put(ParamsNames.COURSE_ID, courseId); + paramMap.put(ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName); addTask(TaskQueue.FEEDBACK_SESSION_UNPUBLISHED_EMAIL_QUEUE_NAME, - TaskQueue.FEEDBACK_SESSION_UNPUBLISHED_EMAIL_WORKER_URL, paramMap); + TaskQueue.FEEDBACK_SESSION_UNPUBLISHED_EMAIL_WORKER_URL, paramMap, null); } /** @@ -173,7 +161,7 @@ public void scheduleCourseRegistrationInviteToInstructor(String inviterGoogleId, paramMap.put(ParamsNames.IS_INSTRUCTOR_REJOINING, String.valueOf(isRejoining)); addTask(TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_QUEUE_NAME, - TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_WORKER_URL, paramMap); + TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_WORKER_URL, paramMap, null); } /** @@ -189,7 +177,7 @@ public void scheduleCourseRegistrationInviteToStudent(String courseId, String st paramMap.put(ParamsNames.IS_STUDENT_REJOINING, String.valueOf(isRejoining)); addTask(TaskQueue.STUDENT_COURSE_JOIN_EMAIL_QUEUE_NAME, - TaskQueue.STUDENT_COURSE_JOIN_EMAIL_WORKER_URL, paramMap); + TaskQueue.STUDENT_COURSE_JOIN_EMAIL_WORKER_URL, paramMap, null); } /** @@ -205,7 +193,7 @@ public void scheduleUpdateRespondentForSession( paramMap.put(ParamsNames.RESPONDENT_IS_TO_BE_REMOVED, String.valueOf(isToBeRemoved)); addTask(TaskQueue.FEEDBACK_SESSION_UPDATE_RESPONDENT_QUEUE_NAME, - TaskQueue.FEEDBACK_SESSION_UPDATE_RESPONDENT_WORKER_URL, paramMap); + TaskQueue.FEEDBACK_SESSION_UPDATE_RESPONDENT_WORKER_URL, paramMap, null); } /** @@ -232,25 +220,18 @@ public void scheduleEmailsForSending(List emails) { } private void scheduleEmailForSending(EmailWrapper email, long emailDelayTimer) { - String emailSubject = email.getSubject(); - String emailSenderName = email.getSenderName(); - String emailSender = email.getSenderEmail(); - String emailReceiver = email.getRecipient(); - String emailReplyToAddress = email.getReplyTo(); try { - Map paramMap = new HashMap<>(); - paramMap.put(ParamsNames.EMAIL_SUBJECT, emailSubject); - paramMap.put(ParamsNames.EMAIL_CONTENT, email.getContent()); - paramMap.put(ParamsNames.EMAIL_SENDER, emailSender); - if (emailSenderName != null && !emailSenderName.isEmpty()) { - paramMap.put(ParamsNames.EMAIL_SENDERNAME, emailSenderName); - } - paramMap.put(ParamsNames.EMAIL_RECEIVER, emailReceiver); - paramMap.put(ParamsNames.EMAIL_REPLY_TO_ADDRESS, emailReplyToAddress); + SendEmailRequest request = new SendEmailRequest(email); addDeferredTask(TaskQueue.SEND_EMAIL_QUEUE_NAME, TaskQueue.SEND_EMAIL_WORKER_URL, - paramMap, emailDelayTimer); + new HashMap<>(), request, emailDelayTimer); } catch (Exception e) { + String emailSubject = email.getSubject(); + String emailSenderName = email.getSenderName(); + String emailSender = email.getSenderEmail(); + String emailReceiver = email.getRecipient(); + String emailReplyToAddress = email.getReplyTo(); + log.severe("Error when adding email to task queue: " + e.getMessage() + "\n" + "Email sender: " + emailSender + "\n" + "Email sender name: " + emailSenderName + "\n" diff --git a/src/main/java/teammates/logic/core/AccountsLogic.java b/src/main/java/teammates/logic/core/AccountsLogic.java index 93949adf5e3..e762846f6bf 100644 --- a/src/main/java/teammates/logic/core/AccountsLogic.java +++ b/src/main/java/teammates/logic/core/AccountsLogic.java @@ -46,7 +46,7 @@ public static AccountsLogic inst() { * @throws InvalidParametersException if the account is not valid * @throws EntityAlreadyExistsException if the account already exists in the Datastore. */ - public AccountAttributes createAccount(AccountAttributes accountData) + AccountAttributes createAccount(AccountAttributes accountData) throws InvalidParametersException, EntityAlreadyExistsException { return accountsDb.createEntity(accountData); } @@ -55,16 +55,12 @@ public AccountAttributes getAccount(String googleId) { return accountsDb.getAccount(googleId); } - public boolean isAccountPresent(String googleId) { - return accountsDb.getAccount(googleId) != null; - } - public boolean isAccountAnInstructor(String googleId) { AccountAttributes a = accountsDb.getAccount(googleId); return a != null && a.isInstructor; } - public String getCourseInstitute(String courseId) { + private String getCourseInstitute(String courseId) { CourseAttributes cd = coursesLogic.getCourse(courseId); Assumption.assertNotNull("Trying to getCourseInstitute for inexistent course with id " + courseId, cd); List instructorList = instructorsLogic.getInstructorsForCourse(cd.getId()); @@ -248,7 +244,7 @@ public void downgradeInstructorToStudentCascade(String googleId) throws EntityDo /** * Makes an account as an instructor account. */ - public void makeAccountInstructor(String googleId) throws InvalidParametersException, EntityDoesNotExistException { + void makeAccountInstructor(String googleId) throws InvalidParametersException, EntityDoesNotExistException { accountsDb.updateAccount( AccountAttributes.updateOptionsBuilder(googleId) .withIsInstructor(true) diff --git a/src/main/java/teammates/logic/core/CoursesLogic.java b/src/main/java/teammates/logic/core/CoursesLogic.java index f1d46b79835..33ea8e72ca3 100644 --- a/src/main/java/teammates/logic/core/CoursesLogic.java +++ b/src/main/java/teammates/logic/core/CoursesLogic.java @@ -2,19 +2,13 @@ import java.time.Instant; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import teammates.common.datatransfer.AttributesDeletionQuery; -import teammates.common.datatransfer.CourseDetailsBundle; -import teammates.common.datatransfer.CourseSummaryBundle; import teammates.common.datatransfer.InstructorPrivileges; -import teammates.common.datatransfer.SectionDetailsBundle; -import teammates.common.datatransfer.TeamDetailsBundle; import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; @@ -25,9 +19,7 @@ import teammates.common.exception.TeammatesException; import teammates.common.util.Assumption; import teammates.common.util.Const; -import teammates.common.util.FieldValidator; import teammates.common.util.Logger; -import teammates.common.util.StringHelper; import teammates.storage.api.CoursesDb; /** @@ -75,7 +67,7 @@ public static CoursesLogic inst() { * @throws InvalidParametersException if the course is not valid * @throws EntityAlreadyExistsException if the course already exists in the Datastore. */ - public CourseAttributes createCourse(CourseAttributes courseToCreate) + CourseAttributes createCourse(CourseAttributes courseToCreate) throws InvalidParametersException, EntityAlreadyExistsException { return coursesDb.createEntity(courseToCreate); } @@ -134,18 +126,10 @@ public boolean isCoursePresent(String courseId) { return coursesDb.getCourse(courseId) != null; } - /** - * Returns true if the course with ID courseId is a sample course. - */ - public boolean isSampleCourse(String courseId) { - Assumption.assertNotNull("Course ID is null", courseId); - return StringHelper.isMatching(courseId, FieldValidator.REGEX_SAMPLE_COURSE_ID); - } - /** * Used to trigger an {@link EntityDoesNotExistException} if the course is not present. */ - public void verifyCourseIsPresent(String courseId) throws EntityDoesNotExistException { + void verifyCourseIsPresent(String courseId) throws EntityDoesNotExistException { if (!isCoursePresent(courseId)) { throw new EntityDoesNotExistException("Course does not exist: " + courseId); } @@ -175,220 +159,23 @@ public List getSectionsNameForCourse(String courseId) throws EntityDoesN } /** - * Returns a list of {@link SectionDetailsBundle} for a - * given course using course attributes and course details bundle. + * Returns team names for a particular courseId. * - * @param course {@link CourseAttributes} - * @param cdd {@link CourseDetailsBundle} + *

      Note: This method does not returns any Loner information presently. + * Loner information must be returned as we decide to support loners in future. */ - public List getSectionsForCourse(CourseAttributes course, CourseDetailsBundle cdd) { - Assumption.assertNotNull("Course is null", course); - - List students = studentsLogic.getStudentsForCourse(course.getId()); - StudentAttributes.sortBySectionName(students); - - List sections = new ArrayList<>(); - - SectionDetailsBundle section = null; - int teamIndexWithinSection = 0; - - for (int i = 0; i < students.size(); i++) { - - StudentAttributes s = students.get(i); - cdd.stats.studentsTotal++; - if (!s.isRegistered()) { - cdd.stats.unregisteredTotal++; - } - - if (section == null) { // First student of first section - section = new SectionDetailsBundle(); - section.name = s.section; - section.teams.add(new TeamDetailsBundle()); - cdd.stats.teamsTotal++; - section.teams.get(teamIndexWithinSection).name = s.team; - section.teams.get(teamIndexWithinSection).students.add(s); - } else if (s.section.equals(section.name)) { - if (s.team.equals(section.teams.get(teamIndexWithinSection).name)) { - section.teams.get(teamIndexWithinSection).students.add(s); - } else { - teamIndexWithinSection++; - section.teams.add(new TeamDetailsBundle()); - cdd.stats.teamsTotal++; - section.teams.get(teamIndexWithinSection).name = s.team; - section.teams.get(teamIndexWithinSection).students.add(s); - } - } else { // first student of subsequent section - sections.add(section); - if (!section.name.equals(Const.DEFAULT_SECTION)) { - cdd.stats.sectionsTotal++; - } - teamIndexWithinSection = 0; - section = new SectionDetailsBundle(); - section.name = s.section; - section.teams.add(new TeamDetailsBundle()); - cdd.stats.teamsTotal++; - section.teams.get(teamIndexWithinSection).name = s.team; - section.teams.get(teamIndexWithinSection).students.add(s); - } - - boolean isLastStudent = i == students.size() - 1; - if (isLastStudent) { - sections.add(section); - if (!section.name.equals(Const.DEFAULT_SECTION)) { - cdd.stats.sectionsTotal++; - } - } - } - - return sections; - } - - /** - * Returns a list of {@link SectionDetailsBundle} for a given course using courseId. - */ - public List getSectionsForCourseWithoutStats(String courseId) - throws EntityDoesNotExistException { - - verifyCourseIsPresent(courseId); - - List students = studentsLogic.getStudentsForCourse(courseId); - StudentAttributes.sortBySectionName(students); - - List sections = new ArrayList<>(); - - SectionDetailsBundle section = null; - int teamIndexWithinSection = 0; - - for (int i = 0; i < students.size(); i++) { - StudentAttributes s = students.get(i); - - if (section == null) { // First student of first section - section = new SectionDetailsBundle(); - section.name = s.section; - section.teams.add(new TeamDetailsBundle()); - section.teams.get(teamIndexWithinSection).name = s.team; - section.teams.get(teamIndexWithinSection).students.add(s); - } else if (s.section.equals(section.name)) { - if (s.team.equals(section.teams.get(teamIndexWithinSection).name)) { - section.teams.get(teamIndexWithinSection).students.add(s); - } else { - teamIndexWithinSection++; - section.teams.add(new TeamDetailsBundle()); - section.teams.get(teamIndexWithinSection).name = s.team; - section.teams.get(teamIndexWithinSection).students.add(s); - } - } else { // first student of subsequent section - sections.add(section); - teamIndexWithinSection = 0; - section = new SectionDetailsBundle(); - section.name = s.section; - section.teams.add(new TeamDetailsBundle()); - section.teams.get(teamIndexWithinSection).name = s.team; - section.teams.get(teamIndexWithinSection).students.add(s); - } - - boolean isLastStudent = i == students.size() - 1; - if (isLastStudent) { - sections.add(section); - } - } - - return sections; - } - - /** - * Returns Teams for a particular courseId.
      - * Note:
      - * This method does not returns any Loner information presently,
      - * Loner information must be returned as we decide to support loners
      in future. - * - */ - public List getTeamsForCourse(String courseId) throws EntityDoesNotExistException { + public List getTeamsForCourse(String courseId) throws EntityDoesNotExistException { if (getCourse(courseId) == null) { throw new EntityDoesNotExistException("The course " + courseId + " does not exist"); } - List students = studentsLogic.getStudentsForCourse(courseId); - StudentAttributes.sortByTeamName(students); - - List teams = new ArrayList<>(); - - TeamDetailsBundle team = null; - - for (int i = 0; i < students.size(); i++) { - - StudentAttributes s = students.get(i); - - // first student of first team - if (team == null) { - team = new TeamDetailsBundle(); - team.name = s.team; - team.students.add(s); - } else if (s.team.equals(team.name)) { // student in the same team as the previous student - team.students.add(s); - } else { // first student of subsequent teams (not the first team) - teams.add(team); - team = new TeamDetailsBundle(); - team.name = s.team; - team.students.add(s); - } - - // if last iteration - if (i == students.size() - 1) { - teams.add(team); - } - } - - return teams; - } - - /** - * Returns the {@link CourseDetailsBundle} course details for a course using {@link CourseAttributes}. - */ - public CourseDetailsBundle getCourseSummary(CourseAttributes cd) { - Assumption.assertNotNull("Supplied parameter was null", cd); - - CourseDetailsBundle cdd = new CourseDetailsBundle(cd); - cdd.sections = getSectionsForCourse(cd, cdd); - - return cdd; - } - - // TODO: reduce calls to this function, use above function instead. - /** - * Returns the {@link CourseDetailsBundle} course details for a course using courseId. - */ - public CourseDetailsBundle getCourseSummary(String courseId) throws EntityDoesNotExistException { - CourseAttributes cd = coursesDb.getCourse(courseId); - - if (cd == null) { - throw new EntityDoesNotExistException("The course does not exist: " + courseId); - } - - return getCourseSummary(cd); - } - - /** - * Returns the {@link CourseSummaryBundle course summary} using the {@link CourseAttributes}. - */ - public CourseSummaryBundle getCourseSummaryWithoutStats(CourseAttributes course) { - Assumption.assertNotNull("Supplied parameter was null", course); - - return new CourseSummaryBundle(course); - } - - /** - * Returns the {@link CourseSummaryBundle course summary} using the courseId. - */ - public CourseSummaryBundle getCourseSummaryWithoutStats(String courseId) throws EntityDoesNotExistException { - CourseAttributes cd = coursesDb.getCourse(courseId); - - if (cd == null) { - throw new EntityDoesNotExistException("The course does not exist: " + courseId); - } - - return getCourseSummaryWithoutStats(cd); + return studentsLogic.getStudentsForCourse(courseId) + .stream() + .map(StudentAttributes::getTeam) + .distinct() + .sorted() + .collect(Collectors.toList()); } /** @@ -407,28 +194,6 @@ public List getCoursesForStudentAccount(String googleId) { return coursesDb.getCourses(courseIds); } - /** - * Returns a list of {@link CourseAttributes} for all courses a given instructor belongs to, - * except for courses in recycle bin. - * - * @param googleId The Google ID of the instructor - */ - public List getCoursesForInstructor(String googleId) { - return getCoursesForInstructor(googleId, false); - } - - /** - * Returns a list of {@link CourseAttributes} for courses a given instructor belongs to, - * except for courses in recycle bin. - * - * @param googleId The Google ID of the instructor - * @param omitArchived if {@code true}, omits all the archived courses from the return - */ - public List getCoursesForInstructor(String googleId, boolean omitArchived) { - List instructorList = instructorsLogic.getInstructorsForGoogleId(googleId, omitArchived); - return getCoursesForInstructor(instructorList); - } - /** * Returns a list of {@link CourseAttributes} for all courses for a given list of instructors * except for courses in Recycle Bin. @@ -479,84 +244,6 @@ public List getSoftDeletedCoursesForInstructors(List - * Omits archived courses if omitArchived == true
      - * - * @param googleId The Google ID of the instructor - * @return Map with courseId as key, and CourseDetailsBundle as value. - * Does not include details within the course, such as feedback sessions. - */ - public Map getCourseSummariesForInstructor(String googleId, boolean omitArchived) - throws EntityDoesNotExistException { - - instructorsLogic.verifyInstructorExists(googleId); - - List instructorAttributesList = instructorsLogic.getInstructorsForGoogleId(googleId, - omitArchived); - - return getCourseSummariesForInstructor(instructorAttributesList); - } - - /** - * Returns course summaries for instructors.
      - * - * @return Map with courseId as key, and CourseDetailsBundle as value. - * Does not include details within the course, such as feedback sessions. - */ - public Map getCourseSummariesForInstructor( - List instructorAttributesList) { - - Map courseSummaryList = new HashMap<>(); - List courseIdList = new ArrayList<>(); - - for (InstructorAttributes instructor : instructorAttributesList) { - courseIdList.add(instructor.courseId); - } - - List courseList = coursesDb.getCourses(courseIdList); - - // Check that all courseIds queried returned a course. - if (courseIdList.size() > courseList.size()) { - for (CourseAttributes ca : courseList) { - courseIdList.remove(ca.getId()); - } - log.severe("Course(s) was deleted but the instructor still exists: " + System.lineSeparator() - + courseIdList.toString()); - } - - for (CourseAttributes ca : courseList) { - courseSummaryList.put(ca.getId(), getCourseSummary(ca)); - } - - return courseSummaryList; - } - - /** - * Returns a Map (CourseId, {@link CourseSummaryBundle} - * for all courses mapped to a given instructor. - * - * @param omitArchived if {@code true}, omits all the archived courses from the return - */ - public Map getCoursesSummaryWithoutStatsForInstructor( - String instructorId, boolean omitArchived) { - - List instructorList = instructorsLogic.getInstructorsForGoogleId(instructorId, - omitArchived); - return getCourseSummaryWithoutStatsForInstructor(instructorList); - } - /** * Updates a course by {@link CourseAttributes.UpdateOptions}. * @@ -618,75 +305,4 @@ public void restoreCourseFromRecycleBin(String courseId) throws EntityDoesNotExi coursesDb.restoreDeletedCourse(courseId); } - /** - * Restores all courses from Recycle Bin. - */ - public void restoreAllCoursesFromRecycleBin(List instructorList) - throws EntityDoesNotExistException { - Assumption.assertNotNull("Supplied parameter was null", instructorList); - - List softDeletedCourseIdList = instructorList.stream() - .filter(instructor -> coursesDb.getCourse(instructor.courseId).isCourseDeleted()) - .map(InstructorAttributes::getCourseId) - .collect(Collectors.toList()); - - for (String courseId : softDeletedCourseIdList) { - restoreCourseFromRecycleBin(courseId); - } - } - - private Map getCourseSummaryWithoutStatsForInstructor( - List instructorAttributesList) { - - Map courseSummaryList = new HashMap<>(); - - List courseIdList = instructorAttributesList.stream() - .filter(instructor -> !coursesDb.getCourse(instructor.courseId).isCourseDeleted()) - .map(InstructorAttributes::getCourseId) - .collect(Collectors.toList()); - - List courseList = coursesDb.getCourses(courseIdList); - - // Check that all courseIds queried returned a course. - if (courseIdList.size() > courseList.size()) { - for (CourseAttributes ca : courseList) { - courseIdList.remove(ca.getId()); - } - log.severe("Course(s) was deleted but the instructor still exists: " + System.lineSeparator() - + courseIdList.toString()); - } - - for (CourseAttributes ca : courseList) { - courseSummaryList.put(ca.getId(), getCourseSummaryWithoutStats(ca)); - } - - return courseSummaryList; - } - - public boolean hasIndicatedSections(String courseId) throws EntityDoesNotExistException { - verifyCourseIsPresent(courseId); - - List studentList = studentsLogic.getStudentsForCourse(courseId); - for (StudentAttributes student : studentList) { - if (!student.section.equals(Const.DEFAULT_SECTION)) { - return true; - } - } - return false; - } - - /** - * Returns a list of courseIds for all archived courses for all instructors. - */ - public List getArchivedCourseIds(List allCourses, - Map instructorsForCourses) { - List archivedCourseIds = new ArrayList<>(); - for (CourseAttributes course : allCourses) { - InstructorAttributes instructor = instructorsForCourses.get(course.getId()); - if (instructor.isArchived) { - archivedCourseIds.add(course.getId()); - } - } - return archivedCourseIds; - } } diff --git a/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java b/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java index f4c02b75f74..62c67c63e0c 100644 --- a/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackQuestionsLogic.java @@ -14,7 +14,6 @@ import teammates.common.datatransfer.AttributesDeletionQuery; import teammates.common.datatransfer.CourseRoster; import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.TeamDetailsBundle; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; @@ -185,8 +184,8 @@ public List getFeedbackQuestionsForInstructor( * Gets a {@code List} of all questions for the list of questions that an * instructor who is the creator of the course can view/submit. */ - public List getFeedbackQuestionsForCreatorInstructor( - String feedbackSessionName, String courseId) + List getFeedbackQuestionsForCreatorInstructor( + String feedbackSessionName, String courseId) throws EntityDoesNotExistException { FeedbackSessionAttributes fsa = fsLogic.getFeedbackSession(feedbackSessionName, courseId); @@ -256,22 +255,12 @@ public List getFeedbackQuestionsForStudents( return questions; } - @Deprecated - public Map getRecipientsForQuestion(FeedbackQuestionAttributes question, String giver) + Map getRecipientsForQuestion(FeedbackQuestionAttributes question, String giver) throws EntityDoesNotExistException { InstructorAttributes instructorGiver = instructorsLogic.getInstructorForEmail(question.courseId, giver); StudentAttributes studentGiver = studentsLogic.getStudentForEmail(question.courseId, giver); - return getRecipientsForQuestion(question, giver, instructorGiver, studentGiver); - } - - @Deprecated - public Map getRecipientsForQuestion( - FeedbackQuestionAttributes question, String giver, - InstructorAttributes instructorGiver, StudentAttributes studentGiver) - throws EntityDoesNotExistException { - Map recipients = new HashMap<>(); FeedbackParticipantType recipientType = question.recipientType; @@ -305,12 +294,12 @@ public Map getRecipientsForQuestion( } break; case TEAMS: - List teams = coursesLogic.getTeamsForCourse(question.courseId); - for (TeamDetailsBundle team : teams) { + List teams = coursesLogic.getTeamsForCourse(question.courseId); + for (String team : teams) { // Ensure student('s team) does not evaluate own team. - if (!giverTeam.equals(team.name)) { + if (!giverTeam.equals(team)) { // recipientEmail doubles as team name in this case. - recipients.put(team.name, team.name); + recipients.put(team, team); } } break; @@ -428,7 +417,7 @@ public Map getRecipientsOfQuestion( teamToTeamMembersTable = courseRoster.getTeamToMembersTable(); } for (Map.Entry> team : teamToTeamMembersTable.entrySet()) { - if (isInstructorGiver && instructorGiver.isAllowedForPrivilege( + if (isInstructorGiver && !instructorGiver.isAllowedForPrivilege( team.getValue().iterator().next().getSection(), question.getFeedbackSessionName(), Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)) { @@ -621,14 +610,14 @@ public void populateFieldsToGenerateInQuestion(FeedbackQuestionAttributes feedba //fallthrough case TEAMS_EXCLUDING_SELF: try { - List teamList = coursesLogic.getTeamsForCourse(feedbackQuestionAttributes.getCourseId()); + List teams = coursesLogic.getTeamsForCourse(feedbackQuestionAttributes.getCourseId()); if (generateOptionsFor == FeedbackParticipantType.TEAMS_EXCLUDING_SELF) { - teamList.removeIf(teamInList -> teamInList.name.equals(teamOfEntityDoingQuestion)); + teams.removeIf(team -> team.equals(teamOfEntityDoingQuestion)); } - for (TeamDetailsBundle team : teamList) { - optionList.add(team.name); + for (String team : teams) { + optionList.add(team); } optionList.sort(null); @@ -836,8 +825,8 @@ public int getNumOfGeneratedChoicesForParticipantType(String courseId, FeedbackP if (participantType == FeedbackParticipantType.TEAMS || participantType == FeedbackParticipantType.TEAMS_EXCLUDING_SELF) { try { - List teamList = coursesLogic.getTeamsForCourse(courseId); - return teamList.size() - (participantType == FeedbackParticipantType.TEAMS ? 0 : 1); + List teams = coursesLogic.getTeamsForCourse(courseId); + return teams.size() - (participantType == FeedbackParticipantType.TEAMS ? 0 : 1); } catch (EntityDoesNotExistException e) { Assumption.fail("Course disappeared"); } diff --git a/src/main/java/teammates/logic/core/FeedbackResponseCommentsLogic.java b/src/main/java/teammates/logic/core/FeedbackResponseCommentsLogic.java index 59804b8923d..a468d4e0664 100644 --- a/src/main/java/teammates/logic/core/FeedbackResponseCommentsLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackResponseCommentsLogic.java @@ -10,7 +10,6 @@ import teammates.common.datatransfer.CourseRoster; import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.datatransfer.FeedbackResponseCommentSearchResultBundle; -import teammates.common.datatransfer.TeamDetailsBundle; import teammates.common.datatransfer.UserRole; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; @@ -90,11 +89,6 @@ public FeedbackResponseCommentAttributes getFeedbackResponseCommentForResponseFr return frcDb.getFeedbackResponseCommentForResponseFromParticipant(feedbackResponseId); } - public List getFeedbackResponseCommentForSession(String courseId, - String feedbackSessionName) { - return frcDb.getFeedbackResponseCommentsForSession(courseId, feedbackSessionName); - } - /** * Gets all feedback response comments for session in a section. * @@ -163,13 +157,6 @@ public FeedbackResponseCommentAttributes updateFeedbackResponseComment( return frcDb.updateFeedbackResponseComment(updateOptions); } - /** - * Creates or updates document for the given comment. - */ - public void putDocument(FeedbackResponseCommentAttributes comment) { - frcDb.putDocument(comment); - } - /** * Creates or updates documents for the given comments. */ @@ -406,10 +393,10 @@ private void verifyIsUserOfCourse(String courseId, String commentGiver, Feedback } break; case TEAMS: - List teams = coursesLogic.getTeamsForCourse(courseId); + List teams = coursesLogic.getTeamsForCourse(courseId); boolean isTeamPresentInCourse = false; - for (TeamDetailsBundle team : teams) { - if (team.name.equals(commentGiver)) { + for (String team : teams) { + if (team.equals(commentGiver)) { isTeamPresentInCourse = true; break; } diff --git a/src/main/java/teammates/logic/core/FeedbackResponsesLogic.java b/src/main/java/teammates/logic/core/FeedbackResponsesLogic.java index ad143489bec..6802184ad09 100644 --- a/src/main/java/teammates/logic/core/FeedbackResponsesLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackResponsesLogic.java @@ -1,6 +1,7 @@ package teammates.logic.core; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -90,7 +91,7 @@ public FeedbackResponseAttributes getFeedbackResponse( /** * Gets all responses for a session. */ - public List getFeedbackResponsesForSession( + List getFeedbackResponsesForSession( String feedbackSessionName, String courseId) { return frDb.getFeedbackResponsesForSession(feedbackSessionName, courseId); } @@ -148,6 +149,14 @@ public List getFeedbackResponsesFromGiverForQuestion return frDb.getFeedbackResponsesFromGiverForQuestion(feedbackQuestionId, userEmail); } + /** + * Gets all responses received by an user for a question. + */ + private List getFeedbackResponsesForReceiverForQuestion( + String feedbackQuestionId, String userEmail) { + return frDb.getFeedbackResponsesForReceiverForQuestion(feedbackQuestionId, userEmail); + } + /** * Checks whether a giver has responded a session. */ @@ -180,7 +189,7 @@ public List getFeedbackResponsesFromStudentOrTeamFor FeedbackQuestionAttributes question, StudentAttributes student) { if (question.giverType == FeedbackParticipantType.TEAMS) { return getFeedbackResponsesFromTeamForQuestion( - question.getId(), question.courseId, student.team); + question.getId(), question.courseId, student.team, null); } return frDb.getFeedbackResponsesFromGiverForQuestion(question.getId(), student.email); } @@ -201,7 +210,9 @@ public boolean isNameVisibleToUser( // Early return if user is giver if (question.giverType == FeedbackParticipantType.TEAMS) { // if response is given by team, then anyone in the team can see the response - if (roster.isStudentsInSameTeam(response.giver, userEmail)) { + // The second check is used to accommodate legacy data where team giver is a student email + if (roster.isStudentInTeam(userEmail, response.giver) + || roster.isStudentsInSameTeam(userEmail, response.giver)) { return true; } } else { @@ -750,11 +761,11 @@ private void deleteFeedbackResponsesInvolvedEntityOfCourseCascade( } private List getFeedbackResponsesFromTeamForQuestion( - String feedbackQuestionId, String courseId, String teamName) { + String feedbackQuestionId, String courseId, String teamName, @Nullable CourseRoster courseRoster) { List responses = new ArrayList<>(); - List studentsInTeam = - studentsLogic.getStudentsForTeam(teamName, courseId); + List studentsInTeam = courseRoster == null + ? studentsLogic.getStudentsForTeam(teamName, courseId) : courseRoster.getTeamToMembersTable().get(teamName); for (StudentAttributes student : studentsInTeam) { responses.addAll(frDb.getFeedbackResponsesFromGiverForQuestion( @@ -766,4 +777,89 @@ private List getFeedbackResponsesFromTeamForQuestion return responses; } + + /** + * Returns viewable feedback responses for a student. + */ + public List getViewableFeedbackResponsesForStudentForQuestion( + FeedbackQuestionAttributes question, StudentAttributes student, CourseRoster courseRoster) { + UniqueResponsesSet viewableResponses = new UniqueResponsesSet(); + + // Add responses that the student submitted himself + viewableResponses.addNewResponses( + getFeedbackResponsesFromGiverForQuestion(question.getFeedbackQuestionId(), student.getEmail()) + ); + + // Add responses that user is a receiver of when question is visible to + // receiver. + if (question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER)) { + viewableResponses.addNewResponses( + getFeedbackResponsesForReceiverForQuestion(question.getFeedbackQuestionId(), student.getEmail()) + ); + } + + if (question.isResponseVisibleTo(FeedbackParticipantType.STUDENTS)) { + viewableResponses.addNewResponses(getFeedbackResponsesForQuestion(question.getId())); + + // Early return as STUDENTS covers all cases below. + return viewableResponses.getResponses(); + } + + if (question.getRecipientType().isTeam() + && question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER)) { + viewableResponses.addNewResponses( + getFeedbackResponsesForReceiverForQuestion(question.getId(), student.getTeam()) + ); + } + + if (question.getGiverType() == FeedbackParticipantType.TEAMS + || question.isResponseVisibleTo(FeedbackParticipantType.OWN_TEAM_MEMBERS)) { + viewableResponses.addNewResponses( + getFeedbackResponsesFromTeamForQuestion( + question.getId(), question.getCourseId(), student.getTeam(), courseRoster)); + } + + if (question.isResponseVisibleTo(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS)) { + for (StudentAttributes studentInTeam : courseRoster.getTeamToMembersTable().get(student.getTeam())) { + if (studentInTeam.getEmail().equals(student.getEmail())) { + continue; + } + List responses = + frDb.getFeedbackResponsesForReceiverForQuestion(question.getId(), studentInTeam.getEmail()); + viewableResponses.addNewResponses(responses); + } + } + + return viewableResponses.getResponses(); + } + + /** + * Set contains only unique response. + */ + private static class UniqueResponsesSet { + + private final Set responseIds; + private final List responses; + + private UniqueResponsesSet() { + responseIds = new HashSet<>(); + responses = new ArrayList<>(); + } + + private void addNewResponses(Collection newResponses) { + newResponses.forEach(this::addNewResponse); + } + + private void addNewResponse(FeedbackResponseAttributes newResponse) { + if (responseIds.contains(newResponse.getId())) { + return; + } + responseIds.add(newResponse.getId()); + responses.add(newResponse); + } + + private List getResponses() { + return responses; + } + } } diff --git a/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java b/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java index 4776d983ea1..7ac41541d9e 100644 --- a/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java +++ b/src/main/java/teammates/logic/core/FeedbackSessionsLogic.java @@ -16,7 +16,6 @@ import teammates.common.datatransfer.AttributesDeletionQuery; import teammates.common.datatransfer.CourseRoster; import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.FeedbackSessionDetailsBundle; import teammates.common.datatransfer.SessionResultsBundle; import teammates.common.datatransfer.UserRole; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; @@ -174,28 +173,35 @@ public List getSoftDeletedFeedbackSessionsListForInst */ public List getFeedbackSessionsWhichNeedAutomatedPublishedEmailsToBeSent() { List sessions = fsDb.getFeedbackSessionsPossiblyNeedingPublishedEmail(); + log.info(String.format("Number of sessions under consideration: %d", sessions.size())); List sessionsToSendEmailsFor = new ArrayList<>(); for (FeedbackSessionAttributes session : sessions) { // automated emails are required only for custom publish times - if (!coursesLogic.getCourse(session.getCourseId()).isCourseDeleted() - && session.isPublished() - && !TimeHelper.isSpecialTime(session.getResultsVisibleFromTime())) { + if (session.isPublished() + && !TimeHelper.isSpecialTime(session.getResultsVisibleFromTime()) + && !coursesLogic.getCourse(session.getCourseId()).isCourseDeleted()) { sessionsToSendEmailsFor.add(session); } } + log.info(String.format("Number of sessions under consideration after filtering: %d", + sessionsToSendEmailsFor.size())); return sessionsToSendEmailsFor; } public List getFeedbackSessionsWhichNeedOpenEmailsToBeSent() { List sessions = fsDb.getFeedbackSessionsPossiblyNeedingOpenEmail(); List sessionsToSendEmailsFor = new ArrayList<>(); + log.info(String.format("Number of sessions under consideration: %d", sessions.size())); for (FeedbackSessionAttributes session : sessions) { - if (!coursesLogic.getCourse(session.getCourseId()).isCourseDeleted() && session.isOpened()) { + if (session.isOpened() && !coursesLogic.getCourse(session.getCourseId()).isCourseDeleted()) { sessionsToSendEmailsFor.add(session); } } + + log.info(String.format("Number of sessions under consideration after filtering: %d", + sessionsToSendEmailsFor.size())); return sessionsToSendEmailsFor; } @@ -204,7 +210,7 @@ public boolean isCreatorOfSession(String feedbackSessionName, String courseId, S return fs.getCreatorEmail().equals(userEmail); } - public boolean isFeedbackSessionExists(String feedbackSessionName, String courseId) { + private boolean isFeedbackSessionExists(String feedbackSessionName, String courseId) { return fsDb.getFeedbackSession(courseId, feedbackSessionName) != null; } @@ -507,14 +513,17 @@ public List getFeedbackSessionsClosingWithinTimeLimit List requiredSessions = new ArrayList<>(); List sessions = fsDb.getFeedbackSessionsPossiblyNeedingClosingEmail(); + log.info(String.format("Number of sessions under consideration: %d", sessions.size())); for (FeedbackSessionAttributes session : sessions) { - if (!coursesLogic.getCourse(session.getCourseId()).isCourseDeleted() - && session.isClosingWithinTimeLimit(SystemParams.NUMBER_OF_HOURS_BEFORE_CLOSING_ALERT)) { + if (session.isClosingWithinTimeLimit(SystemParams.NUMBER_OF_HOURS_BEFORE_CLOSING_ALERT) + && !coursesLogic.getCourse(session.getCourseId()).isCourseDeleted()) { requiredSessions.add(session); } } + log.info(String.format("Number of sessions under consideration after filtering: %d", + requiredSessions.size())); return requiredSessions; } @@ -524,13 +533,17 @@ public List getFeedbackSessionsClosingWithinTimeLimit public List getFeedbackSessionsClosedWithinThePastHour() { List requiredSessions = new ArrayList<>(); List sessions = fsDb.getFeedbackSessionsPossiblyNeedingClosedEmail(); + log.info(String.format("Number of sessions under consideration: %d", sessions.size())); for (FeedbackSessionAttributes session : sessions) { // is session closed in the past 1 hour - if (!coursesLogic.getCourse(session.getCourseId()).isCourseDeleted() && session.isClosedWithinPastHour()) { + if (session.isClosedWithinPastHour() + && !coursesLogic.getCourse(session.getCourseId()).isCourseDeleted()) { requiredSessions.add(session); } } + log.info(String.format("Number of sessions under consideration after filtering: %d", + requiredSessions.size())); return requiredSessions; } @@ -575,49 +588,37 @@ public void restoreFeedbackSessionFromRecycleBin(String feedbackSessionName, Str } /** - * Gets the stats of a feedback session. - */ - public FeedbackSessionDetailsBundle getFeedbackSessionDetails(String feedbackSessionName, String courseId) - throws EntityDoesNotExistException { - FeedbackSessionAttributes fsa = getFeedbackSession(feedbackSessionName, courseId); - if (fsa == null) { - throw new EntityDoesNotExistException("Feedback session does not exist"); - } - return getFeedbackSessionDetails(fsa); - } - - /** - * Gets the stats of a feedback session. + * Gets the expected number of submissions for a feedback session. */ - private FeedbackSessionDetailsBundle getFeedbackSessionDetails(FeedbackSessionAttributes fsa) { - - FeedbackSessionDetailsBundle details = - new FeedbackSessionDetailsBundle(fsa); - - details.stats.expectedTotal = 0; - details.stats.submittedTotal = 0; - + public int getExpectedTotalSubmission(FeedbackSessionAttributes fsa) { List students = studentsLogic.getStudentsForCourse(fsa.getCourseId()); List instructors = instructorsLogic.getInstructorsForCourse(fsa.getCourseId()); List questions = fqLogic.getFeedbackQuestionsForSession(fsa.getFeedbackSessionName(), fsa.getCourseId()); List studentQns = fqLogic.getFeedbackQuestionsForStudents(questions); + int expectedTotal = 0; + if (!studentQns.isEmpty()) { - details.stats.expectedTotal += students.size(); + expectedTotal += students.size(); } for (InstructorAttributes instructor : instructors) { List instructorQns = fqLogic.getFeedbackQuestionsForInstructor(questions, fsa.isCreator(instructor.email)); if (!instructorQns.isEmpty()) { - details.stats.expectedTotal += 1; + expectedTotal += 1; } } - details.stats.submittedTotal += fsa.getRespondingStudentList().size() + fsa.getRespondingInstructorList().size(); + return expectedTotal; + } - return details; + /** + * Gets the actual number of submissions for a feedback session. + */ + public int getActualTotalSubmission(FeedbackSessionAttributes fsa) { + return fsa.getRespondingStudentList().size() + fsa.getRespondingInstructorList().size(); } /** @@ -638,26 +639,45 @@ public SessionResultsBundle getSessionResultsForUser( studentsLogic.getStudentsForCourse(courseId), instructorsLogic.getInstructorsForCourse(courseId)); - FeedbackSessionAttributes session = fsDb.getFeedbackSession(courseId, feedbackSessionName); - // load question(s) List allQuestions; Map allQuestionsMap = new HashMap<>(); if (questionId == null) { allQuestions = fqLogic.getFeedbackQuestionsForSession(feedbackSessionName, courseId); } else { - allQuestions = Collections.singletonList(fqLogic.getFeedbackQuestion(questionId)); + FeedbackQuestionAttributes fqa = fqLogic.getFeedbackQuestion(questionId); + if (fqa == null) { + allQuestions = Collections.emptyList(); + } else { + allQuestions = Collections.singletonList(fqa); + } } for (FeedbackQuestionAttributes qn : allQuestions) { allQuestionsMap.put(qn.getId(), qn); } // load response(s) + StudentAttributes student = getStudent(courseId, userEmail, role); List allResponses; - if (questionId == null) { - allResponses = frLogic.getFeedbackResponsesForSessionInSection(feedbackSessionName, courseId, section); + if (isInstructor(role)) { + // load all response for instructors and passively filter them later + if (questionId == null) { + allResponses = frLogic.getFeedbackResponsesForSessionInSection(feedbackSessionName, courseId, section); + } else { + allResponses = frLogic.getFeedbackResponsesForQuestionInSection(questionId, section); + } } else { - allResponses = frLogic.getFeedbackResponsesForQuestionInSection(questionId, section); + if (section != null) { + throw new UnsupportedOperationException("Specify section filtering is not supported for student result"); + } + allResponses = new ArrayList<>(); + // load viewable responses for students proactively + // this is cost-effective as in most of time responses for the whole session will not be viewable to students + for (FeedbackQuestionAttributes question : allQuestions) { + List viewableResponses = + frLogic.getViewableFeedbackResponsesForStudentForQuestion(question, student, roster); + allResponses.addAll(viewableResponses); + } } // load comment(s) @@ -681,7 +701,6 @@ public SessionResultsBundle getSessionResultsForUser( } // consider the current viewing user - StudentAttributes student = getStudent(courseId, userEmail, role); Set studentsEmailInTeam = getTeammateEmails(student, roster); InstructorAttributes instructor = getInstructor(courseId, userEmail, role); @@ -733,6 +752,7 @@ public SessionResultsBundle getSessionResultsForUser( List existingResponses = new ArrayList<>(relatedResponsesMap.values()); List missingResponses = Collections.emptyList(); + FeedbackSessionAttributes session = fsDb.getFeedbackSession(courseId, feedbackSessionName); if (role == UserRole.INSTRUCTOR) { missingResponses = buildMissingResponses( instructor, responseVisibilityTable, session, diff --git a/src/main/java/teammates/logic/core/InstructorsLogic.java b/src/main/java/teammates/logic/core/InstructorsLogic.java index f2eaa2db4e6..dcfb3efb6d8 100644 --- a/src/main/java/teammates/logic/core/InstructorsLogic.java +++ b/src/main/java/teammates/logic/core/InstructorsLogic.java @@ -14,7 +14,6 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Assumption; import teammates.common.util.Logger; -import teammates.common.util.StringHelper; import teammates.storage.api.InstructorsDb; /** @@ -31,8 +30,6 @@ public final class InstructorsLogic { private static final InstructorsDb instructorsDb = new InstructorsDb(); - private static final AccountsLogic accountsLogic = AccountsLogic.inst(); - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); private static final FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); private static final FeedbackResponseCommentsLogic frcLogic = FeedbackResponseCommentsLogic.inst(); private static final FeedbackQuestionsLogic fqLogic = FeedbackQuestionsLogic.inst(); @@ -135,59 +132,8 @@ public List getInstructorsForGoogleId(String googleId, boo return instructorsDb.getInstructorsForGoogleId(googleId, omitArchived); } - public String getEncryptedKeyForInstructor(String courseId, String email) - throws EntityDoesNotExistException { - - verifyIsEmailOfInstructorOfCourse(email, courseId); - - InstructorAttributes instructor = getInstructorForEmail(courseId, email); - - return StringHelper.encrypt(instructor.key); - } - - public boolean isGoogleIdOfInstructorOfCourse(String instructorId, String courseId) { - - return instructorsDb.getInstructorForGoogleId(courseId, instructorId) != null; - } - - public boolean isEmailOfInstructorOfCourse(String instructorEmail, String courseId) { - - return instructorsDb.getInstructorForEmail(courseId, instructorEmail) != null; - } - - /** - * Returns whether the instructor is a new user, according to one of the following criteria: - *

        - *
      • There is only a sample course (created by system) for the instructor.
      • - *
      • There is no any course for the instructor.
      • - *
      - */ - public boolean isNewInstructor(String googleId) { - List instructorList = getInstructorsForGoogleId(googleId); - return instructorList.isEmpty() - || instructorList.size() == 1 && coursesLogic.isSampleCourse(instructorList.get(0).courseId); - } - - public void verifyInstructorExists(String instructorId) - throws EntityDoesNotExistException { - - if (!accountsLogic.isAccountAnInstructor(instructorId)) { - throw new EntityDoesNotExistException("Instructor does not exist :" - + instructorId); - } - } - - public void verifyIsEmailOfInstructorOfCourse(String instructorEmail, String courseId) - throws EntityDoesNotExistException { - - if (!isEmailOfInstructorOfCourse(instructorEmail, courseId)) { - throw new EntityDoesNotExistException("Instructor " + instructorEmail - + " does not belong to course " + courseId); - } - } - - public void verifyAtLeastOneInstructorIsDisplayed(String courseId, boolean isOriginalInstructorDisplayed, - boolean isEditedInstructorDisplayed) + void verifyAtLeastOneInstructorIsDisplayed(String courseId, boolean isOriginalInstructorDisplayed, + boolean isEditedInstructorDisplayed) throws InvalidParametersException { List instructorsDisplayed = instructorsDb.getInstructorsDisplayedToStudents(courseId); boolean isEditedInstructorChangedToNonVisible = isOriginalInstructorDisplayed && !isEditedInstructorDisplayed; diff --git a/src/main/java/teammates/logic/core/StudentsLogic.java b/src/main/java/teammates/logic/core/StudentsLogic.java index 081830553a9..07ad15c20cf 100644 --- a/src/main/java/teammates/logic/core/StudentsLogic.java +++ b/src/main/java/teammates/logic/core/StudentsLogic.java @@ -6,7 +6,6 @@ import teammates.common.datatransfer.AttributesDeletionQuery; import teammates.common.datatransfer.StudentSearchResultBundle; -import teammates.common.datatransfer.TeamDetailsBundle; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.EnrollException; @@ -16,8 +15,6 @@ import teammates.common.exception.RegenerateStudentException; import teammates.common.util.Assumption; import teammates.common.util.Const; -import teammates.common.util.SanitizationHelper; -import teammates.common.util.StringHelper; import teammates.storage.api.StudentsDb; /** @@ -85,10 +82,6 @@ public List getStudentsForTeam(String teamName, String course return studentsDb.getStudentsForTeam(teamName, courseId); } - public List getStudentsForSection(String sectionName, String courseId) { - return studentsDb.getStudentsForSection(sectionName, courseId); - } - public List getUnregisteredStudentsForCourse(String courseId) { return studentsDb.getUnregisteredStudentsForCourse(courseId); } @@ -107,26 +100,11 @@ public StudentSearchResultBundle searchStudentsInWholeSystem(String queryString) return studentsDb.searchStudentsInWholeSystem(queryString); } - public String getEncryptedKeyForStudent(String courseId, String email) throws EntityDoesNotExistException { - - StudentAttributes studentData = getStudentForEmail(courseId, email); - - if (studentData == null) { - throw new EntityDoesNotExistException("Student does not exist: [" + courseId + "/" + email + "]"); - } - - return StringHelper.encrypt(studentData.key); - } - public boolean isStudentInAnyCourse(String googleId) { return studentsDb.getStudentsForGoogleId(googleId).size() != 0; } - public boolean isStudentInCourse(String courseId, String studentEmail) { - return studentsDb.getStudentForEmail(courseId, studentEmail) != null; - } - - public boolean isStudentInTeam(String courseId, String teamName, String studentEmail) { + boolean isStudentInTeam(String courseId, String teamName, String studentEmail) { StudentAttributes student = getStudentForEmail(courseId, studentEmail); if (student == null) { @@ -247,25 +225,6 @@ public void validateSectionsAndTeams(List studentList, String } - /** - * Validates teams for any team name violations. - */ - public void validateTeams(List studentList, String courseId) throws EnrollException { - - List mergedList = getMergedList(studentList, courseId); - - if (mergedList.size() < 2) { // no conflicts - return; - } - - String errorMessage = getTeamInvalidityInfo(mergedList); - - if (errorMessage.length() > 0) { - throw new EnrollException(errorMessage); - } - - } - private List getMergedList(List studentList, String courseId) { List mergedList = new ArrayList<>(); @@ -345,8 +304,8 @@ private String getTeamInvalidityInfo(List mergedList) { errorMessage.add(String.format(Const.StudentsLogicConst.ERROR_INVALID_TEAM_NAME, currentStudent.team, - SanitizationHelper.sanitizeForHtml(previousStudent.section), - SanitizationHelper.sanitizeForHtml(currentStudent.section))); + previousStudent.section, + currentStudent.section)); invalidTeamList.add(currentStudent.team); } @@ -434,15 +393,4 @@ private boolean isSectionChanged(String originalSection, String newSection) { && !originalSection.equals(newSection); } - public TeamDetailsBundle getTeamDetailsForStudent(StudentAttributes student) { - if (student != null) { - TeamDetailsBundle teamResult = new TeamDetailsBundle(); - teamResult.name = student.team; - teamResult.students = getStudentsForTeam(student.team, student.course); - StudentAttributes.sortByNameAndThenByEmail(teamResult.students); - return teamResult; - } - return null; - } - } diff --git a/src/main/java/teammates/logic/core/TaskQueuesLogic.java b/src/main/java/teammates/logic/core/TaskQueuesLogic.java index 64bc82ec443..b1862630b65 100644 --- a/src/main/java/teammates/logic/core/TaskQueuesLogic.java +++ b/src/main/java/teammates/logic/core/TaskQueuesLogic.java @@ -1,11 +1,10 @@ package teammates.logic.core; -import java.util.Map; - import com.google.appengine.api.taskqueue.Queue; import com.google.appengine.api.taskqueue.QueueFactory; import com.google.appengine.api.taskqueue.TaskOptions; +import teammates.common.util.JsonUtils; import teammates.common.util.TaskWrapper; /** @@ -35,13 +34,11 @@ public void addDeferredTask(TaskWrapper task, long countdownTime) { taskToBeAdded.countdownMillis(countdownTime); } - for (Map.Entry entry : task.getParamMap().entrySet()) { - String name = entry.getKey(); - String[] values = entry.getValue(); - - for (String value : values) { - taskToBeAdded = taskToBeAdded.param(name, value); - } + // GAE's Task Queue API only allows either parameter map or body, not both + if (task.getRequestBody() == null) { + task.getParamMap().forEach((key, value) -> taskToBeAdded.param(key, value)); + } else { + taskToBeAdded.payload(JsonUtils.toCompactJson(task.getRequestBody())); } requiredQueue.add(taskToBeAdded); diff --git a/src/main/java/teammates/storage/api/AccountsDb.java b/src/main/java/teammates/storage/api/AccountsDb.java index d76600d8b91..e19d9d4520d 100644 --- a/src/main/java/teammates/storage/api/AccountsDb.java +++ b/src/main/java/teammates/storage/api/AccountsDb.java @@ -88,18 +88,18 @@ private Account getAccountEntity(String googleId) { } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(Account.class); } @Override - protected boolean hasExistingEntities(AccountAttributes entityToCreate) { + boolean hasExistingEntities(AccountAttributes entityToCreate) { Key keyToFind = Key.create(Account.class, entityToCreate.getGoogleId()); return !load().filterKey(keyToFind).keys().list().isEmpty(); } @Override - protected AccountAttributes makeAttributes(Account entity) { + AccountAttributes makeAttributes(Account entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return AccountAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/CoursesDb.java b/src/main/java/teammates/storage/api/CoursesDb.java index 94e852e70aa..9577e56e5cf 100644 --- a/src/main/java/teammates/storage/api/CoursesDb.java +++ b/src/main/java/teammates/storage/api/CoursesDb.java @@ -128,12 +128,12 @@ public void restoreDeletedCourse(String courseId) throws EntityDoesNotExistExcep } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(Course.class); } @Override - protected boolean hasExistingEntities(CourseAttributes entityToCreate) { + boolean hasExistingEntities(CourseAttributes entityToCreate) { Key keyToFind = Key.create(Course.class, entityToCreate.getId()); return !load().filterKey(keyToFind).keys().list().isEmpty(); } @@ -152,7 +152,7 @@ private List getCourseEntities(List courseIds) { } @Override - protected CourseAttributes makeAttributes(Course entity) { + CourseAttributes makeAttributes(Course entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return CourseAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/EntitiesDb.java b/src/main/java/teammates/storage/api/EntitiesDb.java index bb2c489d792..68391990d7e 100644 --- a/src/main/java/teammates/storage/api/EntitiesDb.java +++ b/src/main/java/teammates/storage/api/EntitiesDb.java @@ -34,25 +34,25 @@ * @param Specific entity class * @param Specific attributes class */ -public abstract class EntitiesDb> { +abstract class EntitiesDb> { /** * Error message when trying to create entity that already exist. */ - public static final String ERROR_CREATE_ENTITY_ALREADY_EXISTS = "Trying to create an entity that exists: %s"; + static final String ERROR_CREATE_ENTITY_ALREADY_EXISTS = "Trying to create an entity that exists: %s"; /** * Error message when trying to update entity that does not exist. */ - public static final String ERROR_UPDATE_NON_EXISTENT = "Trying to update non-existent Entity: "; + static final String ERROR_UPDATE_NON_EXISTENT = "Trying to update non-existent Entity: "; /** * Info message when entity is not saved because it does not change. */ - public static final String OPTIMIZED_SAVING_POLICY_APPLIED = + static final String OPTIMIZED_SAVING_POLICY_APPLIED = "Saving request is not issued because entity %s does not change by the update (%s)"; - protected static final Logger log = Logger.getLogger(); + static final Logger log = Logger.getLogger(); /** * Creates the entity in the Datastore. @@ -91,7 +91,7 @@ private A createEntity(A entityToAdd, boolean shouldCheckExistence) /** * Checks whether there are existing entities in the Datastore. */ - protected abstract boolean hasExistingEntities(A entityToCreate); + abstract boolean hasExistingEntities(A entityToCreate); /** * Puts an entity in the datastore without existence checking. @@ -145,14 +145,14 @@ public List putEntities(Collection entitiesToAdd) throws InvalidParameters /** * Checks whether two values are the same. */ - protected boolean hasSameValue(T oldValue, T newValue) { + boolean hasSameValue(T oldValue, T newValue) { return Objects.equal(oldValue, newValue); } /** * Saves an entity. */ - protected void saveEntity(E entityToSave) { + void saveEntity(E entityToSave) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entityToSave); log.info("Entity saved: " + JsonUtils.toJson(entityToSave)); @@ -163,7 +163,7 @@ protected void saveEntity(E entityToSave) { /** * Saves a collection of entities. */ - protected void saveEntities(Collection entitiesToSave) { + void saveEntities(Collection entitiesToSave) { for (E entityToSave : entitiesToSave) { log.info("Entity saved: " + JsonUtils.toJson(entityToSave)); } @@ -174,7 +174,7 @@ protected void saveEntities(Collection entitiesToSave) { /** * Deletes entity by key. */ - protected void deleteEntity(Key... keys) { + void deleteEntity(Key... keys) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, (Object) keys); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, (Object[]) keys); @@ -185,17 +185,17 @@ protected void deleteEntity(Key... keys) { ofy().delete().keys(keys).now(); } - protected abstract LoadType load(); + abstract LoadType load(); /** * Converts from entity to attributes. */ - protected abstract A makeAttributes(E entity); + abstract A makeAttributes(E entity); /** * Converts a collection of entities to a list of attributes. */ - protected List makeAttributes(Collection entities) { + List makeAttributes(Collection entities) { List attributes = new LinkedList<>(); for (E entity : entities) { attributes.add(makeAttributes(entity)); @@ -208,7 +208,7 @@ protected List makeAttributes(Collection entities) { * * @return null if the original entity is null */ - protected A makeAttributesOrNull(E entity) { + A makeAttributesOrNull(E entity) { if (entity != null) { return makeAttributes(entity); } @@ -218,7 +218,7 @@ protected A makeAttributesOrNull(E entity) { /** * Creates a key from a web safe string. */ - protected Optional> makeKeyFromWebSafeString(String webSafeString) { + Optional> makeKeyFromWebSafeString(String webSafeString) { if (webSafeString == null) { return Optional.empty(); } @@ -232,7 +232,7 @@ protected Optional> makeKeyFromWebSafeString(String webSafeString) { /** * Puts document(s) into the search engine. */ - protected void putDocument(String indexName, SearchDocument... documents) { + void putDocument(String indexName, SearchDocument... documents) { List searchDocuments = new ArrayList<>(); for (SearchDocument document : documents) { try { @@ -251,7 +251,7 @@ protected void putDocument(String indexName, SearchDocument... documents) { /** * Searches documents with query. */ - protected Results searchDocuments(String indexName, SearchQuery query) { + Results searchDocuments(String indexName, SearchQuery query) { try { if (query.getFilterSize() > 0) { return SearchManager.searchDocuments(indexName, query.toQuery()); @@ -266,7 +266,7 @@ protected Results searchDocuments(String indexName, SearchQuery /** * Deletes document by documentId(s). */ - protected void deleteDocument(String indexName, String... documentIds) { + void deleteDocument(String indexName, String... documentIds) { try { SearchManager.deleteDocument(indexName, documentIds); } catch (Exception e) { diff --git a/src/main/java/teammates/storage/api/FeedbackQuestionsDb.java b/src/main/java/teammates/storage/api/FeedbackQuestionsDb.java index 134a6eb4e7c..01944e56b2b 100644 --- a/src/main/java/teammates/storage/api/FeedbackQuestionsDb.java +++ b/src/main/java/teammates/storage/api/FeedbackQuestionsDb.java @@ -197,12 +197,12 @@ private List getFeedbackQuestionEntitiesForGiverType( } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(FeedbackQuestion.class); } @Override - protected boolean hasExistingEntities(FeedbackQuestionAttributes entityToCreate) { + boolean hasExistingEntities(FeedbackQuestionAttributes entityToCreate) { return !load() .filter("feedbackSessionName =", entityToCreate.getFeedbackSessionName()) .filter("courseId =", entityToCreate.getCourseId()) @@ -213,7 +213,7 @@ protected boolean hasExistingEntities(FeedbackQuestionAttributes entityToCreate) } @Override - protected FeedbackQuestionAttributes makeAttributes(FeedbackQuestion entity) { + FeedbackQuestionAttributes makeAttributes(FeedbackQuestion entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return FeedbackQuestionAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java b/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java index dc39888de8e..77c37b93318 100644 --- a/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java +++ b/src/main/java/teammates/storage/api/FeedbackResponseCommentsDb.java @@ -475,18 +475,18 @@ private Collection getFeedbackResponseCommentEntitiesFo } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(FeedbackResponseComment.class); } @Override - protected boolean hasExistingEntities(FeedbackResponseCommentAttributes entityToCreate) { + boolean hasExistingEntities(FeedbackResponseCommentAttributes entityToCreate) { // comment does not have unique constraint return false; } @Override - protected FeedbackResponseCommentAttributes makeAttributes(FeedbackResponseComment entity) { + FeedbackResponseCommentAttributes makeAttributes(FeedbackResponseComment entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return FeedbackResponseCommentAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/FeedbackResponsesDb.java b/src/main/java/teammates/storage/api/FeedbackResponsesDb.java index eea5dde79a5..408dfc4fc01 100644 --- a/src/main/java/teammates/storage/api/FeedbackResponsesDb.java +++ b/src/main/java/teammates/storage/api/FeedbackResponsesDb.java @@ -150,6 +150,17 @@ public List getFeedbackResponsesFromGiverForQuestion return makeAttributes(getFeedbackResponseEntitiesFromGiverForQuestion(feedbackQuestionId, giverEmail)); } + /** + * Gets all responses received by a user for a question. + */ + public List getFeedbackResponsesForReceiverForQuestion( + String feedbackQuestionId, String receiver) { + Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, feedbackQuestionId); + Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, receiver); + + return makeAttributes(getFeedbackResponseEntitiesForReceiverForQuestion(feedbackQuestionId, receiver)); + } + /** * Checks whether a user has responses in a session. */ @@ -364,6 +375,14 @@ private List getFeedbackResponseEntitiesFromGiverForQuestion( .list(); } + private List getFeedbackResponseEntitiesForReceiverForQuestion( + String feedbackQuestionId, String receiver) { + return load() + .filter("feedbackQuestionId =", feedbackQuestionId) + .filter("receiver =", receiver) + .list(); + } + private List getFeedbackResponseEntitiesForReceiverForCourse( String courseId, String receiver) { return load() @@ -381,12 +400,12 @@ private List getFeedbackResponseEntitiesFromGiverForCourse( } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(FeedbackResponse.class); } @Override - protected boolean hasExistingEntities(FeedbackResponseAttributes entityToCreate) { + boolean hasExistingEntities(FeedbackResponseAttributes entityToCreate) { return !load() .filterKey(Key.create(FeedbackResponse.class, FeedbackResponse.generateId(entityToCreate.getFeedbackQuestionId(), @@ -396,7 +415,7 @@ protected boolean hasExistingEntities(FeedbackResponseAttributes entityToCreate) } @Override - protected FeedbackResponseAttributes makeAttributes(FeedbackResponse entity) { + FeedbackResponseAttributes makeAttributes(FeedbackResponse entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return FeedbackResponseAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/FeedbackSessionsDb.java b/src/main/java/teammates/storage/api/FeedbackSessionsDb.java index cfc9702f92f..9dad841c2b3 100644 --- a/src/main/java/teammates/storage/api/FeedbackSessionsDb.java +++ b/src/main/java/teammates/storage/api/FeedbackSessionsDb.java @@ -52,11 +52,18 @@ public List getAllOngoingSessions(Instant rangeStart, Instant.ofEpochMilli(rangeStart.toEpochMilli()).minus(Const.FEEDBACK_SESSIONS_SEARCH_WINDOW)) .list(); - // remove duplications - endEntities.removeAll(startEntities); - endEntities.addAll(startEntities); + List startEntitiesIds = startEntities.stream() + .map(session -> session.getCourseId() + "::" + session.getFeedbackSessionName()) + .collect(Collectors.toList()); + + List ongoingSessions = endEntities.stream() + .filter(session -> { + String id = session.getCourseId() + "::" + session.getFeedbackSessionName(); + return startEntitiesIds.contains(id); + }) + .collect(Collectors.toList()); - return makeAttributes(endEntities); + return makeAttributes(ongoingSessions); } /** @@ -406,12 +413,12 @@ private FeedbackSession getFeedbackSessionEntity(String feedbackSessionName, Str } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(FeedbackSession.class); } @Override - protected boolean hasExistingEntities(FeedbackSessionAttributes entityToCreate) { + boolean hasExistingEntities(FeedbackSessionAttributes entityToCreate) { return !load() .filterKey(Key.create(FeedbackSession.class, FeedbackSession.generateId(entityToCreate.getFeedbackSessionName(), entityToCreate.getCourseId()))) @@ -420,7 +427,7 @@ protected boolean hasExistingEntities(FeedbackSessionAttributes entityToCreate) } @Override - protected FeedbackSessionAttributes makeAttributes(FeedbackSession entity) { + FeedbackSessionAttributes makeAttributes(FeedbackSession entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return FeedbackSessionAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/InstructorsDb.java b/src/main/java/teammates/storage/api/InstructorsDb.java index 563ac013790..7bd6f18871d 100644 --- a/src/main/java/teammates/storage/api/InstructorsDb.java +++ b/src/main/java/teammates/storage/api/InstructorsDb.java @@ -384,12 +384,12 @@ private List getInstructorEntitiesForCourse(String courseId) { } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(Instructor.class); } @Override - protected boolean hasExistingEntities(InstructorAttributes entityToCreate) { + boolean hasExistingEntities(InstructorAttributes entityToCreate) { // cannot use direct key query as email of an instructor can be changed return !load() .filter("courseId =", entityToCreate.getCourseId()) @@ -400,7 +400,7 @@ protected boolean hasExistingEntities(InstructorAttributes entityToCreate) { } @Override - protected InstructorAttributes makeAttributes(Instructor entity) { + InstructorAttributes makeAttributes(Instructor entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return InstructorAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/ProfilesDb.java b/src/main/java/teammates/storage/api/ProfilesDb.java index a08a97dd233..f273ace9012 100644 --- a/src/main/java/teammates/storage/api/ProfilesDb.java +++ b/src/main/java/teammates/storage/api/ProfilesDb.java @@ -139,19 +139,19 @@ private StudentProfile getStudentProfileEntityFromDb(String googleId) { } @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(StudentProfile.class); } @Override - protected boolean hasExistingEntities(StudentProfileAttributes entityToCreate) { + boolean hasExistingEntities(StudentProfileAttributes entityToCreate) { Key parentKey = Key.create(Account.class, entityToCreate.getGoogleId()); Key childKey = Key.create(parentKey, StudentProfile.class, entityToCreate.getGoogleId()); return !load().filterKey(childKey).keys().list().isEmpty(); } @Override - protected StudentProfileAttributes makeAttributes(StudentProfile entity) { + StudentProfileAttributes makeAttributes(StudentProfile entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return StudentProfileAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/api/StudentsDb.java b/src/main/java/teammates/storage/api/StudentsDb.java index 77c8d7b2e78..5f7cd696d2b 100644 --- a/src/main/java/teammates/storage/api/StudentsDb.java +++ b/src/main/java/teammates/storage/api/StudentsDb.java @@ -223,16 +223,6 @@ public List getStudentsForTeam(String teamName, String course return makeAttributes(getCourseStudentEntitiesForTeam(teamName, courseId)); } - /** - * Gets all students in a section of a course. - */ - public List getStudentsForSection(String sectionName, String courseId) { - Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, sectionName); - Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseId); - - return makeAttributes(getCourseStudentEntitiesForSection(sectionName, courseId)); - } - /** * Gets all unregistered students of a course. */ @@ -400,20 +390,13 @@ private List getCourseStudentEntitiesForTeam(String teamName, Str .list(); } - private List getCourseStudentEntitiesForSection(String sectionName, String courseId) { - return load() - .filter("sectionName =", sectionName) - .filter("courseId =", courseId) - .list(); - } - @Override - protected LoadType load() { + LoadType load() { return ofy().load().type(CourseStudent.class); } @Override - protected boolean hasExistingEntities(StudentAttributes entityToCreate) { + boolean hasExistingEntities(StudentAttributes entityToCreate) { return !load() .filterKey(Key.create(CourseStudent.class, CourseStudent.generateId(entityToCreate.getEmail(), entityToCreate.getCourse()))) @@ -422,7 +405,7 @@ protected boolean hasExistingEntities(StudentAttributes entityToCreate) { } @Override - protected StudentAttributes makeAttributes(CourseStudent entity) { + StudentAttributes makeAttributes(CourseStudent entity) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entity); return StudentAttributes.valueOf(entity); diff --git a/src/main/java/teammates/storage/entity/BaseEntity.java b/src/main/java/teammates/storage/entity/BaseEntity.java index 6c9c75b813f..a759255fb00 100644 --- a/src/main/java/teammates/storage/entity/BaseEntity.java +++ b/src/main/java/teammates/storage/entity/BaseEntity.java @@ -18,7 +18,7 @@ */ public class BaseEntity { - protected BaseEntity() { + BaseEntity() { // instantiate as child classes } diff --git a/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchDocument.java b/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchDocument.java index 25885a26814..7c25210c22b 100644 --- a/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchDocument.java +++ b/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchDocument.java @@ -24,7 +24,6 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Assumption; import teammates.common.util.Const; -import teammates.common.util.JsonUtils; import teammates.common.util.StringHelper; /** @@ -49,7 +48,7 @@ public FeedbackResponseCommentSearchDocument(FeedbackResponseCommentAttributes c } @Override - protected void prepareData() { + void prepareData() { if (comment == null) { return; } @@ -133,7 +132,7 @@ protected void prepareData() { } @Override - public Document toDocument() { + Document toDocument() { // populate related Students/Instructors information StringBuilder relatedPeopleBuilder = new StringBuilder(""); @@ -182,11 +181,11 @@ public Document toDocument() { .addField(Field.newBuilder().setName(Const.SearchDocumentField.SEARCHABLE_TEXT) .setText(searchableText)) .addField(Field.newBuilder().setName(Const.SearchDocumentField.FEEDBACK_RESPONSE_GIVER_NAME) - .setText(JsonUtils.toJson(responseGiverName))) + .setText(responseGiverName)) .addField(Field.newBuilder().setName(Const.SearchDocumentField.FEEDBACK_RESPONSE_RECEIVER_NAME) - .setText(JsonUtils.toJson(responseRecipientName))) + .setText(responseRecipientName)) .addField(Field.newBuilder().setName(Const.SearchDocumentField.FEEDBACK_RESPONSE_COMMENT_GIVER_NAME) - .setText(JsonUtils.toJson(commentGiverDisplayedName))) + .setText(commentGiverDisplayedName)) .setId(comment.getId().toString()) .build(); } diff --git a/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchQuery.java b/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchQuery.java index 8edd644a9b8..78fbea90d19 100644 --- a/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchQuery.java +++ b/src/main/java/teammates/storage/search/FeedbackResponseCommentSearchQuery.java @@ -25,7 +25,7 @@ public FeedbackResponseCommentSearchQuery(List instructors } @Override - protected String prepareVisibilityQueryString(List instructors) { + String prepareVisibilityQueryString(List instructors) { StringBuilder courseIdLimit = new StringBuilder("("); String delim = ""; for (InstructorAttributes ins : instructors) { diff --git a/src/main/java/teammates/storage/search/InstructorSearchDocument.java b/src/main/java/teammates/storage/search/InstructorSearchDocument.java index 2affdd0a069..db20d22fd66 100644 --- a/src/main/java/teammates/storage/search/InstructorSearchDocument.java +++ b/src/main/java/teammates/storage/search/InstructorSearchDocument.java @@ -28,7 +28,7 @@ public InstructorSearchDocument(InstructorAttributes instructor) { } @Override - protected void prepareData() { + void prepareData() { if (instructor == null) { return; } @@ -37,7 +37,7 @@ protected void prepareData() { } @Override - protected Document toDocument() { + Document toDocument() { String delim = ","; diff --git a/src/main/java/teammates/storage/search/InstructorSearchQuery.java b/src/main/java/teammates/storage/search/InstructorSearchQuery.java index 05d304eea0f..904ca1d66b9 100644 --- a/src/main/java/teammates/storage/search/InstructorSearchQuery.java +++ b/src/main/java/teammates/storage/search/InstructorSearchQuery.java @@ -26,7 +26,7 @@ public InstructorSearchQuery(String queryString) { } @Override - protected String prepareVisibilityQueryString(List instructors) { + String prepareVisibilityQueryString(List instructors) { return null; // method not used } diff --git a/src/main/java/teammates/storage/search/SearchDocument.java b/src/main/java/teammates/storage/search/SearchDocument.java index 6d0bb44f545..63d5fa98767 100644 --- a/src/main/java/teammates/storage/search/SearchDocument.java +++ b/src/main/java/teammates/storage/search/SearchDocument.java @@ -24,13 +24,13 @@ */ public abstract class SearchDocument { - protected static final CoursesDb coursesDb = new CoursesDb(); - protected static final FeedbackQuestionsDb fqDb = new FeedbackQuestionsDb(); - protected static final FeedbackResponseCommentsDb frcDb = new FeedbackResponseCommentsDb(); - protected static final FeedbackResponsesDb frDb = new FeedbackResponsesDb(); - protected static final FeedbackSessionsDb fsDb = new FeedbackSessionsDb(); - protected static final InstructorsDb instructorsDb = new InstructorsDb(); - protected static final StudentsDb studentsDb = new StudentsDb(); + static final CoursesDb coursesDb = new CoursesDb(); + static final FeedbackQuestionsDb fqDb = new FeedbackQuestionsDb(); + static final FeedbackResponseCommentsDb frcDb = new FeedbackResponseCommentsDb(); + static final FeedbackResponsesDb frDb = new FeedbackResponsesDb(); + static final FeedbackSessionsDb fsDb = new FeedbackSessionsDb(); + static final InstructorsDb instructorsDb = new InstructorsDb(); + static final StudentsDb studentsDb = new StudentsDb(); /** * Builds the search document. @@ -40,15 +40,15 @@ public Document build() { return toDocument(); } - protected abstract void prepareData(); + abstract void prepareData(); - protected abstract Document toDocument(); + abstract Document toDocument(); /** * This method must be called to filter out the search result for course Id. */ - protected static List filterOutCourseId(Results results, - List instructors) { + static List filterOutCourseId(Results results, + List instructors) { Set courseIdSet = new HashSet<>(); for (InstructorAttributes ins : instructors) { courseIdSet.add(ins.courseId); diff --git a/src/main/java/teammates/storage/search/SearchManager.java b/src/main/java/teammates/storage/search/SearchManager.java index dd65dbafa0f..ced6b01db5a 100644 --- a/src/main/java/teammates/storage/search/SearchManager.java +++ b/src/main/java/teammates/storage/search/SearchManager.java @@ -43,73 +43,6 @@ private SearchManager() { // utility class } - /** - * Creates or updates the search document for the given document and index. - */ - public static void putDocument(String indexName, Document document) { - try { - putDocumentWithRetry(indexName, document); - } catch (PutException e) { - log.severe(String.format(ERROR_NON_TRANSIENT_BACKEND_ISSUE, document, indexName) - + TeammatesException.toStringWithStackTrace(e)); - } catch (MaximumRetriesExceededException e) { - log.severe(String.format(ERROR_MAXIMUM_RETRIES_EXCEEDED, document, indexName, e.finalMessage) - + TeammatesException.toStringWithStackTrace(e)); - } - } - - /** - * Tries putting a document, handling transient errors by retrying with exponential backoff. - * - * @throws PutException if a non-transient error is encountered. - * @throws MaximumRetriesExceededException with final {@link OperationResult}'s message as final message, - * if operation fails after maximum retries. - */ - private static void putDocumentWithRetry(String indexName, Document document) - throws MaximumRetriesExceededException { - Index index = getIndex(indexName); - - /* - * The GAE Search API signals put document failure in two ways: it either - * returns a PutResponse containing an OperationResult with a non-OK StatusCode, or - * throws a PutException that also contains an embedded OperationResult. - * We handle both ways by examining the OperationResult to determine what kind of error it is. If it is - * transient, we use RetryManager to retry the operation; if it is - * non-transient, we do not retry but throw a PutException upwards instead. - */ - RM.runUntilSuccessful(new RetryableTaskThrows("Put document") { - - private OperationResult lastResult; - - @Override - public void run() { - try { - PutResponse response = index.put(document); - lastResult = response.getResults().get(0); - - } catch (PutException e) { - lastResult = e.getOperationResult(); - } - } - - @Override - public boolean isSuccessful() { - // Update the final message to be shown if the task fails after maximum retries - finalMessage = lastResult.getMessage(); - - if (StatusCode.OK.equals(lastResult.getCode())) { - return true; - } else if (StatusCode.TRANSIENT_ERROR.equals(lastResult.getCode())) { - // A transient error can be retried - return false; - } else { - // A non-transient error signals that the operation should not be retried - throw new PutException(lastResult); - } - } - }); - } - /** * Batch creates or updates the search documents for the given documents and index. */ diff --git a/src/main/java/teammates/storage/search/SearchQuery.java b/src/main/java/teammates/storage/search/SearchQuery.java index 083268072d3..330d0a70135 100644 --- a/src/main/java/teammates/storage/search/SearchQuery.java +++ b/src/main/java/teammates/storage/search/SearchQuery.java @@ -15,19 +15,18 @@ */ public abstract class SearchQuery { - protected static final String AND = " AND "; - protected static final String OR = " OR "; - protected static final String NOT = " NOT "; + static final String AND = " AND "; + static final String OR = " OR "; private static final Logger log = Logger.getLogger(); - protected QueryOptions options; + QueryOptions options; private String visibilityQueryString; private List textQueryStrings = new ArrayList<>(); - protected SearchQuery(List instructors, String queryString) { + SearchQuery(List instructors, String queryString) { options = QueryOptions.newBuilder() .setLimit(20) .build(); @@ -35,11 +34,11 @@ protected SearchQuery(List instructors, String queryString setTextFilter(Const.SearchDocumentField.SEARCHABLE_TEXT, queryString); } - protected SearchQuery(String queryString) { + SearchQuery(String queryString) { this(null, queryString); } - protected abstract String prepareVisibilityQueryString(List instructors); + abstract String prepareVisibilityQueryString(List instructors); /** * Returns how many query strings a SearchQuery object has. diff --git a/src/main/java/teammates/storage/search/StudentSearchDocument.java b/src/main/java/teammates/storage/search/StudentSearchDocument.java index 3f7ee1a4ff0..a35fc315d4b 100644 --- a/src/main/java/teammates/storage/search/StudentSearchDocument.java +++ b/src/main/java/teammates/storage/search/StudentSearchDocument.java @@ -28,7 +28,7 @@ public StudentSearchDocument(StudentAttributes student) { } @Override - protected void prepareData() { + void prepareData() { if (student == null) { return; } @@ -37,7 +37,7 @@ protected void prepareData() { } @Override - public Document toDocument() { + Document toDocument() { String delim = ","; diff --git a/src/main/java/teammates/storage/search/StudentSearchQuery.java b/src/main/java/teammates/storage/search/StudentSearchQuery.java index 6f71af7ff16..de9056f57fe 100644 --- a/src/main/java/teammates/storage/search/StudentSearchQuery.java +++ b/src/main/java/teammates/storage/search/StudentSearchQuery.java @@ -35,7 +35,7 @@ public StudentSearchQuery(String queryString) { } @Override - protected String prepareVisibilityQueryString(List instructors) { + String prepareVisibilityQueryString(List instructors) { StringBuilder courseIdLimit = new StringBuilder("("); String delim = ""; for (InstructorAttributes ins : instructors) { diff --git a/src/main/java/teammates/ui/automated/AutomatedAction.java b/src/main/java/teammates/ui/automated/AutomatedAction.java deleted file mode 100644 index 886dd50a780..00000000000 --- a/src/main/java/teammates/ui/automated/AutomatedAction.java +++ /dev/null @@ -1,111 +0,0 @@ -package teammates.ui.automated; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.http.HttpStatus; - -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.NullHttpParameterException; -import teammates.common.util.Const; -import teammates.logic.api.EmailGenerator; -import teammates.logic.api.EmailSender; -import teammates.logic.api.Logic; -import teammates.logic.api.TaskQueuer; - -/** - * An automated "action" to be performed by the system, triggered by cron jobs or task queues. - *

      - * This class of action is different from the non-automated ones in the following manner: - *

        - *
      • Non-administrators are barred from performing it.
      • - *
      • The limit for request is 10 minutes instead of 1 minute.
      • - *
      - *

      - */ -public abstract class AutomatedAction { - - protected Logic logic = new Logic(); - protected TaskQueuer taskQueuer = new TaskQueuer(); - protected EmailGenerator emailGenerator = new EmailGenerator(); - protected EmailSender emailSender = new EmailSender(); - - protected HttpServletRequest request; - protected HttpServletResponse response; - - protected void initialiseAttributes(HttpServletRequest request, HttpServletResponse response) { - this.request = request; - this.response = response; - } - - public TaskQueuer getTaskQueuer() { - return taskQueuer; - } - - public void setTaskQueuer(TaskQueuer taskQueuer) { - this.taskQueuer = taskQueuer; - } - - public EmailSender getEmailSender() { - return emailSender; - } - - public void setEmailSender(EmailSender emailSender) { - this.emailSender = emailSender; - } - - /** - * Returns the first value for the specified parameter in the HTTP request, or null if such parameter is not found. - */ - protected String getRequestParamValue(String paramName) { - return request.getParameter(paramName); - } - - /** - * Returns the first value for the specified parameter expected to be present in the HTTP request. - */ - protected String getNonNullRequestParamValue(String paramName) { - return getNonNullRequestParamValues(paramName)[0]; - } - - /** - * Returns the first value for the specified parameter expected to be present in the HTTP request as boolean. - */ - @SuppressWarnings("PMD.PreserveStackTrace") - protected boolean getBooleanRequestParamValue(String paramName) { - String value = getNonNullRequestParamValue(paramName); - try { - return Boolean.parseBoolean(value); - } catch (IllegalArgumentException e) { - throw new InvalidHttpParameterException( - "Expected boolean value for " + paramName + " parameter, but found: [" + value + "]"); - } - } - - /** - * Returns the values for the specified parameter in the HTTP request, or null if such parameter is not found. - */ - protected String[] getRequestParamValues(String paramName) { - return request.getParameterValues(paramName); - } - - /** - * Returns the values for the specified parameter expected to be present in the HTTP request. - */ - protected String[] getNonNullRequestParamValues(String paramName) { - String[] values = getRequestParamValues(paramName); - if (values == null || values.length == 0) { - throw new NullHttpParameterException(String.format(Const.StatusCodes.NULL_HTTP_PARAMETER, paramName)); - } - return values; - } - - protected void setForRetry() { - // Sets an arbitrary retry code outside of the range 200-299 so GAE will automatically retry upon failure - response.setStatus(HttpStatus.SC_CONTINUE); - } - - /** Executes the action. */ - public abstract void execute(); - -} diff --git a/src/main/java/teammates/ui/automated/AutomatedActionExceptionTestAction.java b/src/main/java/teammates/ui/automated/AutomatedActionExceptionTestAction.java deleted file mode 100644 index 7776707e472..00000000000 --- a/src/main/java/teammates/ui/automated/AutomatedActionExceptionTestAction.java +++ /dev/null @@ -1,35 +0,0 @@ -package teammates.ui.automated; - -import com.google.appengine.api.datastore.DatastoreTimeoutException; -import com.google.apphosting.api.DeadlineExceededException; - -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.util.Const; - -/** - * Action specifically created for testing exception handling at API servlet. - */ -public class AutomatedActionExceptionTestAction extends AutomatedAction { - - @Override - @SuppressWarnings("PMD.AvoidThrowingNullPointerException") // deliberately done for testing - public void execute() { - String error = getNonNullRequestParamValue(Const.ParamsNames.ERROR); - if (error.equals(AssertionError.class.getSimpleName())) { - throw new AssertionError("AssertionError testing"); - } - if (error.equals(NullPointerException.class.getSimpleName())) { - throw new NullPointerException("NullPointerException testing"); - } - if (error.equals(DeadlineExceededException.class.getSimpleName())) { - throw new DeadlineExceededException("DeadlineExceededException testing"); - } - if (error.equals(DatastoreTimeoutException.class.getSimpleName())) { - throw new DatastoreTimeoutException("DatastoreTimeoutException testing"); - } - if (error.equals(InvalidHttpParameterException.class.getSimpleName())) { - throw new InvalidHttpParameterException("InvalidHttpParameterException testing"); - } - } - -} diff --git a/src/main/java/teammates/ui/automated/AutomatedActionFactory.java b/src/main/java/teammates/ui/automated/AutomatedActionFactory.java deleted file mode 100644 index c31eb88fb49..00000000000 --- a/src/main/java/teammates/ui/automated/AutomatedActionFactory.java +++ /dev/null @@ -1,83 +0,0 @@ -package teammates.ui.automated; - -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.http.HttpStatus; - -import teammates.common.exception.ActionMappingException; -import teammates.common.exception.TeammatesException; -import teammates.common.util.Assumption; -import teammates.common.util.Const.CronJobURIs; -import teammates.common.util.Const.TaskQueue; - -/** - * Generates the matching {@link AutomatedAction} for a given URI. - */ -public class AutomatedActionFactory { - - private static final Map> ACTION_MAPPINGS = new HashMap<>(); - - static { - map(CronJobURIs.AUTOMATED_EXCEPTION_TEST, AutomatedActionExceptionTestAction.class); - - // Cron jobs - map(CronJobURIs.AUTOMATED_LOG_COMPILATION, CompileLogsAction.class); - map(CronJobURIs.AUTOMATED_DATASTORE_BACKUP, DatastoreBackupAction.class); - map(CronJobURIs.AUTOMATED_FEEDBACK_OPENING_REMINDERS, FeedbackSessionOpeningRemindersAction.class); - map(CronJobURIs.AUTOMATED_FEEDBACK_CLOSED_REMINDERS, FeedbackSessionClosedRemindersAction.class); - map(CronJobURIs.AUTOMATED_FEEDBACK_CLOSING_REMINDERS, FeedbackSessionClosingRemindersAction.class); - map(CronJobURIs.AUTOMATED_FEEDBACK_PUBLISHED_REMINDERS, FeedbackSessionPublishedRemindersAction.class); - - // Task queue workers - map(TaskQueue.FEEDBACK_SESSION_PUBLISHED_EMAIL_WORKER_URL, FeedbackSessionPublishedEmailWorkerAction.class); - map(TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL, - FeedbackSessionResendPublishedEmailWorkerAction.class); - map(TaskQueue.FEEDBACK_SESSION_REMIND_EMAIL_WORKER_URL, FeedbackSessionRemindEmailWorkerAction.class); - map(TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_WORKER_URL, - FeedbackSessionRemindParticularUsersEmailWorkerAction.class); - map(TaskQueue.FEEDBACK_SESSION_UNPUBLISHED_EMAIL_WORKER_URL, FeedbackSessionUnpublishedEmailWorkerAction.class); - map(TaskQueue.FEEDBACK_SESSION_UPDATE_RESPONDENT_WORKER_URL, FeedbackSessionUpdateRespondentWorkerAction.class); - map(TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_WORKER_URL, InstructorCourseJoinEmailWorkerAction.class); - map(TaskQueue.SEND_EMAIL_WORKER_URL, SendEmailWorkerAction.class); - map(TaskQueue.STUDENT_COURSE_JOIN_EMAIL_WORKER_URL, StudentCourseJoinEmailWorkerAction.class); - } - - private static void map(String actionUri, Class actionClass) { - ACTION_MAPPINGS.put(actionUri, actionClass); - } - - /** - * Returns the matching {@link AutomatedAction} object for the URI in the {@code req}. - */ - public AutomatedAction getAction(HttpServletRequest req, HttpServletResponse resp) throws ActionMappingException { - String uri = req.getRequestURI(); - if (uri.contains(";")) { - uri = uri.split(";")[0]; - } - - AutomatedAction action = getAction(uri); - action.initialiseAttributes(req, resp); - return action; - } - - private AutomatedAction getAction(String uri) throws ActionMappingException { - Class action = ACTION_MAPPINGS.get(uri); - - if (action == null) { - throw new ActionMappingException("Resource with URI " + uri + " is not found.", HttpStatus.SC_NOT_FOUND); - } - - try { - return action.newInstance(); - } catch (Exception e) { - Assumption.fail("Could not create the action for " + uri + ": " - + TeammatesException.toStringWithStackTrace(e)); - return null; - } - } - -} diff --git a/src/main/java/teammates/ui/automated/AutomatedServlet.java b/src/main/java/teammates/ui/automated/AutomatedServlet.java deleted file mode 100644 index 08762c8b013..00000000000 --- a/src/main/java/teammates/ui/automated/AutomatedServlet.java +++ /dev/null @@ -1,66 +0,0 @@ -package teammates.ui.automated; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.http.HttpStatus; - -import com.google.appengine.api.datastore.DatastoreTimeoutException; -import com.google.apphosting.api.DeadlineExceededException; - -import teammates.common.exception.ActionMappingException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.TeammatesException; -import teammates.common.util.HttpRequestHelper; -import teammates.common.util.Logger; - -/** - * Receives automated requests from the App Engine server and executes the matching automated action. - */ -@SuppressWarnings("serial") -abstract class AutomatedServlet extends HttpServlet { - - private static final Logger log = Logger.getLogger(); - - @SuppressWarnings("PMD.AvoidCatchingThrowable") // used as fallback - void executeTask(HttpServletRequest req, HttpServletResponse resp) { - resp.setHeader("Strict-Transport-Security", "max-age=31536000"); - resp.setHeader("Cache-Control", "no-store"); - resp.setHeader("Pragma", "no-cache"); - - String url = HttpRequestHelper.getRequestedUrl(req); - // Do not log task queue worker actions to prevent excessive logging - if (!url.startsWith("/worker/")) { - log.info("Automated request received: [" + req.getMethod() + "] " + req.getRequestURL().toString() - + ", Params: " + HttpRequestHelper.getRequestParametersAsString(req) - + ", Headers: " + HttpRequestHelper.getRequestHeadersAsString(req)); - } - - try { - AutomatedAction action = new AutomatedActionFactory().getAction(req, resp); - action.execute(); - } catch (ActionMappingException | InvalidHttpParameterException e) { - log.severe(e.getClass().getSimpleName() + " caught by " + getClass().getSimpleName() + ": " - + TeammatesException.toStringWithStackTrace(e)); - - // Response status is not set to 4XX to 5XX to prevent GAE retry mechanism because - // if the cause of the exception is improper request URL, no amount of retry is going to help. - // The action will be inaccurately marked as "success", but the severe log can be used - // to trace the origin of the problem. - } catch (DeadlineExceededException | DatastoreTimeoutException e) { - log.severe(e.getClass().getSimpleName() + " caught by " + getClass().getSimpleName() + ": " - + TeammatesException.toStringWithStackTrace(e)); - - // Task will be recognised as failed and GAE retry mechanism can kick in - resp.setStatus(HttpStatus.SC_GATEWAY_TIMEOUT); - } catch (Throwable t) { - log.severe(t.getClass().getSimpleName() + " caught by " + getClass().getSimpleName() + ": " - + TeammatesException.toStringWithStackTrace(t)); - - // Task will be recognised as failed and GAE retry mechanism can kick in - resp.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); - } - } - -} diff --git a/src/main/java/teammates/ui/automated/CronJobServlet.java b/src/main/java/teammates/ui/automated/CronJobServlet.java deleted file mode 100644 index c9b3b71b683..00000000000 --- a/src/main/java/teammates/ui/automated/CronJobServlet.java +++ /dev/null @@ -1,20 +0,0 @@ -package teammates.ui.automated; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Receives GET requests from cron job scheduler and executes the matching actions. - * - * @see
      https://cloud.google.com/appengine/docs/standard/java/config/cron - */ -@SuppressWarnings("serial") -public class CronJobServlet extends AutomatedServlet { - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse resp) { - // Cron job schedulers use GET request - executeTask(req, resp); - } - -} diff --git a/src/main/java/teammates/ui/automated/SendEmailWorkerAction.java b/src/main/java/teammates/ui/automated/SendEmailWorkerAction.java deleted file mode 100644 index d9c3c5eb8a6..00000000000 --- a/src/main/java/teammates/ui/automated/SendEmailWorkerAction.java +++ /dev/null @@ -1,37 +0,0 @@ -package teammates.ui.automated; - -import teammates.common.util.Const.ParamsNames; -import teammates.common.util.EmailSendingStatus; -import teammates.common.util.EmailWrapper; - -/** - * Task queue worker action: sends queued email. - */ -public class SendEmailWorkerAction extends AutomatedAction { - - @Override - public void execute() { - String emailSubject = getNonNullRequestParamValue(ParamsNames.EMAIL_SUBJECT); - String emailContent = getNonNullRequestParamValue(ParamsNames.EMAIL_CONTENT); - String emailSenderEmail = getNonNullRequestParamValue(ParamsNames.EMAIL_SENDER); - String emailSenderName = getRequestParamValue(ParamsNames.EMAIL_SENDERNAME); - String emailReceiver = getNonNullRequestParamValue(ParamsNames.EMAIL_RECEIVER); - String emailReply = getNonNullRequestParamValue(ParamsNames.EMAIL_REPLY_TO_ADDRESS); - - EmailWrapper message = new EmailWrapper(); - message.setRecipient(emailReceiver); - message.setSenderEmail(emailSenderEmail); - if (emailSenderName != null) { - message.setSenderName(emailSenderName); - } - message.setContent(emailContent); - message.setSubject(emailSubject); - message.setReplyTo(emailReply); - - EmailSendingStatus status = emailSender.sendEmail(message); - if (!status.isSuccess()) { - setForRetry(); - } - } - -} diff --git a/src/main/java/teammates/ui/automated/TaskQueueServlet.java b/src/main/java/teammates/ui/automated/TaskQueueServlet.java deleted file mode 100644 index 68fd7d57fa5..00000000000 --- a/src/main/java/teammates/ui/automated/TaskQueueServlet.java +++ /dev/null @@ -1,20 +0,0 @@ -package teammates.ui.automated; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Receives POST requests from task queue workers and executes the matching actions. - * - * @see https://cloud.google.com/appengine/docs/standard/java/taskqueue/ - */ -@SuppressWarnings("serial") -public class TaskQueueServlet extends AutomatedServlet { - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse resp) { - // Task queue workers use POST request - executeTask(req, resp); - } - -} diff --git a/src/main/java/teammates/ui/automated/package-info.java b/src/main/java/teammates/ui/automated/package-info.java deleted file mode 100644 index db0b53e04cf..00000000000 --- a/src/main/java/teammates/ui/automated/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains servlets and action classes for automated actions (i.e. cron jobs, task queue workers). - */ -package teammates.ui.automated; diff --git a/src/main/java/teammates/ui/webapi/endpoints/ResourceEndpoints.java b/src/main/java/teammates/ui/endpoints/ResourceEndpoints.java similarity index 97% rename from src/main/java/teammates/ui/webapi/endpoints/ResourceEndpoints.java rename to src/main/java/teammates/ui/endpoints/ResourceEndpoints.java index f665c231c7e..2494224e440 100644 --- a/src/main/java/teammates/ui/webapi/endpoints/ResourceEndpoints.java +++ b/src/main/java/teammates/ui/endpoints/ResourceEndpoints.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.endpoints; +package teammates.ui.endpoints; import com.fasterxml.jackson.annotation.JsonValue; @@ -43,7 +43,6 @@ public enum ResourceEndpoints { QUESTIONS(ResourceURIs.QUESTIONS), QUESTION(ResourceURIs.QUESTION), QUESTION_RECIPIENTS(ResourceURIs.QUESTION_RECIPIENTS), - RESPONSE(ResourceURIs.RESPONSE), RESPONSES(ResourceURIs.RESPONSES), HAS_RESPONSES(ResourceURIs.HAS_RESPONSES), SUBMISSION_CONFIRMATION(ResourceURIs.SUBMISSION_CONFIRMATION), @@ -53,6 +52,7 @@ public enum ResourceEndpoints { LOCAL_DATE_TIME(ResourceURIs.LOCAL_DATE_TIME), SESSION_LINKS_RECOVERY(ResourceURIs.SESSION_LINKS_RECOVERY), NATIONALITIES(ResourceURIs.NATIONALITIES), + EMAIL(ResourceURIs.EMAIL), STUDENT_PROFILE_PICTURE(ResourceURIs.STUDENT_PROFILE_PICTURE), STUDENT_PROFILE(ResourceURIs.STUDENT_PROFILE), STUDENT_COURSE_LINKS_REGENERATION(ResourceURIs.STUDENT_COURSE_LINKS_REGENERATION), diff --git a/src/main/java/teammates/ui/webapi/endpoints/package-info.java b/src/main/java/teammates/ui/endpoints/package-info.java similarity index 50% rename from src/main/java/teammates/ui/webapi/endpoints/package-info.java rename to src/main/java/teammates/ui/endpoints/package-info.java index e18fba09c9c..2638319a4c6 100644 --- a/src/main/java/teammates/ui/webapi/endpoints/package-info.java +++ b/src/main/java/teammates/ui/endpoints/package-info.java @@ -1,4 +1,4 @@ /** * Contains all API endpoints. */ -package teammates.ui.webapi.endpoints; +package teammates.ui.endpoints; diff --git a/src/main/java/teammates/ui/webapi/output/AccountData.java b/src/main/java/teammates/ui/output/AccountData.java similarity index 97% rename from src/main/java/teammates/ui/webapi/output/AccountData.java rename to src/main/java/teammates/ui/output/AccountData.java index 9c5df114856..eb9a9d1d3a1 100644 --- a/src/main/java/teammates/ui/webapi/output/AccountData.java +++ b/src/main/java/teammates/ui/output/AccountData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import teammates.common.datatransfer.attributes.AccountAttributes; diff --git a/src/main/java/teammates/ui/webapi/output/ApiOutput.java b/src/main/java/teammates/ui/output/ApiOutput.java similarity index 90% rename from src/main/java/teammates/ui/webapi/output/ApiOutput.java rename to src/main/java/teammates/ui/output/ApiOutput.java index 943df77df25..f5bdc5ca1f1 100644 --- a/src/main/java/teammates/ui/webapi/output/ApiOutput.java +++ b/src/main/java/teammates/ui/output/ApiOutput.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import javax.annotation.Nullable; diff --git a/src/main/java/teammates/ui/webapi/output/AuthInfo.java b/src/main/java/teammates/ui/output/AuthInfo.java similarity index 97% rename from src/main/java/teammates/ui/webapi/output/AuthInfo.java rename to src/main/java/teammates/ui/output/AuthInfo.java index 88b7454521f..8610ca63545 100644 --- a/src/main/java/teammates/ui/webapi/output/AuthInfo.java +++ b/src/main/java/teammates/ui/output/AuthInfo.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import javax.annotation.Nullable; diff --git a/src/main/java/teammates/ui/webapi/output/CommentSearchResultData.java b/src/main/java/teammates/ui/output/CommentSearchResultData.java similarity index 99% rename from src/main/java/teammates/ui/webapi/output/CommentSearchResultData.java rename to src/main/java/teammates/ui/output/CommentSearchResultData.java index d341aba87aa..ace7f8002ae 100644 --- a/src/main/java/teammates/ui/webapi/output/CommentSearchResultData.java +++ b/src/main/java/teammates/ui/output/CommentSearchResultData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/teammates/ui/webapi/output/CommentSearchResultsData.java b/src/main/java/teammates/ui/output/CommentSearchResultsData.java similarity index 94% rename from src/main/java/teammates/ui/webapi/output/CommentSearchResultsData.java rename to src/main/java/teammates/ui/output/CommentSearchResultsData.java index f416c2c1357..ec6d701f205 100644 --- a/src/main/java/teammates/ui/webapi/output/CommentSearchResultsData.java +++ b/src/main/java/teammates/ui/output/CommentSearchResultsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/teammates/ui/webapi/output/CommentVisibilityType.java b/src/main/java/teammates/ui/output/CommentVisibilityType.java similarity index 92% rename from src/main/java/teammates/ui/webapi/output/CommentVisibilityType.java rename to src/main/java/teammates/ui/output/CommentVisibilityType.java index a764829511c..685891c4f07 100644 --- a/src/main/java/teammates/ui/webapi/output/CommentVisibilityType.java +++ b/src/main/java/teammates/ui/output/CommentVisibilityType.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The comment visibility type. diff --git a/src/main/java/teammates/ui/webapi/output/ConfirmationResponse.java b/src/main/java/teammates/ui/output/ConfirmationResponse.java similarity index 76% rename from src/main/java/teammates/ui/webapi/output/ConfirmationResponse.java rename to src/main/java/teammates/ui/output/ConfirmationResponse.java index 4b126cd50c7..08aa556b572 100644 --- a/src/main/java/teammates/ui/webapi/output/ConfirmationResponse.java +++ b/src/main/java/teammates/ui/output/ConfirmationResponse.java @@ -1,7 +1,7 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** - * The output format of {@link teammates.ui.webapi.action.ConfirmFeedbackSessionSubmissionAction}. + * The output format of {@link teammates.ui.webapi.ConfirmFeedbackSessionSubmissionAction}. */ public class ConfirmationResponse extends ApiOutput { private final ConfirmationResult result; diff --git a/src/main/java/teammates/ui/webapi/output/ConfirmationResult.java b/src/main/java/teammates/ui/output/ConfirmationResult.java similarity index 89% rename from src/main/java/teammates/ui/webapi/output/ConfirmationResult.java rename to src/main/java/teammates/ui/output/ConfirmationResult.java index e4faea8c148..3da30196617 100644 --- a/src/main/java/teammates/ui/webapi/output/ConfirmationResult.java +++ b/src/main/java/teammates/ui/output/ConfirmationResult.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The result of the confirmation. diff --git a/src/main/java/teammates/ui/webapi/output/CourseArchiveData.java b/src/main/java/teammates/ui/output/CourseArchiveData.java similarity index 92% rename from src/main/java/teammates/ui/webapi/output/CourseArchiveData.java rename to src/main/java/teammates/ui/output/CourseArchiveData.java index ec900b85e10..2f5021bc79a 100644 --- a/src/main/java/teammates/ui/webapi/output/CourseArchiveData.java +++ b/src/main/java/teammates/ui/output/CourseArchiveData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The API output format of a archived course status. diff --git a/src/main/java/teammates/ui/webapi/output/CourseData.java b/src/main/java/teammates/ui/output/CourseData.java similarity index 59% rename from src/main/java/teammates/ui/webapi/output/CourseData.java rename to src/main/java/teammates/ui/output/CourseData.java index 80057cdcca1..8669dccbac7 100644 --- a/src/main/java/teammates/ui/webapi/output/CourseData.java +++ b/src/main/java/teammates/ui/output/CourseData.java @@ -1,4 +1,6 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; + +import javax.annotation.Nullable; import teammates.common.datatransfer.attributes.CourseAttributes; @@ -10,8 +12,10 @@ public class CourseData extends ApiOutput { private final String courseId; private final String courseName; private final String timeZone; - private final long creationTimestamp; + private long creationTimestamp; private long deletionTimestamp; + @Nullable + private InstructorPrivilegeData privileges; public CourseData(CourseAttributes courseAttributes) { this.courseId = courseAttributes.getId(); @@ -42,4 +46,28 @@ public long getCreationTimestamp() { public long getDeletionTimestamp() { return deletionTimestamp; } + + public InstructorPrivilegeData getPrivileges() { + return privileges; + } + + public void setCreationTimestamp(long creationTimestamp) { + this.creationTimestamp = creationTimestamp; + } + + public void setDeletionTimestamp(long deletionTimestamp) { + this.deletionTimestamp = deletionTimestamp; + } + + public void setPrivileges(InstructorPrivilegeData privileges) { + this.privileges = privileges; + } + + /** + * Hides some attributes to student. + */ + public void hideInformationForStudent() { + setCreationTimestamp(0); + setDeletionTimestamp(0); + } } diff --git a/src/main/java/teammates/ui/webapi/output/CourseSectionNamesData.java b/src/main/java/teammates/ui/output/CourseSectionNamesData.java similarity index 91% rename from src/main/java/teammates/ui/webapi/output/CourseSectionNamesData.java rename to src/main/java/teammates/ui/output/CourseSectionNamesData.java index 608930474ec..a81e9ce51bb 100644 --- a/src/main/java/teammates/ui/webapi/output/CourseSectionNamesData.java +++ b/src/main/java/teammates/ui/output/CourseSectionNamesData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; diff --git a/src/main/java/teammates/ui/webapi/output/CoursesData.java b/src/main/java/teammates/ui/output/CoursesData.java similarity index 93% rename from src/main/java/teammates/ui/webapi/output/CoursesData.java rename to src/main/java/teammates/ui/output/CoursesData.java index 84261ee6646..a9750f7a8eb 100644 --- a/src/main/java/teammates/ui/webapi/output/CoursesData.java +++ b/src/main/java/teammates/ui/output/CoursesData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/teammates/ui/output/EmailData.java b/src/main/java/teammates/ui/output/EmailData.java new file mode 100644 index 00000000000..31e24836a66 --- /dev/null +++ b/src/main/java/teammates/ui/output/EmailData.java @@ -0,0 +1,31 @@ +package teammates.ui.output; + +import teammates.common.util.EmailWrapper; + +/** + * The output format for email request. + */ +public class EmailData extends ApiOutput { + private final String recipient; + private final String subject; + private final String content; + + public EmailData(EmailWrapper email) { + this.recipient = email.getRecipient(); + this.subject = email.getSubject(); + this.content = email.getContent(); + } + + public String getRecipient() { + return recipient; + } + + public String getSubject() { + return subject; + } + + public String getContent() { + return content; + } + +} diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionData.java b/src/main/java/teammates/ui/output/FeedbackQuestionData.java similarity index 80% rename from src/main/java/teammates/ui/webapi/output/FeedbackQuestionData.java rename to src/main/java/teammates/ui/output/FeedbackQuestionData.java index 716750009bc..acc14bf5031 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionData.java +++ b/src/main/java/teammates/ui/output/FeedbackQuestionData.java @@ -1,5 +1,6 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; +import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @@ -7,8 +8,12 @@ import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.questions.FeedbackConstantSumDistributePointsType; import teammates.common.datatransfer.questions.FeedbackConstantSumQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackMsqQuestionDetails; import teammates.common.datatransfer.questions.FeedbackQuestionDetails; import teammates.common.datatransfer.questions.FeedbackQuestionType; +import teammates.common.datatransfer.questions.FeedbackRubricQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; import teammates.common.util.Assumption; import teammates.common.util.Const; @@ -94,6 +99,18 @@ public FeedbackQuestionData(FeedbackQuestionAttributes feedbackQuestionAttribute FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption()); } } + + if (this.questionType == FeedbackQuestionType.TEXT) { + // TODO: remove after data migration + FeedbackTextQuestionDetails feedbackTextQuestionDetails = + (FeedbackTextQuestionDetails) this.questionDetails; + if (feedbackTextQuestionDetails.getRecommendedLength() != null + && feedbackTextQuestionDetails.getRecommendedLength() == 0) { + // for legacy data, 0 is treated as optional for recommended length + feedbackTextQuestionDetails.setRecommendedLength(null); + } + + } } /** @@ -176,4 +193,20 @@ public List getShowGiverNameTo() { public List getShowRecipientNameTo() { return showRecipientNameTo; } + + /** + * Hides some attributes to a student. + */ + public void hideInformationForStudent() { + if (questionDetails instanceof FeedbackMcqQuestionDetails) { + ((FeedbackMcqQuestionDetails) questionDetails).setMcqWeights(Collections.emptyList()); + ((FeedbackMcqQuestionDetails) questionDetails).setMcqOtherWeight(0); + } else if (questionDetails instanceof FeedbackMsqQuestionDetails) { + ((FeedbackMsqQuestionDetails) questionDetails).setMsqWeights(Collections.emptyList()); + ((FeedbackMsqQuestionDetails) questionDetails).setMsqOtherWeight(0); + } else if (questionDetails instanceof FeedbackRubricQuestionDetails) { + ((FeedbackRubricQuestionDetails) questionDetails) + .setRubricWeightsForEachCell(Collections.singletonList(Collections.emptyList())); + } + } } diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionRecipientData.java b/src/main/java/teammates/ui/output/FeedbackQuestionRecipientData.java similarity index 92% rename from src/main/java/teammates/ui/webapi/output/FeedbackQuestionRecipientData.java rename to src/main/java/teammates/ui/output/FeedbackQuestionRecipientData.java index 09d0f2288e1..f3aea9ae0c1 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionRecipientData.java +++ b/src/main/java/teammates/ui/output/FeedbackQuestionRecipientData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * API output for feedback question recipient. diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionRecipientsData.java b/src/main/java/teammates/ui/output/FeedbackQuestionRecipientsData.java similarity index 95% rename from src/main/java/teammates/ui/webapi/output/FeedbackQuestionRecipientsData.java rename to src/main/java/teammates/ui/output/FeedbackQuestionRecipientsData.java index 4187629dd10..43b156ebcae 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionRecipientsData.java +++ b/src/main/java/teammates/ui/output/FeedbackQuestionRecipientsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.ArrayList; import java.util.Comparator; diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionsData.java b/src/main/java/teammates/ui/output/FeedbackQuestionsData.java similarity index 96% rename from src/main/java/teammates/ui/webapi/output/FeedbackQuestionsData.java rename to src/main/java/teammates/ui/output/FeedbackQuestionsData.java index 93ba92d6ac8..bf3ca31da8c 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackQuestionsData.java +++ b/src/main/java/teammates/ui/output/FeedbackQuestionsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackResponseCommentData.java b/src/main/java/teammates/ui/output/FeedbackResponseCommentData.java similarity index 96% rename from src/main/java/teammates/ui/webapi/output/FeedbackResponseCommentData.java rename to src/main/java/teammates/ui/output/FeedbackResponseCommentData.java index 918d873aa03..0b71417ae53 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackResponseCommentData.java +++ b/src/main/java/teammates/ui/output/FeedbackResponseCommentData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; import java.util.stream.Collectors; @@ -12,8 +12,8 @@ */ public class FeedbackResponseCommentData extends ApiOutput { - protected String commentGiver; - protected String lastEditorEmail; + String commentGiver; + String lastEditorEmail; private long feedbackResponseCommentId; private String commentText; diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackResponseData.java b/src/main/java/teammates/ui/output/FeedbackResponseData.java similarity index 69% rename from src/main/java/teammates/ui/webapi/output/FeedbackResponseData.java rename to src/main/java/teammates/ui/output/FeedbackResponseData.java index 99984519f4d..aaa27736e28 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackResponseData.java +++ b/src/main/java/teammates/ui/output/FeedbackResponseData.java @@ -1,7 +1,10 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; + +import javax.annotation.Nullable; import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; import teammates.common.datatransfer.questions.FeedbackResponseDetails; +import teammates.common.util.StringHelper; /** * The API output format of {@link FeedbackResponseAttributes}. @@ -16,8 +19,11 @@ public class FeedbackResponseData extends ApiOutput { private final FeedbackResponseDetails responseDetails; + @Nullable + private FeedbackResponseCommentData giverComment; + public FeedbackResponseData(FeedbackResponseAttributes feedbackResponseAttributes) { - this.feedbackResponseId = feedbackResponseAttributes.getId(); + this.feedbackResponseId = StringHelper.encrypt(feedbackResponseAttributes.getId()); this.giverIdentifier = feedbackResponseAttributes.giver; this.recipientIdentifier = feedbackResponseAttributes.recipient; this.responseDetails = feedbackResponseAttributes.getResponseDetails(); @@ -38,4 +44,13 @@ public String getRecipientIdentifier() { public FeedbackResponseDetails getResponseDetails() { return responseDetails; } + + public FeedbackResponseCommentData getGiverComment() { + return giverComment; + } + + public void setGiverComment(FeedbackResponseCommentData giverComment) { + this.giverComment = giverComment; + } + } diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackResponsesData.java b/src/main/java/teammates/ui/output/FeedbackResponsesData.java similarity index 87% rename from src/main/java/teammates/ui/webapi/output/FeedbackResponsesData.java rename to src/main/java/teammates/ui/output/FeedbackResponsesData.java index ba39fb675ee..215987ccdcd 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackResponsesData.java +++ b/src/main/java/teammates/ui/output/FeedbackResponsesData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; import java.util.stream.Collectors; @@ -10,7 +10,7 @@ */ public class FeedbackResponsesData extends ApiOutput { - List responses; + private List responses; public FeedbackResponsesData(List responses) { this.responses = responses.stream().map(FeedbackResponseData::new).collect(Collectors.toList()); diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionData.java b/src/main/java/teammates/ui/output/FeedbackSessionData.java similarity index 92% rename from src/main/java/teammates/ui/webapi/output/FeedbackSessionData.java rename to src/main/java/teammates/ui/output/FeedbackSessionData.java index 6b0ea346529..60ce21fb5ca 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionData.java +++ b/src/main/java/teammates/ui/output/FeedbackSessionData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.time.Instant; @@ -36,9 +36,11 @@ public class FeedbackSessionData extends ApiOutput { private Boolean isClosingEmailEnabled; private Boolean isPublishedEmailEnabled; - private final long createdAtTimestamp; + private long createdAtTimestamp; @Nullable private final Long deletedAtTimestamp; + @Nullable + private InstructorPrivilegeData privileges; public FeedbackSessionData(FeedbackSessionAttributes feedbackSessionAttributes) { this.courseId = feedbackSessionAttributes.getCourseId(); @@ -205,21 +207,41 @@ public long getCreatedAtTimestamp() { return createdAtTimestamp; } + public void setCreatedAtTimestamp(long timestamp) { + createdAtTimestamp = timestamp; + } + public Long getDeletedAtTimestamp() { return deletedAtTimestamp; } + public InstructorPrivilegeData getPrivileges() { + return privileges; + } + + public void setPrivileges(InstructorPrivilegeData privileges) { + this.privileges = privileges; + } + /** * Hides some attributes to student. */ public void hideInformationForStudent() { + hideInformationForInstructor(); setResultVisibleFromTimestamp(null); - setGracePeriod(null); setSessionVisibleSetting(null); setCustomSessionVisibleTimestamp(null); setResponseVisibleSetting(null); setCustomResponseVisibleTimestamp(null); + } + + /** + * Hides some attributes to instructor without appropriate privilege. + */ + public void hideInformationForInstructor() { setClosingEmailEnabled(null); setPublishedEmailEnabled(null); + setGracePeriod(null); + setCreatedAtTimestamp(0); } } diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionPublishStatus.java b/src/main/java/teammates/ui/output/FeedbackSessionPublishStatus.java similarity index 87% rename from src/main/java/teammates/ui/webapi/output/FeedbackSessionPublishStatus.java rename to src/main/java/teammates/ui/output/FeedbackSessionPublishStatus.java index a911ee1bda2..de9a5c533b7 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionPublishStatus.java +++ b/src/main/java/teammates/ui/output/FeedbackSessionPublishStatus.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The publish status of the a feedback session. diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionStatsData.java b/src/main/java/teammates/ui/output/FeedbackSessionStatsData.java similarity index 93% rename from src/main/java/teammates/ui/webapi/output/FeedbackSessionStatsData.java rename to src/main/java/teammates/ui/output/FeedbackSessionStatsData.java index eae574162c0..2465c3c0ecf 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionStatsData.java +++ b/src/main/java/teammates/ui/output/FeedbackSessionStatsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * API output of Feedback Session Stats. diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionSubmissionStatus.java b/src/main/java/teammates/ui/output/FeedbackSessionSubmissionStatus.java similarity index 93% rename from src/main/java/teammates/ui/webapi/output/FeedbackSessionSubmissionStatus.java rename to src/main/java/teammates/ui/output/FeedbackSessionSubmissionStatus.java index 114a0dce24b..52f7745ac87 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionSubmissionStatus.java +++ b/src/main/java/teammates/ui/output/FeedbackSessionSubmissionStatus.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The submission status of a feedback session. diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionSubmittedGiverSet.java b/src/main/java/teammates/ui/output/FeedbackSessionSubmittedGiverSet.java similarity index 92% rename from src/main/java/teammates/ui/webapi/output/FeedbackSessionSubmittedGiverSet.java rename to src/main/java/teammates/ui/output/FeedbackSessionSubmittedGiverSet.java index 8cd95fb1112..f1408c99938 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionSubmittedGiverSet.java +++ b/src/main/java/teammates/ui/output/FeedbackSessionSubmittedGiverSet.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.Set; diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionsData.java b/src/main/java/teammates/ui/output/FeedbackSessionsData.java similarity index 95% rename from src/main/java/teammates/ui/webapi/output/FeedbackSessionsData.java rename to src/main/java/teammates/ui/output/FeedbackSessionsData.java index 48b145de30c..8850c7f03f7 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionsData.java +++ b/src/main/java/teammates/ui/output/FeedbackSessionsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; import java.util.stream.Collectors; diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackVisibilityType.java b/src/main/java/teammates/ui/output/FeedbackVisibilityType.java similarity index 92% rename from src/main/java/teammates/ui/webapi/output/FeedbackVisibilityType.java rename to src/main/java/teammates/ui/output/FeedbackVisibilityType.java index 062dbb73e6f..4a934609d09 100644 --- a/src/main/java/teammates/ui/webapi/output/FeedbackVisibilityType.java +++ b/src/main/java/teammates/ui/output/FeedbackVisibilityType.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The feedback visibility type. diff --git a/src/main/java/teammates/ui/webapi/output/HasResponsesData.java b/src/main/java/teammates/ui/output/HasResponsesData.java similarity index 91% rename from src/main/java/teammates/ui/webapi/output/HasResponsesData.java rename to src/main/java/teammates/ui/output/HasResponsesData.java index d9f6624ebfc..a04f9a14506 100644 --- a/src/main/java/teammates/ui/webapi/output/HasResponsesData.java +++ b/src/main/java/teammates/ui/output/HasResponsesData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The API output format to represent if there are responses. diff --git a/src/main/java/teammates/ui/webapi/output/InstructorData.java b/src/main/java/teammates/ui/output/InstructorData.java similarity index 88% rename from src/main/java/teammates/ui/webapi/output/InstructorData.java rename to src/main/java/teammates/ui/output/InstructorData.java index 30196575d33..eac3178444e 100644 --- a/src/main/java/teammates/ui/webapi/output/InstructorData.java +++ b/src/main/java/teammates/ui/output/InstructorData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import javax.annotation.Nullable; @@ -8,6 +8,7 @@ * The API output format of an instructor. */ public class InstructorData extends ApiOutput { + @Nullable private String googleId; private final String courseId; private final String email; @@ -25,7 +26,6 @@ public class InstructorData extends ApiOutput { private String institute; public InstructorData(InstructorAttributes instructorAttributes) { - this.googleId = instructorAttributes.getGoogleId(); this.courseId = instructorAttributes.getCourseId(); this.email = instructorAttributes.getEmail(); this.role = instructorAttributes.getRole() == null ? null @@ -105,23 +105,16 @@ public void setInstitute(String institute) { this.institute = institute; } - /** - * Hides some attributes for search result. - */ - public void hideInformationForSearch() { - setRole(null); - setDisplayedToStudentsAs(null); - setIsDisplayedToStudents(null); - } - /** * Adds additional attributes only for search result for admin. * * @param key Encrypted registration key - * @param institute Institute of the student + * @param institute Institute of the instructor + * @param googleId Google ID of the instructor */ - public void addAdditionalInformationForAdminSearch(String key, String institute) { + public void addAdditionalInformationForAdminSearch(String key, String institute, String googleId) { setKey(key); setInstitute(institute); + setGoogleId(googleId); } } diff --git a/src/main/java/teammates/ui/webapi/output/InstructorPermissionRole.java b/src/main/java/teammates/ui/output/InstructorPermissionRole.java similarity index 98% rename from src/main/java/teammates/ui/webapi/output/InstructorPermissionRole.java rename to src/main/java/teammates/ui/output/InstructorPermissionRole.java index 8f5cc932a9c..63de0d2bcbd 100644 --- a/src/main/java/teammates/ui/webapi/output/InstructorPermissionRole.java +++ b/src/main/java/teammates/ui/output/InstructorPermissionRole.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import teammates.common.util.Const; diff --git a/src/main/java/teammates/ui/webapi/output/InstructorPrivilegeData.java b/src/main/java/teammates/ui/output/InstructorPrivilegeData.java similarity index 99% rename from src/main/java/teammates/ui/webapi/output/InstructorPrivilegeData.java rename to src/main/java/teammates/ui/output/InstructorPrivilegeData.java index 4974a9de23d..4b188d0a82a 100644 --- a/src/main/java/teammates/ui/webapi/output/InstructorPrivilegeData.java +++ b/src/main/java/teammates/ui/output/InstructorPrivilegeData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import teammates.common.datatransfer.InstructorPrivileges; import teammates.common.util.Const; diff --git a/src/main/java/teammates/ui/webapi/output/InstructorsData.java b/src/main/java/teammates/ui/output/InstructorsData.java similarity index 95% rename from src/main/java/teammates/ui/webapi/output/InstructorsData.java rename to src/main/java/teammates/ui/output/InstructorsData.java index 0593c0c8dfe..c886c346698 100644 --- a/src/main/java/teammates/ui/webapi/output/InstructorsData.java +++ b/src/main/java/teammates/ui/output/InstructorsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/teammates/ui/webapi/output/JoinLinkData.java b/src/main/java/teammates/ui/output/JoinLinkData.java similarity index 88% rename from src/main/java/teammates/ui/webapi/output/JoinLinkData.java rename to src/main/java/teammates/ui/output/JoinLinkData.java index 4a8c5c2f1cf..240c58ef778 100644 --- a/src/main/java/teammates/ui/webapi/output/JoinLinkData.java +++ b/src/main/java/teammates/ui/output/JoinLinkData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * Output format for join link. diff --git a/src/main/java/teammates/ui/webapi/output/JoinState.java b/src/main/java/teammates/ui/output/JoinState.java similarity index 86% rename from src/main/java/teammates/ui/webapi/output/JoinState.java rename to src/main/java/teammates/ui/output/JoinState.java index e0f1c226923..5e4cff6a6cf 100644 --- a/src/main/java/teammates/ui/webapi/output/JoinState.java +++ b/src/main/java/teammates/ui/output/JoinState.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The join state of an(a) instructor/student. diff --git a/src/main/java/teammates/ui/webapi/output/JoinStatus.java b/src/main/java/teammates/ui/output/JoinStatus.java similarity index 92% rename from src/main/java/teammates/ui/webapi/output/JoinStatus.java rename to src/main/java/teammates/ui/output/JoinStatus.java index 3ff6706ec2b..faffe32ce28 100644 --- a/src/main/java/teammates/ui/webapi/output/JoinStatus.java +++ b/src/main/java/teammates/ui/output/JoinStatus.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The join status of a course. diff --git a/src/main/java/teammates/ui/webapi/output/LocalDateTimeInfo.java b/src/main/java/teammates/ui/output/LocalDateTimeInfo.java similarity index 99% rename from src/main/java/teammates/ui/webapi/output/LocalDateTimeInfo.java rename to src/main/java/teammates/ui/output/LocalDateTimeInfo.java index 6bcdd7d8ed7..5b2f41c5b9c 100644 --- a/src/main/java/teammates/ui/webapi/output/LocalDateTimeInfo.java +++ b/src/main/java/teammates/ui/output/LocalDateTimeInfo.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.time.LocalDateTime; import java.time.ZoneId; diff --git a/src/main/java/teammates/ui/webapi/output/MessageOutput.java b/src/main/java/teammates/ui/output/MessageOutput.java similarity index 89% rename from src/main/java/teammates/ui/webapi/output/MessageOutput.java rename to src/main/java/teammates/ui/output/MessageOutput.java index c22976927b0..af975359970 100644 --- a/src/main/java/teammates/ui/webapi/output/MessageOutput.java +++ b/src/main/java/teammates/ui/output/MessageOutput.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * Generic output format for message-producing endpoint. diff --git a/src/main/java/teammates/ui/webapi/output/NationalitiesData.java b/src/main/java/teammates/ui/output/NationalitiesData.java similarity index 91% rename from src/main/java/teammates/ui/webapi/output/NationalitiesData.java rename to src/main/java/teammates/ui/output/NationalitiesData.java index ee09c96b94c..c19d1e70390 100644 --- a/src/main/java/teammates/ui/webapi/output/NationalitiesData.java +++ b/src/main/java/teammates/ui/output/NationalitiesData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; diff --git a/src/main/java/teammates/ui/webapi/output/NumberOfEntitiesToGiveFeedbackToSetting.java b/src/main/java/teammates/ui/output/NumberOfEntitiesToGiveFeedbackToSetting.java similarity index 89% rename from src/main/java/teammates/ui/webapi/output/NumberOfEntitiesToGiveFeedbackToSetting.java rename to src/main/java/teammates/ui/output/NumberOfEntitiesToGiveFeedbackToSetting.java index 6c2658bad62..464dc0622f7 100644 --- a/src/main/java/teammates/ui/webapi/output/NumberOfEntitiesToGiveFeedbackToSetting.java +++ b/src/main/java/teammates/ui/output/NumberOfEntitiesToGiveFeedbackToSetting.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The setting of number of entities to giver feedback to. diff --git a/src/main/java/teammates/ui/webapi/output/OngoingSession.java b/src/main/java/teammates/ui/output/OngoingSession.java similarity index 95% rename from src/main/java/teammates/ui/webapi/output/OngoingSession.java rename to src/main/java/teammates/ui/output/OngoingSession.java index 35324bbcc4a..5320664f064 100644 --- a/src/main/java/teammates/ui/webapi/output/OngoingSession.java +++ b/src/main/java/teammates/ui/output/OngoingSession.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.ArrayList; import java.util.List; @@ -42,7 +42,7 @@ public OngoingSession(FeedbackSessionAttributes fs, AccountAttributes account) { /** * Gets the status for a feedback session to be displayed to the user. */ - public String getSessionStatusForShow(FeedbackSessionAttributes fs) { + private String getSessionStatusForShow(FeedbackSessionAttributes fs) { List status = new ArrayList<>(); if (fs.isClosed()) { diff --git a/src/main/java/teammates/ui/webapi/output/OngoingSessionsData.java b/src/main/java/teammates/ui/output/OngoingSessionsData.java similarity index 97% rename from src/main/java/teammates/ui/webapi/output/OngoingSessionsData.java rename to src/main/java/teammates/ui/output/OngoingSessionsData.java index 6f2f78700e9..acdf91847fc 100644 --- a/src/main/java/teammates/ui/webapi/output/OngoingSessionsData.java +++ b/src/main/java/teammates/ui/output/OngoingSessionsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.List; import java.util.Map; diff --git a/src/main/java/teammates/ui/webapi/output/RegenerateStudentCourseLinksData.java b/src/main/java/teammates/ui/output/RegenerateStudentCourseLinksData.java similarity index 93% rename from src/main/java/teammates/ui/webapi/output/RegenerateStudentCourseLinksData.java rename to src/main/java/teammates/ui/output/RegenerateStudentCourseLinksData.java index f10dd115b97..1d15ff97677 100644 --- a/src/main/java/teammates/ui/webapi/output/RegenerateStudentCourseLinksData.java +++ b/src/main/java/teammates/ui/output/RegenerateStudentCourseLinksData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The API output format for the regenerate student's course links request. diff --git a/src/main/java/teammates/ui/output/RegkeyValidityData.java b/src/main/java/teammates/ui/output/RegkeyValidityData.java new file mode 100644 index 00000000000..9dd26f5dbbc --- /dev/null +++ b/src/main/java/teammates/ui/output/RegkeyValidityData.java @@ -0,0 +1,38 @@ +package teammates.ui.output; + +/** + * The API output format to represent if the registration key is valid for the logged in user (or lack thereof). + */ +public class RegkeyValidityData extends ApiOutput { + private final boolean isValid; + private final boolean isUsed; + private final boolean isAllowedAccess; + + public RegkeyValidityData(boolean isValid, boolean isUsed, boolean isAllowedAccess) { + this.isValid = isValid; + this.isUsed = isUsed; + this.isAllowedAccess = isAllowedAccess; + } + + /** + * Returns true if the registration key is valid, false otherwise. + */ + public boolean isValid() { + return isValid; + } + + /** + * Returns true if the registration key has been used, false otherwise. + */ + public boolean isUsed() { + return isUsed; + } + + /** + * Returns true if access is allowed for the requester by using the registration key, false otherwise. + */ + public boolean isAllowedAccess() { + return isAllowedAccess; + } + +} diff --git a/src/main/java/teammates/ui/webapi/output/ResponseVisibleSetting.java b/src/main/java/teammates/ui/output/ResponseVisibleSetting.java similarity index 89% rename from src/main/java/teammates/ui/webapi/output/ResponseVisibleSetting.java rename to src/main/java/teammates/ui/output/ResponseVisibleSetting.java index 518a0d89ddd..b302764a4a6 100644 --- a/src/main/java/teammates/ui/webapi/output/ResponseVisibleSetting.java +++ b/src/main/java/teammates/ui/output/ResponseVisibleSetting.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The option for response visible setting. diff --git a/src/main/java/teammates/ui/webapi/output/SessionLinksRecoveryResponseData.java b/src/main/java/teammates/ui/output/SessionLinksRecoveryResponseData.java similarity index 93% rename from src/main/java/teammates/ui/webapi/output/SessionLinksRecoveryResponseData.java rename to src/main/java/teammates/ui/output/SessionLinksRecoveryResponseData.java index 44a23b5d98b..9b7f949da6d 100644 --- a/src/main/java/teammates/ui/webapi/output/SessionLinksRecoveryResponseData.java +++ b/src/main/java/teammates/ui/output/SessionLinksRecoveryResponseData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The output format for session links recovery request. diff --git a/src/main/java/teammates/ui/webapi/output/SessionResultsData.java b/src/main/java/teammates/ui/output/SessionResultsData.java similarity index 88% rename from src/main/java/teammates/ui/webapi/output/SessionResultsData.java rename to src/main/java/teammates/ui/output/SessionResultsData.java index 89921a421db..651a5472212 100644 --- a/src/main/java/teammates/ui/webapi/output/SessionResultsData.java +++ b/src/main/java/teammates/ui/output/SessionResultsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.ArrayList; import java.util.Collections; @@ -16,10 +16,12 @@ import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.datatransfer.questions.FeedbackQuestionDetails; import teammates.common.datatransfer.questions.FeedbackResponseDetails; import teammates.common.util.Const; +import teammates.common.util.StringHelper; /** * API output format for session results, including statistics. @@ -28,10 +30,10 @@ public class SessionResultsData extends ApiOutput { private static final String REGEX_ANONYMOUS_PARTICIPANT_HASH = "[0-9]{1,10}"; - protected final List questions = new ArrayList<>(); - protected FeedbackSessionData feedbackSession; + final List questions = new ArrayList<>(); + FeedbackSessionData feedbackSession; - protected SessionResultsData() { + SessionResultsData() { // use factory method instead } @@ -86,10 +88,10 @@ public static SessionResultsData initForStudent(SessionResultsBundle bundle, Stu for (FeedbackResponseAttributes response : responses) { boolean isUserGiver = student.getEmail().equals(response.getGiver()); boolean isUserRecipient = student.getEmail().equals(response.getRecipient()); - if (isUserGiver) { - qnOutput.responsesFromSelf.add(buildSingleResponseForStudent(response, bundle, student)); - } else if (isUserRecipient) { + if (isUserRecipient) { qnOutput.responsesToSelf.add(buildSingleResponseForStudent(response, bundle, student)); + } else if (isUserGiver) { + qnOutput.responsesFromSelf.add(buildSingleResponseForStudent(response, bundle, student)); } else { // we don't need care about the keys of the map here // as only the values of the map will be used @@ -115,10 +117,13 @@ private static ResponseOutput buildSingleResponseForStudent( boolean isUserTeamGiver = question.giverType == FeedbackParticipantType.TEAMS && student.getTeam().equals(response.getGiver()); String giverName = ""; + String giverTeam = null; if (isUserTeamGiver) { giverName = String.format("Your Team (%s)", response.getGiver()); + giverTeam = response.getGiver(); } else if (isUserGiver) { giverName = "You"; + giverTeam = student.team; } else { // we don't want student to figure out who is who by using the hash giverName = removeAnonymousHash(getGiverNameOfResponse(response, bundle).getName()); @@ -129,10 +134,13 @@ private static ResponseOutput buildSingleResponseForStudent( boolean isUserTeamRecipient = question.getRecipientType() == FeedbackParticipantType.TEAMS && student.getTeam().equals(response.getRecipient()); String recipientName = ""; + String recipientTeam = null; if (isUserRecipient) { recipientName = "You"; + recipientTeam = student.team; } else if (isUserTeamRecipient) { recipientName = String.format("Your Team (%s)", response.getRecipient()); + recipientTeam = response.getRecipient(); } else { // we don't want student to figure out who is who by using the hash recipientName = removeAnonymousHash(getRecipientNameOfResponse(response, bundle).getName()); @@ -144,17 +152,18 @@ private static ResponseOutput buildSingleResponseForStudent( Queue comments = buildComments(feedbackResponseComments, bundle); // Student does not need to know the teams for giver and/or recipient + // unless the student him/herself is the giver and/or recipient return ResponseOutput.builder() .withResponseId(response.getId()) .withGiver(giverName) .withGiverLastName(null) - .withGiverTeam(null) + .withGiverTeam(giverTeam) .withGiverEmail(null) .withRelatedGiverEmail(null) .withGiverSection(response.getGiverSection()) .withRecipient(recipientName) .withRecipientLastName(null) - .withRecipientTeam(null) + .withRecipientTeam(recipientTeam) .withRecipientEmail(null) .withRecipientSection(response.getRecipientSection()) .withResponseDetails(response.getResponseDetails()) @@ -202,6 +211,9 @@ private static ResponseOutput buildSingleResponseForInstructor( String giverSection = response.getGiverSection(); FeedbackQuestionAttributes question = bundle.getQuestionsMap().get(response.getFeedbackQuestionId()); if (question.giverType == FeedbackParticipantType.INSTRUCTORS) { + InstructorAttributes instructor = bundle.getRoster().getInstructorForEmail(response.getGiver()); + giverName = instructor.getName(); + giverLastName = StringHelper.splitName(giverName)[1]; // get the last name from full name giverTeam = Const.USER_TEAM_FOR_INSTRUCTOR; giverSection = Const.DEFAULT_SECTION; } @@ -215,6 +227,9 @@ private static ResponseOutput buildSingleResponseForInstructor( bundle.getRoster().getInfoForIdentifier(response.getRecipient()).getTeamName(); String recipientSection = response.getRecipientSection(); if (question.recipientType == FeedbackParticipantType.INSTRUCTORS) { + InstructorAttributes instructor = bundle.getRoster().getInstructorForEmail(response.getRecipient()); + recipientName = instructor.getName(); + recipientLastName = StringHelper.splitName(giverName)[1]; // get the last name from full name recipientTeam = Const.USER_TEAM_FOR_INSTRUCTOR; recipientSection = Const.DEFAULT_SECTION; } @@ -391,13 +406,13 @@ public static class QuestionOutput { private final List responsesFromSelf = new ArrayList<>(); private final List> otherResponses = new ArrayList<>(); - QuestionOutput(FeedbackQuestionAttributes feedbackQuestionAttributes, String questionStatistics) { + private QuestionOutput(FeedbackQuestionAttributes feedbackQuestionAttributes, String questionStatistics) { this.feedbackQuestion = new FeedbackQuestionData(feedbackQuestionAttributes); this.questionStatistics = questionStatistics; } - protected QuestionOutput(FeedbackQuestionAttributes feedbackQuestionAttributes, - List allResponses) { + QuestionOutput(FeedbackQuestionAttributes feedbackQuestionAttributes, + List allResponses) { this.questionStatistics = null; this.feedbackQuestion = new FeedbackQuestionData(feedbackQuestionAttributes); this.allResponses.addAll(allResponses); @@ -436,7 +451,6 @@ public static class ResponseOutput { private boolean isMissingResponse; - // TODO: security risk: responseId can expose giver and recipient email private String responseId; private String giver; @@ -473,7 +487,7 @@ private ResponseOutput() { /** * Returns a builder for {@link ResponseOutput}. */ - public static Builder builder() { + static Builder builder() { return new Builder(); } @@ -558,87 +572,87 @@ private Builder() { } //CHECKSTYLE.OFF:MissingJavadocMethod - public Builder withIsMissingResponse(boolean isMissingResponse) { + private Builder withIsMissingResponse(boolean isMissingResponse) { responseOutput.isMissingResponse = isMissingResponse; return this; } - public Builder withResponseId(String responseId) { - responseOutput.responseId = responseId; + Builder withResponseId(String responseId) { + responseOutput.responseId = StringHelper.encrypt(responseId); return this; } - public Builder withGiver(String giverName) { + Builder withGiver(String giverName) { responseOutput.giver = giverName; return this; } - public Builder withGiverLastName(String giverLastName) { + private Builder withGiverLastName(String giverLastName) { responseOutput.giverLastName = giverLastName; return this; } - public Builder withRelatedGiverEmail(@Nullable String relatedGiverEmail) { + private Builder withRelatedGiverEmail(@Nullable String relatedGiverEmail) { responseOutput.relatedGiverEmail = relatedGiverEmail; return this; } - public Builder withGiverTeam(String giverTeam) { + private Builder withGiverTeam(String giverTeam) { responseOutput.giverTeam = giverTeam; return this; } - public Builder withGiverEmail(@Nullable String giverEmail) { + Builder withGiverEmail(@Nullable String giverEmail) { responseOutput.giverEmail = giverEmail; return this; } - public Builder withGiverSection(String giverSection) { + Builder withGiverSection(String giverSection) { responseOutput.giverSection = giverSection; return this; } - public Builder withRecipient(String recipientName) { + Builder withRecipient(String recipientName) { responseOutput.recipient = recipientName; return this; } - public Builder withRecipientLastName(String recipientLastName) { + private Builder withRecipientLastName(String recipientLastName) { responseOutput.recipientLastName = recipientLastName; return this; } - public Builder withRecipientTeam(String recipientTeam) { + private Builder withRecipientTeam(String recipientTeam) { responseOutput.recipientTeam = recipientTeam; return this; } - public Builder withRecipientEmail(@Nullable String recipientEmail) { + Builder withRecipientEmail(@Nullable String recipientEmail) { responseOutput.recipientEmail = recipientEmail; return this; } - public Builder withRecipientSection(String recipientSection) { + Builder withRecipientSection(String recipientSection) { responseOutput.recipientSection = recipientSection; return this; } - public Builder withResponseDetails(FeedbackResponseDetails responseDetails) { + Builder withResponseDetails(FeedbackResponseDetails responseDetails) { responseOutput.responseDetails = responseDetails; return this; } - public Builder withParticipantComment(@Nullable CommentOutput participantComment) { + Builder withParticipantComment(@Nullable CommentOutput participantComment) { responseOutput.participantComment = participantComment; return this; } - public Builder withInstructorComments(List instructorComments) { + Builder withInstructorComments(List instructorComments) { responseOutput.instructorComments = instructorComments; return this; } - public ResponseOutput build() { + ResponseOutput build() { return responseOutput; } //CHECKSTYLE.ON:MissingJavadocMethod @@ -663,7 +677,7 @@ private CommentOutput(FeedbackResponseCommentAttributes frc) { /** * Returns a builder for {@link CommentOutput}. */ - public static Builder builder(FeedbackResponseCommentAttributes frc) { + static Builder builder(FeedbackResponseCommentAttributes frc) { return new Builder(frc); } @@ -688,27 +702,27 @@ private Builder(FeedbackResponseCommentAttributes frc) { } //CHECKSTYLE.OFF:MissingJavadocMethod - public Builder withCommentGiver(@Nullable String commentGiver) { + Builder withCommentGiver(@Nullable String commentGiver) { commentOutput.commentGiver = commentGiver; return this; } - public Builder withCommentGiverName(@Nullable String commentGiverName) { + Builder withCommentGiverName(@Nullable String commentGiverName) { commentOutput.commentGiverName = commentGiverName; return this; } - public Builder withLastEditorEmail(@Nullable String lastEditorEmail) { + Builder withLastEditorEmail(@Nullable String lastEditorEmail) { commentOutput.lastEditorEmail = lastEditorEmail; return this; } - public Builder withLastEditorName(@Nullable String lastEditorName) { + Builder withLastEditorName(@Nullable String lastEditorName) { commentOutput.lastEditorName = lastEditorName; return this; } - public CommentOutput build() { + CommentOutput build() { return commentOutput; } //CHECKSTYLE.ON:MissingJavadocMethod diff --git a/src/main/java/teammates/ui/webapi/output/SessionVisibleSetting.java b/src/main/java/teammates/ui/output/SessionVisibleSetting.java similarity index 85% rename from src/main/java/teammates/ui/webapi/output/SessionVisibleSetting.java rename to src/main/java/teammates/ui/output/SessionVisibleSetting.java index 82d8aec3eea..e4b949847a8 100644 --- a/src/main/java/teammates/ui/webapi/output/SessionVisibleSetting.java +++ b/src/main/java/teammates/ui/output/SessionVisibleSetting.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * The option for session visible setting. diff --git a/src/main/java/teammates/ui/webapi/output/StudentData.java b/src/main/java/teammates/ui/output/StudentData.java similarity index 89% rename from src/main/java/teammates/ui/webapi/output/StudentData.java rename to src/main/java/teammates/ui/output/StudentData.java index 6543457afeb..a1867f25324 100644 --- a/src/main/java/teammates/ui/webapi/output/StudentData.java +++ b/src/main/java/teammates/ui/output/StudentData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import javax.annotation.Nullable; @@ -23,7 +23,7 @@ public class StudentData extends ApiOutput { private String key; @Nullable private String institute; - + @Nullable private JoinState joinState; private final String teamName; @@ -33,7 +33,6 @@ public StudentData(StudentAttributes studentAttributes) { this.email = studentAttributes.getEmail(); this.courseId = studentAttributes.getCourse(); this.name = studentAttributes.getName(); - this.googleId = studentAttributes.getGoogleId(); this.lastName = studentAttributes.getLastName(); this.joinState = studentAttributes.isRegistered() ? JoinState.JOINED : JoinState.NOT_JOINED; this.comments = studentAttributes.getComments(); @@ -117,21 +116,22 @@ public void hideLastName() { } /** - * Hides some attributes to instructor. + * Hides some attributes to student. */ - public void hideInformationForInstructor() { - setGoogleId(null); + public void hideInformationForStudent() { setComments(null); + setJoinState(null); } /** * Adds additional information only for search result for admin. - * - * @param key The encyrpted key + * @param key The encrypted key * @param institute The institute of the student + * @param googleId The googleId of the student */ - public void addAdditionalInformationForAdminSearch(String key, String institute) { + public void addAdditionalInformationForAdminSearch(String key, String institute, String googleId) { this.setKey(key); this.setInstitute(institute); + this.setGoogleId(googleId); } } diff --git a/src/main/java/teammates/ui/webapi/output/StudentProfileData.java b/src/main/java/teammates/ui/output/StudentProfileData.java similarity index 97% rename from src/main/java/teammates/ui/webapi/output/StudentProfileData.java rename to src/main/java/teammates/ui/output/StudentProfileData.java index 8ace6bbf06a..fbf0477f7f2 100644 --- a/src/main/java/teammates/ui/webapi/output/StudentProfileData.java +++ b/src/main/java/teammates/ui/output/StudentProfileData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.datatransfer.attributes.StudentProfileAttributes.Gender; diff --git a/src/main/java/teammates/ui/webapi/output/StudentProfilePictureResults.java b/src/main/java/teammates/ui/output/StudentProfilePictureResults.java similarity index 90% rename from src/main/java/teammates/ui/webapi/output/StudentProfilePictureResults.java rename to src/main/java/teammates/ui/output/StudentProfilePictureResults.java index 7eee34ffe6c..678b2adae4a 100644 --- a/src/main/java/teammates/ui/webapi/output/StudentProfilePictureResults.java +++ b/src/main/java/teammates/ui/output/StudentProfilePictureResults.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; /** * API output for profile picture results. diff --git a/src/main/java/teammates/ui/webapi/output/StudentsData.java b/src/main/java/teammates/ui/output/StudentsData.java similarity index 95% rename from src/main/java/teammates/ui/webapi/output/StudentsData.java rename to src/main/java/teammates/ui/output/StudentsData.java index e1aa6e7534d..a5921316add 100644 --- a/src/main/java/teammates/ui/webapi/output/StudentsData.java +++ b/src/main/java/teammates/ui/output/StudentsData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/teammates/ui/webapi/output/TimeZonesData.java b/src/main/java/teammates/ui/output/TimeZonesData.java similarity index 93% rename from src/main/java/teammates/ui/webapi/output/TimeZonesData.java rename to src/main/java/teammates/ui/output/TimeZonesData.java index 61737feba14..b9d2fbceec6 100644 --- a/src/main/java/teammates/ui/webapi/output/TimeZonesData.java +++ b/src/main/java/teammates/ui/output/TimeZonesData.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.output; +package teammates.ui.output; import java.util.Map; diff --git a/src/main/java/teammates/ui/webapi/output/package-info.java b/src/main/java/teammates/ui/output/package-info.java similarity index 55% rename from src/main/java/teammates/ui/webapi/output/package-info.java rename to src/main/java/teammates/ui/output/package-info.java index fa82aca2b20..64dfd8c63f1 100644 --- a/src/main/java/teammates/ui/webapi/output/package-info.java +++ b/src/main/java/teammates/ui/output/package-info.java @@ -1,4 +1,4 @@ /** * Contains all API output formats. */ -package teammates.ui.webapi.output; +package teammates.ui.output; diff --git a/src/main/java/teammates/ui/webapi/request/AccountCreateRequest.java b/src/main/java/teammates/ui/request/AccountCreateRequest.java similarity index 98% rename from src/main/java/teammates/ui/webapi/request/AccountCreateRequest.java rename to src/main/java/teammates/ui/request/AccountCreateRequest.java index b0b31525606..6cf75aaab23 100644 --- a/src/main/java/teammates/ui/webapi/request/AccountCreateRequest.java +++ b/src/main/java/teammates/ui/request/AccountCreateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/teammates/ui/webapi/request/BasicRequest.java b/src/main/java/teammates/ui/request/BasicRequest.java similarity index 81% rename from src/main/java/teammates/ui/webapi/request/BasicRequest.java rename to src/main/java/teammates/ui/request/BasicRequest.java index 54228d74539..4135bb416f4 100644 --- a/src/main/java/teammates/ui/webapi/request/BasicRequest.java +++ b/src/main/java/teammates/ui/request/BasicRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import teammates.common.exception.InvalidHttpRequestBodyException; @@ -15,7 +15,7 @@ public abstract class BasicRequest { /** * Asserts a condition or throws {@link InvalidHttpRequestBodyException}. */ - public void assertTrue(boolean condition, String message) { + void assertTrue(boolean condition, String message) { if (!condition) { throw new InvalidHttpRequestBodyException(message); } diff --git a/src/main/java/teammates/ui/webapi/request/CourseArchiveRequest.java b/src/main/java/teammates/ui/request/CourseArchiveRequest.java similarity index 91% rename from src/main/java/teammates/ui/webapi/request/CourseArchiveRequest.java rename to src/main/java/teammates/ui/request/CourseArchiveRequest.java index 2113dc56d07..8e29c81a6da 100644 --- a/src/main/java/teammates/ui/webapi/request/CourseArchiveRequest.java +++ b/src/main/java/teammates/ui/request/CourseArchiveRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The archive request of a course. diff --git a/src/main/java/teammates/ui/webapi/request/CourseBasicRequest.java b/src/main/java/teammates/ui/request/CourseBasicRequest.java similarity index 94% rename from src/main/java/teammates/ui/webapi/request/CourseBasicRequest.java rename to src/main/java/teammates/ui/request/CourseBasicRequest.java index e1fa5961374..7a027dfd292 100644 --- a/src/main/java/teammates/ui/webapi/request/CourseBasicRequest.java +++ b/src/main/java/teammates/ui/request/CourseBasicRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The basic request of modifying a course. diff --git a/src/main/java/teammates/ui/webapi/request/CourseCreateRequest.java b/src/main/java/teammates/ui/request/CourseCreateRequest.java similarity index 92% rename from src/main/java/teammates/ui/webapi/request/CourseCreateRequest.java rename to src/main/java/teammates/ui/request/CourseCreateRequest.java index b8856656f02..3db168e4c3c 100644 --- a/src/main/java/teammates/ui/webapi/request/CourseCreateRequest.java +++ b/src/main/java/teammates/ui/request/CourseCreateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The create request for the course. diff --git a/src/main/java/teammates/ui/webapi/request/CourseUpdateRequest.java b/src/main/java/teammates/ui/request/CourseUpdateRequest.java similarity index 74% rename from src/main/java/teammates/ui/webapi/request/CourseUpdateRequest.java rename to src/main/java/teammates/ui/request/CourseUpdateRequest.java index c1bcb5c86f1..baacb1f5301 100644 --- a/src/main/java/teammates/ui/webapi/request/CourseUpdateRequest.java +++ b/src/main/java/teammates/ui/request/CourseUpdateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The update request for a course. diff --git a/src/main/java/teammates/ui/webapi/request/ErrorReportRequest.java b/src/main/java/teammates/ui/request/ErrorReportRequest.java similarity index 95% rename from src/main/java/teammates/ui/webapi/request/ErrorReportRequest.java rename to src/main/java/teammates/ui/request/ErrorReportRequest.java index 70a90ef75b3..27fd6d0d203 100644 --- a/src/main/java/teammates/ui/webapi/request/ErrorReportRequest.java +++ b/src/main/java/teammates/ui/request/ErrorReportRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The create request for an error report to be emailed to the admin. diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackQuestionBasicRequest.java b/src/main/java/teammates/ui/request/FeedbackQuestionBasicRequest.java similarity index 95% rename from src/main/java/teammates/ui/webapi/request/FeedbackQuestionBasicRequest.java rename to src/main/java/teammates/ui/request/FeedbackQuestionBasicRequest.java index c0e9a5cca04..0e04bfd65c1 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackQuestionBasicRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackQuestionBasicRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.util.List; import java.util.Map; @@ -10,8 +10,8 @@ import teammates.common.util.Assumption; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.ui.webapi.output.FeedbackVisibilityType; -import teammates.ui.webapi.output.NumberOfEntitiesToGiveFeedbackToSetting; +import teammates.ui.output.FeedbackVisibilityType; +import teammates.ui.output.NumberOfEntitiesToGiveFeedbackToSetting; /** * The basic request of modifying a feedback question. @@ -70,7 +70,7 @@ public String getQuestionDescription() { */ public FeedbackQuestionDetails getQuestionDetails() { FeedbackQuestionDetails details = - JsonUtils.fromJson(JsonUtils.toJson(questionDetails), questionType.getQuestionDetailsClass()); + JsonUtils.fromJson(JsonUtils.toCompactJson(questionDetails), questionType.getQuestionDetailsClass()); details.setQuestionText(questionBrief); // TODO remove this after migrate CONSTSUM to either CONSTSUM_OPTIONS or CONSTSUM_RECIPIENTS if (questionType == FeedbackQuestionType.CONSTSUM_OPTIONS @@ -172,7 +172,7 @@ public void setQuestionDescription(String questionDescription) { } public void setQuestionDetails(FeedbackQuestionDetails questionDetails) { - this.questionDetails = JsonUtils.fromJson(JsonUtils.toJson(questionDetails), Map.class); + this.questionDetails = JsonUtils.fromJson(JsonUtils.toCompactJson(questionDetails), Map.class); } public void setQuestionType(FeedbackQuestionType questionType) { diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackQuestionCreateRequest.java b/src/main/java/teammates/ui/request/FeedbackQuestionCreateRequest.java similarity index 78% rename from src/main/java/teammates/ui/webapi/request/FeedbackQuestionCreateRequest.java rename to src/main/java/teammates/ui/request/FeedbackQuestionCreateRequest.java index 5d9c73a6f2e..0499d3faf55 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackQuestionCreateRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackQuestionCreateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The create request of a feedback question. diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackQuestionUpdateRequest.java b/src/main/java/teammates/ui/request/FeedbackQuestionUpdateRequest.java similarity index 78% rename from src/main/java/teammates/ui/webapi/request/FeedbackQuestionUpdateRequest.java rename to src/main/java/teammates/ui/request/FeedbackQuestionUpdateRequest.java index 47abf0218a1..65763816fe8 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackQuestionUpdateRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackQuestionUpdateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The update request of a feedback question. diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentBasicRequest.java b/src/main/java/teammates/ui/request/FeedbackResponseCommentBasicRequest.java similarity index 83% rename from src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentBasicRequest.java rename to src/main/java/teammates/ui/request/FeedbackResponseCommentBasicRequest.java index 66b3544ab4d..678534edd16 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentBasicRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackResponseCommentBasicRequest.java @@ -1,25 +1,25 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.util.List; import java.util.stream.Collectors; import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.util.Assumption; -import teammates.ui.webapi.output.CommentVisibilityType; +import teammates.ui.output.CommentVisibilityType; /** * The basic request of modifying a feedback response comment. */ -public class FeedbackResponseCommentBasicRequest extends BasicRequest { +class FeedbackResponseCommentBasicRequest extends BasicRequest { private String commentText; private List showCommentTo; private List showGiverNameTo; - public FeedbackResponseCommentBasicRequest(String commentText, - List showCommentTo, - List showGiverNameTo) { + FeedbackResponseCommentBasicRequest(String commentText, + List showCommentTo, + List showGiverNameTo) { this.commentText = commentText; this.showCommentTo = showCommentTo; this.showGiverNameTo = showGiverNameTo; diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentCreateRequest.java b/src/main/java/teammates/ui/request/FeedbackResponseCommentCreateRequest.java similarity index 84% rename from src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentCreateRequest.java rename to src/main/java/teammates/ui/request/FeedbackResponseCommentCreateRequest.java index 88ef9cdcffd..3dc35f78e9d 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentCreateRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackResponseCommentCreateRequest.java @@ -1,8 +1,8 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.util.List; -import teammates.ui.webapi.output.CommentVisibilityType; +import teammates.ui.output.CommentVisibilityType; /** * The create request of a feedback response comment. diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentUpdateRequest.java b/src/main/java/teammates/ui/request/FeedbackResponseCommentUpdateRequest.java similarity index 84% rename from src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentUpdateRequest.java rename to src/main/java/teammates/ui/request/FeedbackResponseCommentUpdateRequest.java index 03311f0124e..83a3a81906c 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCommentUpdateRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackResponseCommentUpdateRequest.java @@ -1,8 +1,8 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.util.List; -import teammates.ui.webapi.output.CommentVisibilityType; +import teammates.ui.output.CommentVisibilityType; /** * The update request of a feedback response comment. diff --git a/src/main/java/teammates/ui/request/FeedbackResponsesRequest.java b/src/main/java/teammates/ui/request/FeedbackResponsesRequest.java new file mode 100644 index 00000000000..217a7b9d7ab --- /dev/null +++ b/src/main/java/teammates/ui/request/FeedbackResponsesRequest.java @@ -0,0 +1,62 @@ +package teammates.ui.request; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import teammates.common.datatransfer.questions.FeedbackResponseDetails; + +/** + * The basic request of submitting a list of feedback responses. + */ +public class FeedbackResponsesRequest extends BasicRequest { + + private List responses = new ArrayList<>(); + + public List getResponses() { + return responses; + } + + public void setResponses(List responses) { + this.responses = responses; + } + + public List getRecipients() { + return responses.stream().map(FeedbackResponseRequest::getRecipient).collect(Collectors.toList()); + } + + @Override + public void validate() { + // No validation necessary; each response entities will be validated separately + } + + /** + * The basic request of submitting a feedback response. + */ + public static class FeedbackResponseRequest extends BasicRequest { + + private String recipient; + private FeedbackResponseDetails responseDetails; + + public FeedbackResponseRequest(String recipient, FeedbackResponseDetails responseDetails) { + this.recipient = recipient; + this.responseDetails = responseDetails; + } + + @Override + public void validate() { + assertTrue(recipient != null && !recipient.isEmpty(), "Recipient cannot be empty"); + assertTrue(responseDetails != null, "Response details cannot be null"); + } + + public String getRecipient() { + return recipient; + } + + public FeedbackResponseDetails getResponseDetails() { + return responseDetails; + } + + } + +} diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackSessionBasicRequest.java b/src/main/java/teammates/ui/request/FeedbackSessionBasicRequest.java similarity index 97% rename from src/main/java/teammates/ui/webapi/request/FeedbackSessionBasicRequest.java rename to src/main/java/teammates/ui/request/FeedbackSessionBasicRequest.java index 2d64346e77e..f2492f2bde9 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackSessionBasicRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackSessionBasicRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.time.Duration; import java.time.Instant; @@ -7,8 +7,8 @@ import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.ui.webapi.output.ResponseVisibleSetting; -import teammates.ui.webapi.output.SessionVisibleSetting; +import teammates.ui.output.ResponseVisibleSetting; +import teammates.ui.output.SessionVisibleSetting; /** * The basic request body format for creating/saving of feedback session. diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackSessionCreateRequest.java b/src/main/java/teammates/ui/request/FeedbackSessionCreateRequest.java similarity index 94% rename from src/main/java/teammates/ui/webapi/request/FeedbackSessionCreateRequest.java rename to src/main/java/teammates/ui/request/FeedbackSessionCreateRequest.java index 71e6b19106e..96d30d03179 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackSessionCreateRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackSessionCreateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The request body format for creation of feedback session. diff --git a/src/main/java/teammates/ui/request/FeedbackSessionRemindRequest.java b/src/main/java/teammates/ui/request/FeedbackSessionRemindRequest.java new file mode 100644 index 00000000000..9c70fdd505f --- /dev/null +++ b/src/main/java/teammates/ui/request/FeedbackSessionRemindRequest.java @@ -0,0 +1,45 @@ +package teammates.ui.request; + +/** + * The request of specifying reminder emails to be sent. + */ +public class FeedbackSessionRemindRequest extends BasicRequest { + + private final String courseId; + private final String feedbackSessionName; + private final String requestingInstructorId; + private final String[] usersToRemind; + + public FeedbackSessionRemindRequest(String courseId, String feedbackSessionName, String requestingInstructorId, + String[] usersToRemind) { + this.courseId = courseId; + this.feedbackSessionName = feedbackSessionName; + this.requestingInstructorId = requestingInstructorId; + this.usersToRemind = usersToRemind; + } + + public String getCourseId() { + return courseId; + } + + public String getFeedbackSessionName() { + return feedbackSessionName; + } + + public String getRequestingInstructorId() { + return requestingInstructorId; + } + + public String[] getUsersToRemind() { + return usersToRemind; + } + + @Override + public void validate() { + assertTrue(courseId != null, "Course ID cannot be null"); + assertTrue(feedbackSessionName != null, "Feedback session name cannot be null"); + assertTrue(usersToRemind != null, "List of users to remind cannot be null"); + assertTrue(usersToRemind.length != 0, "List of users to remind cannot be empty"); + } + +} diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackSessionStudentRemindRequest.java b/src/main/java/teammates/ui/request/FeedbackSessionRespondentRemindRequest.java similarity index 71% rename from src/main/java/teammates/ui/webapi/request/FeedbackSessionStudentRemindRequest.java rename to src/main/java/teammates/ui/request/FeedbackSessionRespondentRemindRequest.java index ce0759b02a2..b956c301a06 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackSessionStudentRemindRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackSessionRespondentRemindRequest.java @@ -1,9 +1,9 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** - * Sends a reminder email each to a list of students from feedback session. + * Sends a reminder email each to a list of respondents from a feedback session. */ -public class FeedbackSessionStudentRemindRequest extends BasicRequest { +public class FeedbackSessionRespondentRemindRequest extends BasicRequest { private String[] usersToRemind; public String[] getUsersToRemind() { diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackSessionUpdateRequest.java b/src/main/java/teammates/ui/request/FeedbackSessionUpdateRequest.java similarity index 78% rename from src/main/java/teammates/ui/webapi/request/FeedbackSessionUpdateRequest.java rename to src/main/java/teammates/ui/request/FeedbackSessionUpdateRequest.java index d401c2280a6..a88332ac64a 100644 --- a/src/main/java/teammates/ui/webapi/request/FeedbackSessionUpdateRequest.java +++ b/src/main/java/teammates/ui/request/FeedbackSessionUpdateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The update request of a feedback session. diff --git a/src/main/java/teammates/ui/webapi/request/InstructorCreateRequest.java b/src/main/java/teammates/ui/request/InstructorCreateRequest.java similarity index 94% rename from src/main/java/teammates/ui/webapi/request/InstructorCreateRequest.java rename to src/main/java/teammates/ui/request/InstructorCreateRequest.java index bc074457cf5..41f45619bbd 100644 --- a/src/main/java/teammates/ui/webapi/request/InstructorCreateRequest.java +++ b/src/main/java/teammates/ui/request/InstructorCreateRequest.java @@ -1,8 +1,8 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import javax.annotation.Nullable; -import teammates.ui.webapi.output.InstructorPermissionRole; +import teammates.ui.output.InstructorPermissionRole; /** * The create request for an instructor to be created. diff --git a/src/main/java/teammates/ui/webapi/request/InstructorPrivilegeUpdateRequest.java b/src/main/java/teammates/ui/request/InstructorPrivilegeUpdateRequest.java similarity index 99% rename from src/main/java/teammates/ui/webapi/request/InstructorPrivilegeUpdateRequest.java rename to src/main/java/teammates/ui/request/InstructorPrivilegeUpdateRequest.java index 3cc7e84692a..6281eba8d9d 100644 --- a/src/main/java/teammates/ui/webapi/request/InstructorPrivilegeUpdateRequest.java +++ b/src/main/java/teammates/ui/request/InstructorPrivilegeUpdateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/teammates/ui/webapi/request/Intent.java b/src/main/java/teammates/ui/request/Intent.java similarity index 93% rename from src/main/java/teammates/ui/webapi/request/Intent.java rename to src/main/java/teammates/ui/request/Intent.java index 8d95d58c7ec..0ec4524299a 100644 --- a/src/main/java/teammates/ui/webapi/request/Intent.java +++ b/src/main/java/teammates/ui/request/Intent.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The intent of calling the REST API. diff --git a/src/main/java/teammates/ui/request/SendEmailRequest.java b/src/main/java/teammates/ui/request/SendEmailRequest.java new file mode 100644 index 00000000000..5561c57db68 --- /dev/null +++ b/src/main/java/teammates/ui/request/SendEmailRequest.java @@ -0,0 +1,29 @@ +package teammates.ui.request; + +import teammates.common.util.EmailWrapper; + +/** + * The request of sending an email. + */ +public class SendEmailRequest extends BasicRequest { + private final EmailWrapper email; + + public SendEmailRequest(EmailWrapper email) { + this.email = email; + } + + public EmailWrapper getEmail() { + return email; + } + + @Override + public void validate() { + assertTrue(email != null, "Email cannot be null"); + assertTrue(email.getContent() != null, "Email content cannot be null"); + assertTrue(email.getRecipient() != null, "Email recipient's address cannot be null"); + assertTrue(email.getSenderEmail() != null, "Email sender's address cannot be null"); + assertTrue(email.getReplyTo() != null, "Email reply-to address cannot be null"); + assertTrue(email.getSubject() != null, "Email subject cannot be null"); + } + +} diff --git a/src/main/java/teammates/ui/webapi/request/StudentProfileUpdateRequest.java b/src/main/java/teammates/ui/request/StudentProfileUpdateRequest.java similarity index 97% rename from src/main/java/teammates/ui/webapi/request/StudentProfileUpdateRequest.java rename to src/main/java/teammates/ui/request/StudentProfileUpdateRequest.java index 4ef2f156d7a..56d2b1a089e 100644 --- a/src/main/java/teammates/ui/webapi/request/StudentProfileUpdateRequest.java +++ b/src/main/java/teammates/ui/request/StudentProfileUpdateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; /** * The request of updating a student profile. diff --git a/src/main/java/teammates/ui/webapi/request/StudentUpdateRequest.java b/src/main/java/teammates/ui/request/StudentUpdateRequest.java similarity index 98% rename from src/main/java/teammates/ui/webapi/request/StudentUpdateRequest.java rename to src/main/java/teammates/ui/request/StudentUpdateRequest.java index d9850a69e08..fc57048fec0 100644 --- a/src/main/java/teammates/ui/webapi/request/StudentUpdateRequest.java +++ b/src/main/java/teammates/ui/request/StudentUpdateRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import teammates.common.util.Const; import teammates.common.util.SanitizationHelper; diff --git a/src/main/java/teammates/ui/webapi/request/StudentsEnrollRequest.java b/src/main/java/teammates/ui/request/StudentsEnrollRequest.java similarity index 98% rename from src/main/java/teammates/ui/webapi/request/StudentsEnrollRequest.java rename to src/main/java/teammates/ui/request/StudentsEnrollRequest.java index 0f98d012d8d..2048a6705f1 100644 --- a/src/main/java/teammates/ui/webapi/request/StudentsEnrollRequest.java +++ b/src/main/java/teammates/ui/request/StudentsEnrollRequest.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.request; +package teammates.ui.request; import java.util.ArrayList; import java.util.HashSet; diff --git a/src/main/java/teammates/ui/webapi/request/package-info.java b/src/main/java/teammates/ui/request/package-info.java similarity index 54% rename from src/main/java/teammates/ui/webapi/request/package-info.java rename to src/main/java/teammates/ui/request/package-info.java index 66872e34185..ad114bf2354 100644 --- a/src/main/java/teammates/ui/webapi/request/package-info.java +++ b/src/main/java/teammates/ui/request/package-info.java @@ -1,4 +1,4 @@ /** * Contains all API request formats. */ -package teammates.ui.webapi.request; +package teammates.ui.request; diff --git a/src/main/java/teammates/ui/webapi/action/Action.java b/src/main/java/teammates/ui/webapi/Action.java similarity index 60% rename from src/main/java/teammates/ui/webapi/action/Action.java rename to src/main/java/teammates/ui/webapi/Action.java index f19324ca29e..4773bfb9a15 100644 --- a/src/main/java/teammates/ui/webapi/action/Action.java +++ b/src/main/java/teammates/ui/webapi/Action.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.lang.reflect.Type; import java.util.Optional; @@ -6,7 +6,11 @@ import javax.servlet.http.HttpServletRequest; import teammates.common.datatransfer.UserInfo; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.exception.EntityDoesNotExistException; +import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.exception.NullHttpParameterException; import teammates.common.exception.UnauthorizedAccessException; @@ -21,7 +25,8 @@ import teammates.logic.api.GateKeeper; import teammates.logic.api.Logic; import teammates.logic.api.TaskQueuer; -import teammates.ui.webapi.request.BasicRequest; +import teammates.ui.output.InstructorPrivilegeData; +import teammates.ui.request.BasicRequest; /** * An "action" to be performed by the system. @@ -30,16 +35,16 @@ */ public abstract class Action { - protected Logic logic = new Logic(); - protected GateKeeper gateKeeper = new GateKeeper(); - protected EmailGenerator emailGenerator = new EmailGenerator(); - protected TaskQueuer taskQueuer = new TaskQueuer(); - protected EmailSender emailSender = new EmailSender(); - protected RecaptchaVerifier recaptchaVerifier = new RecaptchaVerifier(Config.CAPTCHA_SECRET_KEY); + Logic logic = new Logic(); + GateKeeper gateKeeper = new GateKeeper(); + EmailGenerator emailGenerator = new EmailGenerator(); + TaskQueuer taskQueuer = new TaskQueuer(); + EmailSender emailSender = new EmailSender(); + RecaptchaVerifier recaptchaVerifier = new RecaptchaVerifier(Config.CAPTCHA_SECRET_KEY); - protected HttpServletRequest req; - protected UserInfo userInfo; - protected AuthType authType; + HttpServletRequest req; + UserInfo userInfo; + AuthType authType; // buffer to store the request body private String requestBody; @@ -47,7 +52,7 @@ public abstract class Action { /** * Initializes the action object based on the HTTP request. */ - protected void init(HttpServletRequest req) { + void init(HttpServletRequest req) { this.req = req; initAuthInfo(); } @@ -72,14 +77,14 @@ public void setRecaptchaVerifier(RecaptchaVerifier recaptchaVerifier) { this.recaptchaVerifier = recaptchaVerifier; } - public boolean isMasqueradeMode() { + boolean isMasqueradeMode() { return userInfo.isAdmin && authType == AuthType.MASQUERADE; } /** * Checks if the requesting user has sufficient authority to access the resource. */ - public void checkAccessControl() { + void checkAccessControl() { if (authType.getLevel() < getMinAuthLevel().getLevel()) { // Access control level lower than required throw new UnauthorizedAccessException("Not authorized to access this resource."); @@ -98,10 +103,23 @@ private void initAuthInfo() { if (Config.BACKDOOR_KEY.equals(req.getHeader("Backdoor-Key"))) { authType = AuthType.ALL_ACCESS; userInfo = new UserInfo(getRequestParamValue(Const.ParamsNames.USER_ID)); + userInfo.isAdmin = true; + userInfo.isStudent = true; + userInfo.isInstructor = true; return; } - userInfo = gateKeeper.getCurrentUser(); + // The header X-AppEngine-QueueName cannot be spoofed as GAE will strip any user-sent X-AppEngine-QueueName headers. + // Reference: https://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-handlers#reading_request_headers + String queueNameHeader = req.getHeader("X-AppEngine-QueueName"); + boolean isRequestFromAppEngineQueue = queueNameHeader != null; + if (isRequestFromAppEngineQueue) { + userInfo = new UserInfo("AppEngine-" + queueNameHeader); + userInfo.isAdmin = true; + } else { + userInfo = gateKeeper.getCurrentUser(); + } + authType = userInfo == null ? AuthType.PUBLIC : AuthType.LOGGED_IN; String userParam = getRequestParamValue(Const.ParamsNames.USER_ID); @@ -120,22 +138,26 @@ private void initAuthInfo() { /** * Returns the first value for the specified parameter in the HTTP request, or null if such parameter is not found. */ - protected String getRequestParamValue(String paramName) { + String getRequestParamValue(String paramName) { return req.getParameter(paramName); } /** * Returns the first value for the specified parameter expected to be present in the HTTP request. */ - protected String getNonNullRequestParamValue(String paramName) { - return getNonNullRequestParamValues(paramName)[0]; + String getNonNullRequestParamValue(String paramName) { + String value = req.getParameter(paramName); + if (value == null) { + throw new NullHttpParameterException(String.format(Const.StatusCodes.NULL_HTTP_PARAMETER, paramName)); + } + return value; } /** * Returns the first value for the specified parameter expected to be present in the HTTP request as boolean. */ @SuppressWarnings("PMD.PreserveStackTrace") - protected boolean getBooleanRequestParamValue(String paramName) { + boolean getBooleanRequestParamValue(String paramName) { String value = getNonNullRequestParamValue(paramName); try { return Boolean.parseBoolean(value); @@ -149,7 +171,7 @@ protected boolean getBooleanRequestParamValue(String paramName) { * Returns the first value for the specified parameter expected to be present in the HTTP request as long. */ @SuppressWarnings("PMD.PreserveStackTrace") - protected long getLongRequestParamValue(String paramName) { + long getLongRequestParamValue(String paramName) { String value = getNonNullRequestParamValue(paramName); try { return Long.parseLong(value); @@ -159,38 +181,28 @@ protected long getLongRequestParamValue(String paramName) { } } - /** - * Returns the values for the specified parameter in the HTTP request, or null if such parameter is not found. - */ - protected String[] getRequestParamValues(String paramName) { - return req.getParameterValues(paramName); - } - - /** - * Returns the values for the specified parameter expected to be present in the HTTP request. - */ - protected String[] getNonNullRequestParamValues(String paramName) { - String[] values = getRequestParamValues(paramName); - if (values == null || values.length == 0) { - throw new NullHttpParameterException(String.format(Const.StatusCodes.NULL_HTTP_PARAMETER, paramName)); - } - return values; - } - /** * Returns the request body payload. */ - protected String getRequestBody() { + String getRequestBody() { if (requestBody == null) { requestBody = HttpRequestHelper.getRequestBody(req); } return requestBody; } + FeedbackSessionAttributes getNonNullFeedbackSession(String feedbackSessionName, String courseId) { + FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + if (feedbackSession == null) { + throw new EntityNotFoundException(new EntityDoesNotExistException("Feedback session not found")); + } + return feedbackSession; + } + /** * Deserializes and validates the request body payload. */ - protected T getAndValidateRequestBody(Type typeOfBody) { + T getAndValidateRequestBody(Type typeOfBody) { T requestBody = JsonUtils.fromJson(getRequestBody(), typeOfBody); if (requestBody == null) { throw new NullHttpParameterException(Const.StatusCodes.NULL_BODY_PARAMETER); @@ -204,7 +216,7 @@ protected T getAndValidateRequestBody(Type typeOfBody) * * @throws UnauthorizedAccessException if HTTP param is provided but student cannot be found */ - protected Optional getUnregisteredStudent() { + Optional getUnregisteredStudent() { String key = getRequestParamValue(Const.ParamsNames.REGKEY); if (!StringHelper.isEmpty(key)) { StudentAttributes studentAttributes = logic.getStudentForRegistrationKey(key); @@ -217,19 +229,40 @@ protected Optional getUnregisteredStudent() { return Optional.empty(); } + InstructorPrivilegeData constructInstructorPrivileges(InstructorAttributes instructor, String feedbackSessionName) { + InstructorPrivilegeData privilege = new InstructorPrivilegeData(); + privilege.constructCourseLevelPrivilege(instructor.privileges); + if (feedbackSessionName != null) { + privilege.setCanSubmitSessionInSections( + instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS) + || instructor.isAllowedForPrivilegeAnySection( + feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); + privilege.setCanViewSessionInSections( + instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS) + || instructor.isAllowedForPrivilegeAnySection( + feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); + privilege.setCanModifySessionCommentsInSections( + instructor.isAllowedForPrivilege( + Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS) + || instructor.isAllowedForPrivilegeAnySection(feedbackSessionName, + Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS)); + } + return privilege; + } + /** * Gets the minimum access control level required to access the resource. */ - protected abstract AuthType getMinAuthLevel(); + abstract AuthType getMinAuthLevel(); /** * Checks the specific access control needs for the resource. */ - public abstract void checkSpecificAccessControl(); + abstract void checkSpecificAccessControl(); /** * Executes the action. */ - public abstract ActionResult execute(); + abstract ActionResult execute(); } diff --git a/src/main/java/teammates/ui/webapi/action/ActionFactory.java b/src/main/java/teammates/ui/webapi/ActionFactory.java similarity index 78% rename from src/main/java/teammates/ui/webapi/action/ActionFactory.java rename to src/main/java/teammates/ui/webapi/ActionFactory.java index e9808559f31..62ec5b36695 100644 --- a/src/main/java/teammates/ui/webapi/action/ActionFactory.java +++ b/src/main/java/teammates/ui/webapi/ActionFactory.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.HashMap; import java.util.Map; @@ -14,7 +14,9 @@ import teammates.common.exception.ActionMappingException; import teammates.common.exception.TeammatesException; import teammates.common.util.Assumption; +import teammates.common.util.Const.CronJobURIs; import teammates.common.util.Const.ResourceURIs; +import teammates.common.util.Const.TaskQueue; /** * Generates the matching {@link Action} for a given URI and request method. @@ -78,6 +80,7 @@ public class ActionFactory { map(ResourceURIs.SEARCH_COMMENTS, GET, SearchCommentsAction.class); map(ResourceURIs.SEARCH_INSTRUCTORS, GET, SearchInstructorsAction.class); map(ResourceURIs.SEARCH_STUDENTS, GET, SearchStudentsAction.class); + map(ResourceURIs.EMAIL, GET, GenerateEmailAction.class); map(ResourceURIs.SESSIONS_ONGOING, GET, GetOngoingSessionsAction.class); map(ResourceURIs.SESSION_STATS, GET, GetSessionResponseStatsAction.class); @@ -100,9 +103,7 @@ public class ActionFactory { map(ResourceURIs.QUESTION, DELETE, DeleteFeedbackQuestionAction.class); map(ResourceURIs.QUESTION_RECIPIENTS, GET, GetFeedbackQuestionRecipientsAction.class); map(ResourceURIs.RESPONSES, GET, GetFeedbackResponsesAction.class); - map(ResourceURIs.RESPONSE, POST, CreateFeedbackResponseAction.class); - map(ResourceURIs.RESPONSE, PUT, UpdateFeedbackResponseAction.class); - map(ResourceURIs.RESPONSE, DELETE, DeleteFeedbackResponseAction.class); + map(ResourceURIs.RESPONSES, PUT, SubmitFeedbackResponsesAction.class); map(ResourceURIs.HAS_RESPONSES, GET, GetHasResponsesAction.class); map(ResourceURIs.SUBMISSION_CONFIRMATION, POST, ConfirmFeedbackSessionSubmissionAction.class); map(ResourceURIs.LOCAL_DATE_TIME, GET, GetLocalDateTimeInfoAction.class); @@ -117,10 +118,38 @@ public class ActionFactory { map(ResourceURIs.STUDENT_PROFILE_PICTURE, DELETE, DeleteStudentProfilePictureAction.class); map(ResourceURIs.INSTRUCTOR, PUT, UpdateInstructorAction.class); map(ResourceURIs.INSTRUCTOR, POST, CreateInstructorAction.class); + + // Cron jobs; use GET request + // Reference: https://cloud.google.com/appengine/docs/standard/java/config/cron + + map(CronJobURIs.AUTOMATED_LOG_COMPILATION, GET, CompileLogsAction.class); + map(CronJobURIs.AUTOMATED_DATASTORE_BACKUP, GET, DatastoreBackupAction.class); + map(CronJobURIs.AUTOMATED_FEEDBACK_OPENING_REMINDERS, GET, FeedbackSessionOpeningRemindersAction.class); + map(CronJobURIs.AUTOMATED_FEEDBACK_CLOSED_REMINDERS, GET, FeedbackSessionClosedRemindersAction.class); + map(CronJobURIs.AUTOMATED_FEEDBACK_CLOSING_REMINDERS, GET, FeedbackSessionClosingRemindersAction.class); + map(CronJobURIs.AUTOMATED_FEEDBACK_PUBLISHED_REMINDERS, GET, FeedbackSessionPublishedRemindersAction.class); + + // Task queue workers; use POST request + // Reference: https://cloud.google.com/appengine/docs/standard/java/taskqueue/ + + map(TaskQueue.FEEDBACK_SESSION_PUBLISHED_EMAIL_WORKER_URL, POST, FeedbackSessionPublishedEmailWorkerAction.class); + map(TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL, POST, + FeedbackSessionResendPublishedEmailWorkerAction.class); + map(TaskQueue.FEEDBACK_SESSION_REMIND_EMAIL_WORKER_URL, POST, FeedbackSessionRemindEmailWorkerAction.class); + map(TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_WORKER_URL, POST, + FeedbackSessionRemindParticularUsersEmailWorkerAction.class); + map(TaskQueue.FEEDBACK_SESSION_UNPUBLISHED_EMAIL_WORKER_URL, POST, + FeedbackSessionUnpublishedEmailWorkerAction.class); + map(TaskQueue.FEEDBACK_SESSION_UPDATE_RESPONDENT_WORKER_URL, POST, + FeedbackSessionUpdateRespondentWorkerAction.class); + map(TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_WORKER_URL, POST, InstructorCourseJoinEmailWorkerAction.class); + map(TaskQueue.SEND_EMAIL_WORKER_URL, POST, SendEmailWorkerAction.class); + map(TaskQueue.STUDENT_COURSE_JOIN_EMAIL_WORKER_URL, POST, StudentCourseJoinEmailWorkerAction.class); + } private static void map(String uri, String method, Class actionClass) { - ACTION_MAPPINGS.computeIfAbsent(ResourceURIs.URI_PREFIX + uri, k -> new HashMap<>()).put(method, actionClass); + ACTION_MAPPINGS.computeIfAbsent(uri, k -> new HashMap<>()).put(method, actionClass); } /** diff --git a/src/main/java/teammates/ui/webapi/action/ActionResult.java b/src/main/java/teammates/ui/webapi/ActionResult.java similarity index 60% rename from src/main/java/teammates/ui/webapi/action/ActionResult.java rename to src/main/java/teammates/ui/webapi/ActionResult.java index 8e27725fd24..0e6db0b23a0 100644 --- a/src/main/java/teammates/ui/webapi/action/ActionResult.java +++ b/src/main/java/teammates/ui/webapi/ActionResult.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; @@ -7,20 +7,20 @@ /** * Represents the result of executing an {@link Action}. */ -public abstract class ActionResult { +abstract class ActionResult { private final int statusCode; - protected ActionResult(int statusCode) { + ActionResult(int statusCode) { this.statusCode = statusCode; } /** * Packages and forwards the action result to the HTTP response. */ - public abstract void send(HttpServletResponse resp) throws IOException; + abstract void send(HttpServletResponse resp) throws IOException; - public int getStatusCode() { + int getStatusCode() { return statusCode; } diff --git a/src/main/java/teammates/ui/webapi/action/AdminExceptionTestAction.java b/src/main/java/teammates/ui/webapi/AdminExceptionTestAction.java similarity index 91% rename from src/main/java/teammates/ui/webapi/action/AdminExceptionTestAction.java rename to src/main/java/teammates/ui/webapi/AdminExceptionTestAction.java index c56ad61b84c..c8176358cfa 100644 --- a/src/main/java/teammates/ui/webapi/action/AdminExceptionTestAction.java +++ b/src/main/java/teammates/ui/webapi/AdminExceptionTestAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import com.google.appengine.api.datastore.DatastoreTimeoutException; import com.google.apphosting.api.DeadlineExceededException; @@ -13,15 +13,15 @@ /** * Action specifically created for testing exception handling at API servlet. */ -public class AdminExceptionTestAction extends Action { +class AdminExceptionTestAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!Config.isDevServer()) { throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } @@ -29,7 +29,7 @@ public void checkSpecificAccessControl() { @Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") // deliberately done for testing - public JsonResult execute() { + JsonResult execute() { String error = getNonNullRequestParamValue(Const.ParamsNames.ERROR); if (error.equals(AssertionError.class.getSimpleName())) { throw new AssertionError("AssertionError testing"); diff --git a/src/main/java/teammates/ui/webapi/AdminOnlyAction.java b/src/main/java/teammates/ui/webapi/AdminOnlyAction.java new file mode 100644 index 00000000000..9b04562928b --- /dev/null +++ b/src/main/java/teammates/ui/webapi/AdminOnlyAction.java @@ -0,0 +1,22 @@ +package teammates.ui.webapi; + +import teammates.common.exception.UnauthorizedAccessException; + +/** + * An action that is permitted only for administrators. + */ +abstract class AdminOnlyAction extends Action { + + @Override + AuthType getMinAuthLevel() { + return AuthType.LOGGED_IN; + } + + @Override + void checkSpecificAccessControl() { + if (!userInfo.isAdmin) { + throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); + } + } + +} diff --git a/src/main/java/teammates/ui/webapi/action/ArchiveCourseAction.java b/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java similarity index 81% rename from src/main/java/teammates/ui/webapi/action/ArchiveCourseAction.java rename to src/main/java/teammates/ui/webapi/ArchiveCourseAction.java index 4c9e967f686..af40e36839b 100644 --- a/src/main/java/teammates/ui/webapi/action/ArchiveCourseAction.java +++ b/src/main/java/teammates/ui/webapi/ArchiveCourseAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -6,28 +6,28 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.CourseArchiveData; -import teammates.ui.webapi.request.CourseArchiveRequest; +import teammates.ui.output.CourseArchiveData; +import teammates.ui.request.CourseArchiveRequest; /** * Changes the archive status of a course. */ -public class ArchiveCourseAction extends Action { +class ArchiveCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String idOfCourseToArchive = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(idOfCourseToArchive, userInfo.id), logic.getCourse(idOfCourseToArchive)); } @Override - public ActionResult execute() { + JsonResult execute() { String idOfCourseToArchive = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseArchiveRequest courseArchiveRequest = getAndValidateRequestBody(CourseArchiveRequest.class); diff --git a/src/main/java/teammates/ui/webapi/action/AuthType.java b/src/main/java/teammates/ui/webapi/AuthType.java similarity index 93% rename from src/main/java/teammates/ui/webapi/action/AuthType.java rename to src/main/java/teammates/ui/webapi/AuthType.java index e5f2f288b5c..4a2e7959bbf 100644 --- a/src/main/java/teammates/ui/webapi/action/AuthType.java +++ b/src/main/java/teammates/ui/webapi/AuthType.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; /** * Represents the type of authentication. diff --git a/src/main/java/teammates/ui/webapi/action/BasicCommentSubmissionAction.java b/src/main/java/teammates/ui/webapi/BasicCommentSubmissionAction.java similarity index 76% rename from src/main/java/teammates/ui/webapi/action/BasicCommentSubmissionAction.java rename to src/main/java/teammates/ui/webapi/BasicCommentSubmissionAction.java index e774ef8d5ba..1735d72b63e 100644 --- a/src/main/java/teammates/ui/webapi/action/BasicCommentSubmissionAction.java +++ b/src/main/java/teammates/ui/webapi/BasicCommentSubmissionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; @@ -12,11 +12,11 @@ /** * Basic action class for feedback response comment related operation. */ -public abstract class BasicCommentSubmissionAction extends BasicFeedbackSubmissionAction { +abstract class BasicCommentSubmissionAction extends BasicFeedbackSubmissionAction { /** * Validates the questionType of the corresponding question. */ - protected void validQuestionForCommentInSubmission(FeedbackQuestionAttributes feedbackQuestion) { + void validQuestionForCommentInSubmission(FeedbackQuestionAttributes feedbackQuestion) { if (!feedbackQuestion.getQuestionDetails().isFeedbackParticipantCommentsOnResponsesAllowed()) { throw new InvalidHttpParameterException("Invalid question type for comment in submission"); } @@ -25,7 +25,7 @@ protected void validQuestionForCommentInSubmission(FeedbackQuestionAttributes fe /** * Validates comment doesn't exist of corresponding response. */ - protected void verifyCommentNotExist(String feedbackResponseId) { + void verifyCommentNotExist(String feedbackResponseId) { FeedbackResponseCommentAttributes comment = logic.getFeedbackResponseCommentForResponseFromParticipant(feedbackResponseId); @@ -38,8 +38,8 @@ protected void verifyCommentNotExist(String feedbackResponseId) { /** * Verify response ownership for student. */ - protected void verifyResponseOwnerShipForStudent(StudentAttributes student, FeedbackResponseAttributes response, - FeedbackQuestionAttributes question) { + void verifyResponseOwnerShipForStudent(StudentAttributes student, FeedbackResponseAttributes response, + FeedbackQuestionAttributes question) { if (question.getGiverType() == FeedbackParticipantType.TEAMS && !response.getGiver().equals(student.getTeam())) { @@ -55,8 +55,8 @@ protected void verifyResponseOwnerShipForStudent(StudentAttributes student, Feed /** * Verify response ownership for instructor. */ - protected void verifyResponseOwnerShipForInstructor(InstructorAttributes instructor, - FeedbackResponseAttributes response) { + void verifyResponseOwnerShipForInstructor(InstructorAttributes instructor, + FeedbackResponseAttributes response) { if (!response.getGiver().equals(instructor.getEmail())) { throw new UnauthorizedAccessException("Response [" + response.getId() + "] is not accessible to " + instructor.getName()); diff --git a/src/main/java/teammates/ui/webapi/action/BasicFeedbackSubmissionAction.java b/src/main/java/teammates/ui/webapi/BasicFeedbackSubmissionAction.java similarity index 81% rename from src/main/java/teammates/ui/webapi/action/BasicFeedbackSubmissionAction.java rename to src/main/java/teammates/ui/webapi/BasicFeedbackSubmissionAction.java index 218cf8454b8..a8033666269 100644 --- a/src/main/java/teammates/ui/webapi/action/BasicFeedbackSubmissionAction.java +++ b/src/main/java/teammates/ui/webapi/BasicFeedbackSubmissionAction.java @@ -1,14 +1,10 @@ -package teammates.ui.webapi.action; - -import java.util.List; +package teammates.ui.webapi; import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Assumption; import teammates.common.util.Const; @@ -17,12 +13,12 @@ /** * The basic action for feedback submission. */ -public abstract class BasicFeedbackSubmissionAction extends Action { +abstract class BasicFeedbackSubmissionAction extends Action { /** * Checks whether instructors can see the question. */ - protected boolean canInstructorSeeQuestion(FeedbackQuestionAttributes feedbackQuestion) { + boolean canInstructorSeeQuestion(FeedbackQuestionAttributes feedbackQuestion) { boolean isGiverVisibleToInstructor = feedbackQuestion.showGiverNameTo.contains(FeedbackParticipantType.INSTRUCTORS); boolean isRecipientVisibleToInstructor = @@ -35,7 +31,7 @@ protected boolean canInstructorSeeQuestion(FeedbackQuestionAttributes feedbackQu /** * Verifies that instructor can see the moderated question in moderation request. */ - protected void verifyInstructorCanSeeQuestionIfInModeration(FeedbackQuestionAttributes feedbackQuestion) { + void verifyInstructorCanSeeQuestionIfInModeration(FeedbackQuestionAttributes feedbackQuestion) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); if (!StringHelper.isEmpty(moderatedPerson) && !canInstructorSeeQuestion(feedbackQuestion)) { @@ -47,7 +43,7 @@ protected void verifyInstructorCanSeeQuestionIfInModeration(FeedbackQuestionAttr /** * Gets the student involved in the submission process. */ - protected StudentAttributes getStudentOfCourseFromRequest(String courseId) { + StudentAttributes getStudentOfCourseFromRequest(String courseId) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); @@ -66,7 +62,7 @@ protected StudentAttributes getStudentOfCourseFromRequest(String courseId) { /** * Checks the access control for student feedback submission. */ - protected void checkAccessControlForStudentFeedbackSubmission( + void checkAccessControlForStudentFeedbackSubmission( StudentAttributes student, FeedbackSessionAttributes feedbackSession) { if (student == null) { throw new UnauthorizedAccessException("Trying to access system using a non-existent student entity"); @@ -103,7 +99,7 @@ protected void checkAccessControlForStudentFeedbackSubmission( /** * Gets the instructor involved in the submission process. */ - protected InstructorAttributes getInstructorOfCourseFromRequest(String courseId) { + InstructorAttributes getInstructorOfCourseFromRequest(String courseId) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); @@ -120,24 +116,28 @@ protected InstructorAttributes getInstructorOfCourseFromRequest(String courseId) /** * Checks the access control for instructor feedback submission. */ - protected void checkAccessControlForInstructorFeedbackSubmission( + void checkAccessControlForInstructorFeedbackSubmission( InstructorAttributes instructor, FeedbackSessionAttributes feedbackSession) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); - if (StringHelper.isEmpty(moderatedPerson) && StringHelper.isEmpty(previewAsPerson)) { - gateKeeper.verifySessionSubmissionPrivilegeForInstructor(feedbackSession, instructor); - } else { + if (!StringHelper.isEmpty(moderatedPerson)) { + gateKeeper.verifyLoggedInUserPrivileges(); + gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), + feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS); + } else if (!StringHelper.isEmpty(previewAsPerson)) { gateKeeper.verifyLoggedInUserPrivileges(); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); + } else { + gateKeeper.verifySessionSubmissionPrivilegeForInstructor(feedbackSession, instructor); } } /** * Verifies that it is not a preview request. */ - protected void verifyNotPreview() { + void verifyNotPreview() { String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); if (!StringHelper.isEmpty(previewAsPerson)) { // should not view response under preview mode @@ -150,7 +150,7 @@ protected void verifyNotPreview() { * *

      If it is moderation request, omit the check. */ - protected void verifySessionOpenExceptForModeration(FeedbackSessionAttributes feedbackSession) { + void verifySessionOpenExceptForModeration(FeedbackSessionAttributes feedbackSession) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); if (StringHelper.isEmpty(moderatedPerson) && !(feedbackSession.isOpened() || feedbackSession.isInGracePeriod())) { @@ -161,7 +161,7 @@ protected void verifySessionOpenExceptForModeration(FeedbackSessionAttributes fe /** * Gets the section of a recipient. */ - protected String getRecipientSection( + String getRecipientSection( String courseId, FeedbackParticipantType giverType, FeedbackParticipantType recipientType, String recipientIdentifier) { switch (recipientType) { @@ -196,21 +196,4 @@ protected String getRecipientSection( } } - /** - * Validates the response of the corresponding question. - */ - protected void validResponseOfQuestion(FeedbackQuestionAttributes questionAttributes, - FeedbackResponseAttributes responseToValidate) { - List questionSpecificErrors = - responseToValidate.getResponseDetails().validateResponseDetails(questionAttributes); - - // validate the response itself - if (!questionSpecificErrors.isEmpty()) { - throw new InvalidHttpRequestBodyException(questionSpecificErrors.toString()); - } - - // validate responses of the question - // TODO: It's troublesome to validate Rank Recipient question's responses as REST requests are sent concurrently. - // need to find way to do so. - } } diff --git a/src/main/java/teammates/ui/webapi/action/BinCourseAction.java b/src/main/java/teammates/ui/webapi/BinCourseAction.java similarity index 84% rename from src/main/java/teammates/ui/webapi/action/BinCourseAction.java rename to src/main/java/teammates/ui/webapi/BinCourseAction.java index 58e1d1c0f6c..e1986641143 100644 --- a/src/main/java/teammates/ui/webapi/action/BinCourseAction.java +++ b/src/main/java/teammates/ui/webapi/BinCourseAction.java @@ -1,24 +1,24 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.CourseData; +import teammates.ui.output.CourseData; /** * Move a course to the recycle bin. */ -public class BinCourseAction extends Action { +class BinCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } @@ -29,7 +29,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String idOfCourseToBin = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); try { CourseAttributes courseAttributes = logic.getCourse(idOfCourseToBin); diff --git a/src/main/java/teammates/ui/webapi/action/BinFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/BinFeedbackSessionAction.java similarity index 79% rename from src/main/java/teammates/ui/webapi/action/BinFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/BinFeedbackSessionAction.java index ab73fe1cfe9..1193c26a3f5 100644 --- a/src/main/java/teammates/ui/webapi/action/BinFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/BinFeedbackSessionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -6,23 +6,23 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionData; /** * Move the feedback sesion to the recycle bin. */ -public class BinFeedbackSessionAction extends Action { +class BinFeedbackSessionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.getId()), @@ -31,7 +31,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/automated/CompileLogsAction.java b/src/main/java/teammates/ui/webapi/CompileLogsAction.java similarity index 93% rename from src/main/java/teammates/ui/automated/CompileLogsAction.java rename to src/main/java/teammates/ui/webapi/CompileLogsAction.java index 26131c8ed24..9d07f6bd557 100644 --- a/src/main/java/teammates/ui/automated/CompileLogsAction.java +++ b/src/main/java/teammates/ui/webapi/CompileLogsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.time.Instant; import java.util.ArrayList; @@ -16,12 +16,13 @@ /** * Cron job: compiles application logs and sends severe logs compilation to the support email. */ -public class CompileLogsAction extends AutomatedAction { +class CompileLogsAction extends AdminOnlyAction { @Override - public void execute() { + JsonResult execute() { List errorLogs = getErrorLogs(); sendEmail(errorLogs); + return new JsonResult("Successful"); } private List getErrorLogs() { diff --git a/src/main/java/teammates/ui/webapi/action/ConfirmFeedbackSessionSubmissionAction.java b/src/main/java/teammates/ui/webapi/ConfirmFeedbackSessionSubmissionAction.java similarity index 88% rename from src/main/java/teammates/ui/webapi/action/ConfirmFeedbackSessionSubmissionAction.java rename to src/main/java/teammates/ui/webapi/ConfirmFeedbackSessionSubmissionAction.java index a146f3d9102..25899e75491 100644 --- a/src/main/java/teammates/ui/webapi/action/ConfirmFeedbackSessionSubmissionAction.java +++ b/src/main/java/teammates/ui/webapi/ConfirmFeedbackSessionSubmissionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.time.Instant; @@ -10,25 +10,25 @@ import teammates.common.util.EmailSendingStatus; import teammates.common.util.EmailWrapper; import teammates.logic.api.EmailGenerator; -import teammates.ui.webapi.output.ConfirmationResponse; -import teammates.ui.webapi.output.ConfirmationResult; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.ConfirmationResponse; +import teammates.ui.output.ConfirmationResult; +import teammates.ui.request.Intent; /** * Confirm the submission of a feedback session. */ -public class ConfirmFeedbackSessionSubmissionAction extends BasicFeedbackSubmissionAction { +class ConfirmFeedbackSessionSubmissionAction extends BasicFeedbackSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); verifySessionOpenExceptForModeration(feedbackSession); verifyNotPreview(); @@ -49,10 +49,10 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); boolean isSubmissionEmailConfirmationEmailRequested = getBooleanRequestParamValue(Const.ParamsNames.SEND_SUBMISSION_EMAIL); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); diff --git a/src/main/java/teammates/ui/webapi/action/CreateAccountAction.java b/src/main/java/teammates/ui/webapi/CreateAccountAction.java similarity index 91% rename from src/main/java/teammates/ui/webapi/action/CreateAccountAction.java rename to src/main/java/teammates/ui/webapi/CreateAccountAction.java index 8a0d800e196..1ef63c7d15d 100644 --- a/src/main/java/teammates/ui/webapi/action/CreateAccountAction.java +++ b/src/main/java/teammates/ui/webapi/CreateAccountAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -10,7 +10,6 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; -import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Config; import teammates.common.util.Const; import teammates.common.util.EmailWrapper; @@ -18,29 +17,16 @@ import teammates.common.util.JsonUtils; import teammates.common.util.StringHelper; import teammates.common.util.Templates; -import teammates.ui.webapi.output.JoinLinkData; -import teammates.ui.webapi.request.AccountCreateRequest; +import teammates.ui.output.JoinLinkData; +import teammates.ui.request.AccountCreateRequest; /** * Creates a new instructor account with sample courses. */ -public class CreateAccountAction extends Action { +class CreateAccountAction extends AdminOnlyAction { @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - // Only admins can create new accounts - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } - - @Override - public ActionResult execute() { + JsonResult execute() { AccountCreateRequest createRequest = getAndValidateRequestBody(AccountCreateRequest.class); String instructorName = createRequest.getInstructorName().trim(); @@ -170,7 +156,7 @@ private String getDemoCourseIdRoot(String instructorEmail) { *

    • 012345678901234567890123456789.gma-demo9 -> 01234567890123456789012345678.gma-demo10 (being cut)
    • *
    */ - private String generateNextDemoCourseId(String instructorEmailOrProposedCourseId, int maximumIdLength) { + String generateNextDemoCourseId(String instructorEmailOrProposedCourseId, int maximumIdLength) { boolean isFirstCourseId = instructorEmailOrProposedCourseId.contains("@"); if (isFirstCourseId) { return StringHelper.truncateHead(getDemoCourseIdRoot(instructorEmailOrProposedCourseId), maximumIdLength); diff --git a/src/main/java/teammates/ui/webapi/action/CreateCourseAction.java b/src/main/java/teammates/ui/webapi/CreateCourseAction.java similarity index 85% rename from src/main/java/teammates/ui/webapi/action/CreateCourseAction.java rename to src/main/java/teammates/ui/webapi/CreateCourseAction.java index e2e02bf291c..a7158dbab97 100644 --- a/src/main/java/teammates/ui/webapi/action/CreateCourseAction.java +++ b/src/main/java/teammates/ui/webapi/CreateCourseAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.time.ZoneId; @@ -9,28 +9,28 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.FieldValidator; -import teammates.ui.webapi.output.CourseData; -import teammates.ui.webapi.request.CourseCreateRequest; +import teammates.ui.output.CourseData; +import teammates.ui.request.CourseCreateRequest; /** * Create a new course for an instructor. */ -public class CreateCourseAction extends Action { +class CreateCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } } @Override - public ActionResult execute() { + JsonResult execute() { CourseCreateRequest courseCreateRequest = getAndValidateRequestBody(CourseCreateRequest.class); String newCourseTimeZone = courseCreateRequest.getTimeZone(); diff --git a/src/main/java/teammates/ui/webapi/action/CreateFeedbackQuestionAction.java b/src/main/java/teammates/ui/webapi/CreateFeedbackQuestionAction.java similarity index 89% rename from src/main/java/teammates/ui/webapi/action/CreateFeedbackQuestionAction.java rename to src/main/java/teammates/ui/webapi/CreateFeedbackQuestionAction.java index 03126432ba9..d7d16aee6c4 100644 --- a/src/main/java/teammates/ui/webapi/action/CreateFeedbackQuestionAction.java +++ b/src/main/java/teammates/ui/webapi/CreateFeedbackQuestionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -9,32 +9,32 @@ import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackQuestionData; -import teammates.ui.webapi.request.FeedbackQuestionCreateRequest; +import teammates.ui.output.FeedbackQuestionData; +import teammates.ui.request.FeedbackQuestionCreateRequest; /** * Create a feedback question. */ -public class CreateFeedbackQuestionAction extends Action { +class CreateFeedbackQuestionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); InstructorAttributes instructorDetailForCourse = logic.getInstructorForGoogleId(courseId, userInfo.getId()); gateKeeper.verifyAccessible(instructorDetailForCourse, - logic.getFeedbackSession(feedbackSessionName, courseId), + getNonNullFeedbackSession(feedbackSessionName, courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/webapi/action/CreateFeedbackResponseCommentAction.java b/src/main/java/teammates/ui/webapi/CreateFeedbackResponseCommentAction.java similarity index 87% rename from src/main/java/teammates/ui/webapi/action/CreateFeedbackResponseCommentAction.java rename to src/main/java/teammates/ui/webapi/CreateFeedbackResponseCommentAction.java index bd452160893..31b3fba9797 100644 --- a/src/main/java/teammates/ui/webapi/action/CreateFeedbackResponseCommentAction.java +++ b/src/main/java/teammates/ui/webapi/CreateFeedbackResponseCommentAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -15,29 +15,36 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Assumption; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackResponseCommentData; -import teammates.ui.webapi.request.FeedbackResponseCommentCreateRequest; -import teammates.ui.webapi.request.Intent; +import teammates.common.util.StringHelper; +import teammates.ui.output.FeedbackResponseCommentData; +import teammates.ui.request.FeedbackResponseCommentCreateRequest; +import teammates.ui.request.Intent; /** * Creates a new feedback response comment. */ -public class CreateFeedbackResponseCommentAction extends BasicCommentSubmissionAction { +class CreateFeedbackResponseCommentAction extends BasicCommentSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); + void checkSpecificAccessControl() { + String feedbackResponseId; + try { + feedbackResponseId = StringHelper.decrypt( + getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID)); + } catch (InvalidParametersException ipe) { + throw new InvalidHttpParameterException(ipe.getMessage(), ipe); + } FeedbackResponseAttributes response = logic.getFeedbackResponse(feedbackResponseId); Assumption.assertNotNull(response); String courseId = response.courseId; String feedbackSessionName = response.feedbackSessionName; - FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes session = getNonNullFeedbackSession(feedbackSessionName, courseId); String questionId = response.feedbackQuestionId; FeedbackQuestionAttributes question = logic.getFeedbackQuestion(questionId); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); @@ -90,8 +97,14 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); + JsonResult execute() { + String feedbackResponseId; + try { + feedbackResponseId = StringHelper.decrypt( + getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID)); + } catch (InvalidParametersException ipe) { + throw new InvalidHttpParameterException(ipe.getMessage(), ipe); + } FeedbackResponseAttributes response = logic.getFeedbackResponse(feedbackResponseId); Assumption.assertNotNull(response); diff --git a/src/main/java/teammates/ui/webapi/action/CreateFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/CreateFeedbackSessionAction.java similarity index 79% rename from src/main/java/teammates/ui/webapi/action/CreateFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/CreateFeedbackSessionAction.java index d2f8f299140..93a5be1dbb1 100644 --- a/src/main/java/teammates/ui/webapi/action/CreateFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/CreateFeedbackSessionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; @@ -8,21 +8,22 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.SanitizationHelper; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.request.FeedbackSessionCreateRequest; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.InstructorPrivilegeData; +import teammates.ui.request.FeedbackSessionCreateRequest; /** * Create a feedback session. */ -public class CreateFeedbackSessionAction extends Action { +class CreateFeedbackSessionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); @@ -32,7 +33,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); @@ -64,8 +65,12 @@ public ActionResult execute() { throw new InvalidHttpRequestBodyException(e.getMessage(), e); } - fs = logic.getFeedbackSession(fs.getFeedbackSessionName(), fs.getCourseId()); - return new JsonResult(new FeedbackSessionData(fs)); + fs = getNonNullFeedbackSession(fs.getFeedbackSessionName(), fs.getCourseId()); + FeedbackSessionData output = new FeedbackSessionData(fs); + InstructorPrivilegeData privilege = constructInstructorPrivileges(instructor, feedbackSessionName); + output.setPrivileges(privilege); + + return new JsonResult(output); } } diff --git a/src/main/java/teammates/ui/webapi/action/CreateInstructorAction.java b/src/main/java/teammates/ui/webapi/CreateInstructorAction.java similarity index 93% rename from src/main/java/teammates/ui/webapi/action/CreateInstructorAction.java rename to src/main/java/teammates/ui/webapi/CreateInstructorAction.java index 9924652e726..1c54aa85bd3 100644 --- a/src/main/java/teammates/ui/webapi/action/CreateInstructorAction.java +++ b/src/main/java/teammates/ui/webapi/CreateInstructorAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -9,21 +9,21 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.SanitizationHelper; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.request.InstructorCreateRequest; +import teammates.ui.output.InstructorData; +import teammates.ui.request.InstructorCreateRequest; /** * Action: adds another instructor to a course that already exists. */ -public class CreateInstructorAction extends UpdateInstructorPrivilegesAbstractAction { +class CreateInstructorAction extends UpdateInstructorPrivilegesAbstractAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (userInfo.isAdmin) { return; } @@ -40,7 +40,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructorToAdd = extractCompleteInstructor(courseId); diff --git a/src/main/java/teammates/ui/automated/DatastoreBackupAction.java b/src/main/java/teammates/ui/webapi/DatastoreBackupAction.java similarity index 89% rename from src/main/java/teammates/ui/automated/DatastoreBackupAction.java rename to src/main/java/teammates/ui/webapi/DatastoreBackupAction.java index e041a7d2cb1..684d85828d3 100644 --- a/src/main/java/teammates/ui/automated/DatastoreBackupAction.java +++ b/src/main/java/teammates/ui/webapi/DatastoreBackupAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.io.BufferedReader; import java.io.IOException; @@ -30,19 +30,19 @@ * @see https://cloud.google.com/datastore/docs/export-import-entities * @see https://cloud.google.com/datastore/docs/reference/admin/rest/v1/projects/export */ -public class DatastoreBackupAction extends AutomatedAction { +class DatastoreBackupAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { + JsonResult execute() { if (Config.isDevServer()) { log.info("Skipping backup in dev server."); - return; + return new JsonResult("Successful"); } if (!Config.ENABLE_DATASTORE_BACKUP) { log.info("Skipping backup by system admin's choice."); - return; + return new JsonResult("Successful"); } List scopes = new ArrayList<>(); scopes.add("https://www.googleapis.com/auth/datastore"); @@ -58,7 +58,7 @@ public void execute() { // Documentation is wrong; the param name is output_url_prefix instead of outputUrlPrefix body.put("output_url_prefix", "gs://" + Config.BACKUP_GCS_BUCKETNAME + "/datastore-backups/" + timestamp); - StringEntity entity = new StringEntity(JsonUtils.toJson(body), Charset.forName("UTF-8")); + StringEntity entity = new StringEntity(JsonUtils.toCompactJson(body), Charset.forName("UTF-8")); post.setEntity(entity); try (CloseableHttpClient client = HttpClients.createDefault(); @@ -73,6 +73,7 @@ public void execute() { } catch (IOException e) { log.severe("Backup request failure: " + e.getMessage()); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/webapi/DeleteAccountAction.java b/src/main/java/teammates/ui/webapi/DeleteAccountAction.java new file mode 100644 index 00000000000..0c40d6901b6 --- /dev/null +++ b/src/main/java/teammates/ui/webapi/DeleteAccountAction.java @@ -0,0 +1,19 @@ +package teammates.ui.webapi; + +import org.apache.http.HttpStatus; + +import teammates.common.util.Const; + +/** + * Action: deletes an existing account (either student or instructor). + */ +class DeleteAccountAction extends AdminOnlyAction { + + @Override + JsonResult execute() { + String instructorId = getNonNullRequestParamValue(Const.ParamsNames.INSTRUCTOR_ID); + logic.deleteAccountCascade(instructorId); + return new JsonResult("Account is successfully deleted.", HttpStatus.SC_OK); + } + +} diff --git a/src/main/java/teammates/ui/webapi/action/DeleteCourseAction.java b/src/main/java/teammates/ui/webapi/DeleteCourseAction.java similarity index 77% rename from src/main/java/teammates/ui/webapi/action/DeleteCourseAction.java rename to src/main/java/teammates/ui/webapi/DeleteCourseAction.java index 910ec35924b..61082a0646c 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteCourseAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteCourseAction.java @@ -1,21 +1,21 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * Delete a course. */ -public class DeleteCourseAction extends Action { +class DeleteCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } @@ -26,7 +26,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String idOfCourseToDelete = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); logic.deleteCourseCascade(idOfCourseToDelete); diff --git a/src/main/java/teammates/ui/webapi/action/DeleteDataBundleAction.java b/src/main/java/teammates/ui/webapi/DeleteDataBundleAction.java similarity index 77% rename from src/main/java/teammates/ui/webapi/action/DeleteDataBundleAction.java rename to src/main/java/teammates/ui/webapi/DeleteDataBundleAction.java index b08fdfa27ba..a5d6a06ac2c 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteDataBundleAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteDataBundleAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -10,22 +10,22 @@ /** * Deletes a data bundle from the DB. */ -public class DeleteDataBundleAction extends Action { +class DeleteDataBundleAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.ALL_ACCESS; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!Config.isDevServer()) { throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } } @Override - public JsonResult execute() { + JsonResult execute() { DataBundle dataBundle = JsonUtils.fromJson(getRequestBody(), DataBundle.class); logic.removeDataBundle(dataBundle); return new JsonResult("Data bundle successfully persisted.", HttpStatus.SC_OK); diff --git a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackQuestionAction.java b/src/main/java/teammates/ui/webapi/DeleteFeedbackQuestionAction.java similarity index 75% rename from src/main/java/teammates/ui/webapi/action/DeleteFeedbackQuestionAction.java rename to src/main/java/teammates/ui/webapi/DeleteFeedbackQuestionAction.java index c915c09b27c..dbf90b56eb1 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackQuestionAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteFeedbackQuestionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.exception.UnauthorizedAccessException; @@ -7,15 +7,15 @@ /** * Deletes a feedback question. */ -public class DeleteFeedbackQuestionAction extends Action { +class DeleteFeedbackQuestionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes questionAttributes = logic.getFeedbackQuestion(feedbackQuestionId); @@ -24,13 +24,13 @@ public void checkSpecificAccessControl() { } gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(questionAttributes.getCourseId(), userInfo.getId()), - logic.getFeedbackSession(questionAttributes.getFeedbackSessionName(), questionAttributes.getCourseId()), + getNonNullFeedbackSession(questionAttributes.getFeedbackSessionName(), questionAttributes.getCourseId()), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } @Override - public ActionResult execute() { + JsonResult execute() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); logic.deleteFeedbackQuestionCascade(feedbackQuestionId); diff --git a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackResponseCommentAction.java b/src/main/java/teammates/ui/webapi/DeleteFeedbackResponseCommentAction.java similarity index 90% rename from src/main/java/teammates/ui/webapi/action/DeleteFeedbackResponseCommentAction.java rename to src/main/java/teammates/ui/webapi/DeleteFeedbackResponseCommentAction.java index 2e59877d2b6..fb54fda254b 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackResponseCommentAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteFeedbackResponseCommentAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.FeedbackParticipantType; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; @@ -9,26 +9,26 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.request.Intent; +import teammates.ui.request.Intent; /** * Deletes a feedback response comment. */ -public class DeleteFeedbackResponseCommentAction extends BasicCommentSubmissionAction { +class DeleteFeedbackResponseCommentAction extends BasicCommentSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { long feedbackResponseCommentId = getLongRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID); FeedbackResponseCommentAttributes frc = logic.getFeedbackResponseComment(feedbackResponseCommentId); if (frc == null) { return; } - FeedbackSessionAttributes session = logic.getFeedbackSession(frc.getFeedbackSessionName(), frc.getCourseId()); + FeedbackSessionAttributes session = getNonNullFeedbackSession(frc.getFeedbackSessionName(), frc.getCourseId()); FeedbackQuestionAttributes question = logic.getFeedbackQuestion(frc.getFeedbackQuestionId()); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); @@ -79,7 +79,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { long feedbackResponseCommentId = getLongRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID); logic.deleteFeedbackResponseComment(feedbackResponseCommentId); diff --git a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/DeleteFeedbackSessionAction.java similarity index 83% rename from src/main/java/teammates/ui/webapi/action/DeleteFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/DeleteFeedbackSessionAction.java index 5fb75ac15df..5d538486813 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteFeedbackSessionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; @@ -6,15 +6,15 @@ /** * Delete a feedback session. */ -public class DeleteFeedbackSessionAction extends Action { +class DeleteFeedbackSessionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSessionFromRecycleBin(feedbackSessionName, courseId); @@ -25,7 +25,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/webapi/action/DeleteInstructorAction.java b/src/main/java/teammates/ui/webapi/DeleteInstructorAction.java similarity index 94% rename from src/main/java/teammates/ui/webapi/action/DeleteInstructorAction.java rename to src/main/java/teammates/ui/webapi/DeleteInstructorAction.java index e20484a6229..cc4f44c9197 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteInstructorAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteInstructorAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -12,15 +12,15 @@ /** * Deletes an instructor from a course, unless it's the last instructor in the course. */ -public class DeleteInstructorAction extends Action { +class DeleteInstructorAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { //allow access to admins or instructor with modify permission if (userInfo.isAdmin) { return; @@ -37,7 +37,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String instructorId = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_ID); String instructorEmail = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_EMAIL); String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); diff --git a/src/main/java/teammates/ui/webapi/action/DeleteStudentAction.java b/src/main/java/teammates/ui/webapi/DeleteStudentAction.java similarity index 89% rename from src/main/java/teammates/ui/webapi/action/DeleteStudentAction.java rename to src/main/java/teammates/ui/webapi/DeleteStudentAction.java index b5809e16797..2cde078d784 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteStudentAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteStudentAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -10,15 +10,15 @@ /** * Action: deletes a student from a course. */ -public class DeleteStudentAction extends Action { +class DeleteStudentAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (userInfo.isAdmin) { return; } @@ -34,7 +34,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String studentId = getRequestParamValue(Const.ParamsNames.STUDENT_ID); diff --git a/src/main/java/teammates/ui/webapi/action/DeleteStudentProfilePictureAction.java b/src/main/java/teammates/ui/webapi/DeleteStudentProfilePictureAction.java similarity index 85% rename from src/main/java/teammates/ui/webapi/action/DeleteStudentProfilePictureAction.java rename to src/main/java/teammates/ui/webapi/DeleteStudentProfilePictureAction.java index c4a6a771445..8a179271e12 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteStudentProfilePictureAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteStudentProfilePictureAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -9,14 +9,14 @@ /** * Deletes a student's profile picture and its picture key. */ -public class DeleteStudentProfilePictureAction extends Action { +class DeleteStudentProfilePictureAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isStudent) { throw new UnauthorizedAccessException("Student privilege is required to update this resource."); } @@ -27,7 +27,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String googleId = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_ID); StudentProfileAttributes studentProfileAttributes = logic.getStudentProfile(googleId); if (studentProfileAttributes == null) { diff --git a/src/main/java/teammates/ui/webapi/action/DeleteStudentsAction.java b/src/main/java/teammates/ui/webapi/DeleteStudentsAction.java similarity index 83% rename from src/main/java/teammates/ui/webapi/action/DeleteStudentsAction.java rename to src/main/java/teammates/ui/webapi/DeleteStudentsAction.java index 391a61a628d..e33238c1e24 100644 --- a/src/main/java/teammates/ui/webapi/action/DeleteStudentsAction.java +++ b/src/main/java/teammates/ui/webapi/DeleteStudentsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -9,15 +9,15 @@ /** * Action: deletes all students in a course. */ -public class DeleteStudentsAction extends Action { +class DeleteStudentsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to delete students from course."); } @@ -28,7 +28,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); logic.deleteStudentsInCourseCascade(courseId); diff --git a/src/main/java/teammates/ui/webapi/action/DowngradeAccountAction.java b/src/main/java/teammates/ui/webapi/DowngradeAccountAction.java similarity index 55% rename from src/main/java/teammates/ui/webapi/action/DowngradeAccountAction.java rename to src/main/java/teammates/ui/webapi/DowngradeAccountAction.java index b64998478cb..4095c602273 100644 --- a/src/main/java/teammates/ui/webapi/action/DowngradeAccountAction.java +++ b/src/main/java/teammates/ui/webapi/DowngradeAccountAction.java @@ -1,32 +1,18 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; /** * Action: downgrades an instructor account to student account. */ -public class DowngradeAccountAction extends Action { +class DowngradeAccountAction extends AdminOnlyAction { @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - // Only admins can downgrade accounts - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } - - @Override - public ActionResult execute() { + JsonResult execute() { String instructorId = getNonNullRequestParamValue(Const.ParamsNames.INSTRUCTOR_ID); try { diff --git a/src/main/java/teammates/ui/webapi/action/EnrollStudentsAction.java b/src/main/java/teammates/ui/webapi/EnrollStudentsAction.java similarity index 93% rename from src/main/java/teammates/ui/webapi/action/EnrollStudentsAction.java rename to src/main/java/teammates/ui/webapi/EnrollStudentsAction.java index c5f3cca3e7b..c8eed77c79e 100644 --- a/src/main/java/teammates/ui/webapi/action/EnrollStudentsAction.java +++ b/src/main/java/teammates/ui/webapi/EnrollStudentsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -14,8 +14,8 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.StudentsData; -import teammates.ui.webapi.request.StudentsEnrollRequest; +import teammates.ui.output.StudentsData; +import teammates.ui.request.StudentsEnrollRequest; /** * Enroll a list of students. @@ -26,15 +26,15 @@ * *

    Return all students who are successfully enrolled. */ -public class EnrollStudentsAction extends Action { +class EnrollStudentsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return authType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } @@ -46,7 +46,7 @@ public void checkSpecificAccessControl() { } @Override - public JsonResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); StudentsEnrollRequest enrollRequests = getAndValidateRequestBody(StudentsEnrollRequest.class); diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionClosedRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionClosedRemindersAction.java similarity index 87% rename from src/main/java/teammates/ui/automated/FeedbackSessionClosedRemindersAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionClosedRemindersAction.java index 27e1d9d9d60..2af83b5ebd3 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionClosedRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionClosedRemindersAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.List; @@ -10,12 +10,12 @@ /** * Cron job: schedules feedback session closed emails to be sent. */ -public class FeedbackSessionClosedRemindersAction extends AutomatedAction { +class FeedbackSessionClosedRemindersAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { + JsonResult execute() { List sessions = logic.getFeedbackSessionsClosedWithinThePastHour(); for (FeedbackSessionAttributes session : sessions) { @@ -31,6 +31,7 @@ public void execute() { log.severe("Unexpected error: " + TeammatesException.toStringWithStackTrace(e)); } } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionClosingRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionClosingRemindersAction.java similarity index 87% rename from src/main/java/teammates/ui/automated/FeedbackSessionClosingRemindersAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionClosingRemindersAction.java index dbdc8ec943a..58f14a27f47 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionClosingRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionClosingRemindersAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.List; @@ -10,12 +10,12 @@ /** * Cron job: schedules feedback session closing emails to be sent. */ -public class FeedbackSessionClosingRemindersAction extends AutomatedAction { +class FeedbackSessionClosingRemindersAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { + JsonResult execute() { List sessions = logic.getFeedbackSessionsClosingWithinTimeLimit(); for (FeedbackSessionAttributes session : sessions) { @@ -31,6 +31,7 @@ public void execute() { log.severe("Unexpected error: " + TeammatesException.toStringWithStackTrace(e)); } } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionOpeningRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersAction.java similarity index 87% rename from src/main/java/teammates/ui/automated/FeedbackSessionOpeningRemindersAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersAction.java index 7df1aa5bcf5..832100f11f9 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionOpeningRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.List; @@ -10,12 +10,12 @@ /** * Cron job: schedules feedback session opening emails to be sent. */ -public class FeedbackSessionOpeningRemindersAction extends AutomatedAction { +class FeedbackSessionOpeningRemindersAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { + JsonResult execute() { List sessions = logic.getFeedbackSessionsWhichNeedOpenEmailsToBeSent(); for (FeedbackSessionAttributes session : sessions) { @@ -31,6 +31,7 @@ public void execute() { log.severe("Unexpected error: " + TeammatesException.toStringWithStackTrace(e)); } } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionPublishedEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerAction.java similarity index 84% rename from src/main/java/teammates/ui/automated/FeedbackSessionPublishedEmailWorkerAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerAction.java index ed6bab5bfb3..66fc6317065 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionPublishedEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.List; @@ -11,20 +11,20 @@ /** * Task queue worker action: prepares session published reminder for a particular session to be sent. */ -public class FeedbackSessionPublishedEmailWorkerAction extends AutomatedAction { +class FeedbackSessionPublishedEmailWorkerAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { - String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.EMAIL_FEEDBACK); - String courseId = getNonNullRequestParamValue(ParamsNames.EMAIL_COURSE); + JsonResult execute() { + String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.FEEDBACK_SESSION_NAME); + String courseId = getNonNullRequestParamValue(ParamsNames.COURSE_ID); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); if (session == null) { log.severe("Feedback session object for feedback session name: " + feedbackSessionName + " for course: " + courseId + " could not be fetched."); - return; + return new JsonResult("Failure"); } List emailsToBeSent = emailGenerator.generateFeedbackSessionPublishedEmails(session); try { @@ -37,6 +37,7 @@ public void execute() { } catch (Exception e) { log.severe("Unexpected error: " + TeammatesException.toStringWithStackTrace(e)); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionPublishedRemindersAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersAction.java similarity index 75% rename from src/main/java/teammates/ui/automated/FeedbackSessionPublishedRemindersAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersAction.java index e0e768986f5..364a8f69381 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionPublishedRemindersAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.List; @@ -7,15 +7,16 @@ /** * Cron job: schedules feedback session published emails to be sent. */ -public class FeedbackSessionPublishedRemindersAction extends AutomatedAction { +class FeedbackSessionPublishedRemindersAction extends AdminOnlyAction { @Override - public void execute() { + JsonResult execute() { List sessions = logic.getFeedbackSessionsWhichNeedAutomatedPublishedEmailsToBeSent(); for (FeedbackSessionAttributes session : sessions) { taskQueuer.scheduleFeedbackSessionPublishedEmail(session.getCourseId(), session.getFeedbackSessionName()); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionRemindEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerAction.java similarity index 90% rename from src/main/java/teammates/ui/automated/FeedbackSessionRemindEmailWorkerAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerAction.java index bc3903abefe..b6426764975 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionRemindEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -14,15 +14,15 @@ /** * Task queue worker action: sends feedback session reminder email to a course. */ -public class FeedbackSessionRemindEmailWorkerAction extends AutomatedAction { +class FeedbackSessionRemindEmailWorkerAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { - String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.SUBMISSION_FEEDBACK); - String courseId = getNonNullRequestParamValue(ParamsNames.SUBMISSION_COURSE); - String instructorId = getNonNullRequestParamValue(ParamsNames.USER_ID); + JsonResult execute() { + String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.FEEDBACK_SESSION_NAME); + String courseId = getNonNullRequestParamValue(ParamsNames.COURSE_ID); + String instructorId = getNonNullRequestParamValue(ParamsNames.INSTRUCTOR_ID); try { FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); @@ -52,6 +52,7 @@ public void execute() { } catch (Exception e) { log.severe("Unexpected error while sending emails: " + TeammatesException.toStringWithStackTrace(e)); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionRemindParticularUsersEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerAction.java similarity index 71% rename from src/main/java/teammates/ui/automated/FeedbackSessionRemindParticularUsersEmailWorkerAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerAction.java index 5465ab874ae..03969bb305c 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionRemindParticularUsersEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -7,23 +7,26 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.TeammatesException; -import teammates.common.util.Const.ParamsNames; +import teammates.common.util.Assumption; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.ui.request.FeedbackSessionRemindRequest; /** * Task queue worker action: sends feedback session reminder email to particular students of a course. */ -public class FeedbackSessionRemindParticularUsersEmailWorkerAction extends AutomatedAction { +class FeedbackSessionRemindParticularUsersEmailWorkerAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { - String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.SUBMISSION_FEEDBACK); - String courseId = getNonNullRequestParamValue(ParamsNames.SUBMISSION_COURSE); - String[] usersToRemind = getNonNullRequestParamValues(ParamsNames.SUBMISSION_REMIND_USERLIST); - String googleIdOfInstructorToNotify = getNonNullRequestParamValue(ParamsNames.USER_ID); + JsonResult execute() { + FeedbackSessionRemindRequest remindRequest = getAndValidateRequestBody(FeedbackSessionRemindRequest.class); + String feedbackSessionName = remindRequest.getFeedbackSessionName(); + String courseId = remindRequest.getCourseId(); + String[] usersToRemind = remindRequest.getUsersToRemind(); + String googleIdOfInstructorToNotify = remindRequest.getRequestingInstructorId(); + Assumption.assertNotNull(googleIdOfInstructorToNotify); try { FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); @@ -50,6 +53,7 @@ public void execute() { } catch (Exception e) { log.severe("Unexpected error while sending emails: " + TeammatesException.toStringWithStackTrace(e)); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionResendPublishedEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerAction.java similarity index 75% rename from src/main/java/teammates/ui/automated/FeedbackSessionResendPublishedEmailWorkerAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerAction.java index 0f76d81584c..3c20ec9517a 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionResendPublishedEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -7,22 +7,23 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.TeammatesException; -import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailWrapper; import teammates.common.util.Logger; +import teammates.ui.request.FeedbackSessionRemindRequest; /** * Task queue worker action: sends feedback session reminder email to particular students of a course. */ -public class FeedbackSessionResendPublishedEmailWorkerAction extends AutomatedAction { +class FeedbackSessionResendPublishedEmailWorkerAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { - String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.SUBMISSION_FEEDBACK); - String courseId = getNonNullRequestParamValue(ParamsNames.SUBMISSION_COURSE); - String[] usersToRemind = getNonNullRequestParamValues(ParamsNames.SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST); + JsonResult execute() { + FeedbackSessionRemindRequest remindRequest = getAndValidateRequestBody(FeedbackSessionRemindRequest.class); + String feedbackSessionName = remindRequest.getFeedbackSessionName(); + String courseId = remindRequest.getCourseId(); + String[] usersToRemind = remindRequest.getUsersToRemind(); try { FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); @@ -47,6 +48,7 @@ public void execute() { } catch (Exception e) { log.severe("Unexpected error while sending emails: " + TeammatesException.toStringWithStackTrace(e)); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionUnpublishedEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerAction.java similarity index 84% rename from src/main/java/teammates/ui/automated/FeedbackSessionUnpublishedEmailWorkerAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerAction.java index 33a0f97c0f8..5760e4786ec 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionUnpublishedEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import java.util.List; @@ -11,20 +11,20 @@ /** * Task queue worker action: prepares session unpublished reminder for a particular session to be sent. */ -public class FeedbackSessionUnpublishedEmailWorkerAction extends AutomatedAction { +class FeedbackSessionUnpublishedEmailWorkerAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { - String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.EMAIL_FEEDBACK); - String courseId = getNonNullRequestParamValue(ParamsNames.EMAIL_COURSE); + JsonResult execute() { + String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.FEEDBACK_SESSION_NAME); + String courseId = getNonNullRequestParamValue(ParamsNames.COURSE_ID); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); if (session == null) { log.severe("Feedback session object for feedback session name: " + feedbackSessionName + " for course: " + courseId + " could not be fetched."); - return; + return new JsonResult("Failure"); } List emailsToBeSent = emailGenerator.generateFeedbackSessionUnpublishedEmails(session); try { @@ -37,6 +37,7 @@ public void execute() { } catch (Exception e) { log.severe("Unexpected error: " + TeammatesException.toStringWithStackTrace(e)); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/automated/FeedbackSessionUpdateRespondentWorkerAction.java b/src/main/java/teammates/ui/webapi/FeedbackSessionUpdateRespondentWorkerAction.java similarity index 91% rename from src/main/java/teammates/ui/automated/FeedbackSessionUpdateRespondentWorkerAction.java rename to src/main/java/teammates/ui/webapi/FeedbackSessionUpdateRespondentWorkerAction.java index f29da2282bc..07ce43b0c4e 100644 --- a/src/main/java/teammates/ui/automated/FeedbackSessionUpdateRespondentWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/FeedbackSessionUpdateRespondentWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; @@ -9,12 +9,12 @@ /** * Task queue worker action: appends to or removes from the respondent list of a feedback session. */ -public class FeedbackSessionUpdateRespondentWorkerAction extends AutomatedAction { +class FeedbackSessionUpdateRespondentWorkerAction extends AdminOnlyAction { private static final Logger log = Logger.getLogger(); @Override - public void execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(ParamsNames.FEEDBACK_SESSION_NAME); String email = getNonNullRequestParamValue(ParamsNames.RESPONDENT_EMAIL); @@ -40,5 +40,6 @@ public void execute() { + (isInstructor ? "instructor" : "student") + " respondent: " + TeammatesException.toStringWithStackTrace(e)); } + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/webapi/GenerateEmailAction.java b/src/main/java/teammates/ui/webapi/GenerateEmailAction.java new file mode 100644 index 00000000000..0f4a5ba938c --- /dev/null +++ b/src/main/java/teammates/ui/webapi/GenerateEmailAction.java @@ -0,0 +1,47 @@ +package teammates.ui.webapi; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.exception.InvalidHttpParameterException; +import teammates.common.util.Assumption; +import teammates.common.util.Const; +import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; +import teammates.ui.output.EmailData; + +/** + * Generate email content. + */ +class GenerateEmailAction extends AdminOnlyAction { + + @Override + JsonResult execute() { + String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); + String studentEmail = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); + String emailType = getNonNullRequestParamValue(Const.ParamsNames.EMAIL_TYPE); + String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); + + CourseAttributes course = logic.getCourse(courseId); + Assumption.assertNotNull(course); + + StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail); + Assumption.assertNotNull(student); + + EmailWrapper email; + + if (emailType.equals(EmailType.STUDENT_COURSE_JOIN.name())) { + email = emailGenerator.generateStudentCourseJoinEmail(course, student); + } else if (emailType.equals(EmailType.FEEDBACK_SESSION_REMINDER.name())) { + if (feedbackSessionName == null) { + throw new InvalidHttpParameterException("Feedback session name not specified"); + } + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); + email = emailGenerator.generateFeedbackSessionStudentReminderEmail(feedbackSession, student); + } else { + throw new InvalidHttpParameterException("Email type " + emailType + " not accepted"); + } + + return new JsonResult(new EmailData(email)); + } +} diff --git a/src/main/java/teammates/ui/webapi/action/GetAccountAction.java b/src/main/java/teammates/ui/webapi/GetAccountAction.java similarity index 50% rename from src/main/java/teammates/ui/webapi/action/GetAccountAction.java rename to src/main/java/teammates/ui/webapi/GetAccountAction.java index 5f8f5aa9dce..64e8a8f4bdb 100644 --- a/src/main/java/teammates/ui/webapi/action/GetAccountAction.java +++ b/src/main/java/teammates/ui/webapi/GetAccountAction.java @@ -1,32 +1,18 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.AccountAttributes; -import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.AccountData; +import teammates.ui.output.AccountData; /** * Gets account's information. */ -public class GetAccountAction extends Action { +class GetAccountAction extends AdminOnlyAction { @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - // Only admins can downgrade accounts - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } - - @Override - public ActionResult execute() { + JsonResult execute() { String googleId = getNonNullRequestParamValue(Const.ParamsNames.INSTRUCTOR_ID); AccountAttributes accountInfo = logic.getAccount(googleId); diff --git a/src/main/java/teammates/ui/webapi/action/GetAuthInfoAction.java b/src/main/java/teammates/ui/webapi/GetAuthInfoAction.java similarity index 88% rename from src/main/java/teammates/ui/webapi/action/GetAuthInfoAction.java rename to src/main/java/teammates/ui/webapi/GetAuthInfoAction.java index 6571caba507..0339dfe6dcd 100644 --- a/src/main/java/teammates/ui/webapi/action/GetAuthInfoAction.java +++ b/src/main/java/teammates/ui/webapi/GetAuthInfoAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.Collections; import java.util.List; @@ -6,18 +6,17 @@ import javax.servlet.http.Cookie; import teammates.common.datatransfer.attributes.AccountAttributes; -import teammates.common.util.Config; import teammates.common.util.Const; import teammates.common.util.HttpRequestHelper; import teammates.common.util.StringHelper; -import teammates.ui.webapi.output.AuthInfo; +import teammates.ui.output.AuthInfo; /** * Action: gets user authentication information. * *

    This does not log in or log out the user. */ -public class GetAuthInfoAction extends Action { +class GetAuthInfoAction extends Action { @Override public AuthType getMinAuthLevel() { @@ -25,12 +24,12 @@ public AuthType getMinAuthLevel() { } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Login information is available to everyone } @Override - public ActionResult execute() { + JsonResult execute() { String frontendUrl = getRequestParamValue("frontendUrl"); String nextUrl = getRequestParamValue("nextUrl"); if (frontendUrl == null) { @@ -65,7 +64,6 @@ public ActionResult execute() { return new JsonResult(output); } Cookie csrfTokenCookie = new Cookie(Const.CsrfConfig.TOKEN_COOKIE_NAME, csrfToken); - csrfTokenCookie.setSecure(!Config.isDevServer()); csrfTokenCookie.setPath("/"); List cookieList = Collections.singletonList(csrfTokenCookie); return new JsonResult(output, cookieList); diff --git a/src/main/java/teammates/ui/webapi/action/GetCourseAction.java b/src/main/java/teammates/ui/webapi/GetCourseAction.java similarity index 63% rename from src/main/java/teammates/ui/webapi/action/GetCourseAction.java rename to src/main/java/teammates/ui/webapi/GetCourseAction.java index 15f54ace871..6f5f69c48c3 100644 --- a/src/main/java/teammates/ui/webapi/action/GetCourseAction.java +++ b/src/main/java/teammates/ui/webapi/GetCourseAction.java @@ -1,24 +1,26 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.CourseData; +import teammates.ui.output.CourseData; +import teammates.ui.output.InstructorPrivilegeData; /** * Get a course for an instructor or student. */ -public class GetCourseAction extends Action { +class GetCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (userInfo.isAdmin) { return; } @@ -43,12 +45,21 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseAttributes courseAttributes = logic.getCourse(courseId); if (courseAttributes == null) { return new JsonResult("No course with id: " + courseId, HttpStatus.SC_NOT_FOUND); } - return new JsonResult(new CourseData(courseAttributes)); + CourseData output = new CourseData(courseAttributes); + String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); + if (Const.EntityType.INSTRUCTOR.equals(entityType)) { + InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); + if (instructor != null) { + InstructorPrivilegeData privilege = constructInstructorPrivileges(instructor, null); + output.setPrivileges(privilege); + } + } + return new JsonResult(output); } } diff --git a/src/main/java/teammates/ui/webapi/action/GetCourseJoinStatusAction.java b/src/main/java/teammates/ui/webapi/GetCourseJoinStatusAction.java similarity index 83% rename from src/main/java/teammates/ui/webapi/action/GetCourseJoinStatusAction.java rename to src/main/java/teammates/ui/webapi/GetCourseJoinStatusAction.java index 436c2bc7747..62a277bfc84 100644 --- a/src/main/java/teammates/ui/webapi/action/GetCourseJoinStatusAction.java +++ b/src/main/java/teammates/ui/webapi/GetCourseJoinStatusAction.java @@ -1,29 +1,29 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.output.JoinStatus; +import teammates.ui.output.JoinStatus; /** * Get the join status of a course. */ -public class GetCourseJoinStatusAction extends Action { +class GetCourseJoinStatusAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Any user can use a join link as long as its parameters are valid } @Override - public ActionResult execute() { + JsonResult execute() { String regkey = getNonNullRequestParamValue(Const.ParamsNames.REGKEY); String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); switch (entityType) { @@ -53,7 +53,7 @@ private JsonResult getInstructorJoinStatus(String regkey) { } private JsonResult getJoinStatusResult(boolean hasJoined) { - JoinStatus result = new JoinStatus(hasJoined, hasJoined ? null : userInfo.id); + JoinStatus result = new JoinStatus(hasJoined, userInfo.id); return new JsonResult(result); } } diff --git a/src/main/java/teammates/ui/webapi/action/GetCourseSectionNamesAction.java b/src/main/java/teammates/ui/webapi/GetCourseSectionNamesAction.java similarity index 80% rename from src/main/java/teammates/ui/webapi/action/GetCourseSectionNamesAction.java rename to src/main/java/teammates/ui/webapi/GetCourseSectionNamesAction.java index 8e6a27f6e24..3950b18767e 100644 --- a/src/main/java/teammates/ui/webapi/action/GetCourseSectionNamesAction.java +++ b/src/main/java/teammates/ui/webapi/GetCourseSectionNamesAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -7,20 +7,20 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; -import teammates.ui.webapi.output.CourseSectionNamesData; +import teammates.ui.output.CourseSectionNamesData; /** * Gets the section names of a course. */ -public class GetCourseSectionNamesAction extends Action { +class GetCourseSectionNamesAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseAttributes course = logic.getCourse(courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); @@ -28,7 +28,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); try { List sectionNames = logic.getSectionNamesForCourse(courseId); diff --git a/src/main/java/teammates/ui/webapi/GetCoursesAction.java b/src/main/java/teammates/ui/webapi/GetCoursesAction.java new file mode 100644 index 00000000000..e68ae8c7b35 --- /dev/null +++ b/src/main/java/teammates/ui/webapi/GetCoursesAction.java @@ -0,0 +1,107 @@ +package teammates.ui.webapi; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.apache.http.HttpStatus; + +import teammates.common.datatransfer.attributes.CourseAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.exception.UnauthorizedAccessException; +import teammates.common.util.Const; +import teammates.ui.output.CourseData; +import teammates.ui.output.CoursesData; +import teammates.ui.output.InstructorPrivilegeData; + +/** + * Gets all courses for the instructor, and filtered by active, archived and soft-deleted. + * Or gets all courses for the student he belongs to. + */ +class GetCoursesAction extends Action { + + @Override + AuthType getMinAuthLevel() { + return AuthType.LOGGED_IN; + } + + @Override + void checkSpecificAccessControl() { + String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); + + if (!((entityType.equals(Const.EntityType.STUDENT) && userInfo.isStudent) + || (entityType.equals(Const.EntityType.INSTRUCTOR) && userInfo.isInstructor))) { + throw new UnauthorizedAccessException("Current account cannot access to courses of request entity type"); + } + } + + @Override + JsonResult execute() { + String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); + switch (entityType) { + case Const.EntityType.STUDENT: + return getStudentCourses(); + case Const.EntityType.INSTRUCTOR: + return getInstructorCourses(); + default: + return new JsonResult("Error: invalid entity type", HttpStatus.SC_BAD_REQUEST); + + } + } + + private JsonResult getStudentCourses() { + List courses = logic.getCoursesForStudentAccount(userInfo.id); + CoursesData coursesData = new CoursesData(courses); + coursesData.getCourses().forEach(CourseData::hideInformationForStudent); + return new JsonResult(coursesData); + } + + private JsonResult getInstructorCourses() { + String courseStatus = getNonNullRequestParamValue(Const.ParamsNames.COURSE_STATUS); + List courses; + List instructors; + switch (courseStatus) { + case Const.CourseStatus.ACTIVE: + instructors = logic.getInstructorsForGoogleId(userInfo.id, true); + courses = getCourse(instructors); + break; + case Const.CourseStatus.ARCHIVED: + instructors = logic.getInstructorsForGoogleId(userInfo.id) + .stream() + .filter(InstructorAttributes::isArchived) + .collect(Collectors.toList()); + courses = getCourse(instructors); + break; + case Const.CourseStatus.SOFT_DELETED: + instructors = logic.getInstructorsForGoogleId(userInfo.id); + courses = getSoftDeletedCourse(instructors); + break; + default: + return new JsonResult("Error: invalid course status", HttpStatus.SC_BAD_REQUEST); + } + + Map courseIdToInstructor = new HashMap<>(); + instructors.forEach(instructor -> courseIdToInstructor.put(instructor.courseId, instructor)); + + CourseAttributes.sortById(courses); + CoursesData coursesData = new CoursesData(courses); + coursesData.getCourses().forEach(courseData -> { + InstructorAttributes instructor = courseIdToInstructor.get(courseData.getCourseId()); + if (instructor == null) { + return; + } + InstructorPrivilegeData privilege = constructInstructorPrivileges(instructor, null); + courseData.setPrivileges(privilege); + }); + return new JsonResult(coursesData); + } + + private List getCourse(List instructors) { + return logic.getCoursesForInstructor(instructors); + } + + private List getSoftDeletedCourse(List instructors) { + return logic.getSoftDeletedCoursesForInstructors(instructors); + } +} diff --git a/src/main/java/teammates/ui/webapi/action/GetFeedbackQuestionRecipientsAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackQuestionRecipientsAction.java similarity index 87% rename from src/main/java/teammates/ui/webapi/action/GetFeedbackQuestionRecipientsAction.java rename to src/main/java/teammates/ui/webapi/GetFeedbackQuestionRecipientsAction.java index d156f3e87c1..ffbbf51bce4 100644 --- a/src/main/java/teammates/ui/webapi/action/GetFeedbackQuestionRecipientsAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackQuestionRecipientsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.Map; @@ -10,23 +10,23 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackQuestionRecipientsData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackQuestionRecipientsData; +import teammates.ui.request.Intent; /** * Get the recipients of a feedback question. * * @see FeedbackQuestionRecipientsData for output format */ -public class GetFeedbackQuestionRecipientsAction extends BasicFeedbackSubmissionAction { +class GetFeedbackQuestionRecipientsAction extends BasicFeedbackSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); if (feedbackQuestion == null) { @@ -37,7 +37,7 @@ public void checkSpecificAccessControl() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); FeedbackSessionAttributes feedbackSession = - logic.getFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId()); + getNonNullFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId()); switch (intent) { case STUDENT_SUBMISSION: gateKeeper.verifyAnswerableForStudent(feedbackQuestion); @@ -55,7 +55,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); FeedbackQuestionAttributes question = logic.getFeedbackQuestion(feedbackQuestionId); diff --git a/src/main/java/teammates/ui/webapi/action/GetFeedbackQuestionsAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackQuestionsAction.java similarity index 86% rename from src/main/java/teammates/ui/webapi/action/GetFeedbackQuestionsAction.java rename to src/main/java/teammates/ui/webapi/GetFeedbackQuestionsAction.java index ff64a86dced..31d065cfdbb 100644 --- a/src/main/java/teammates/ui/webapi/action/GetFeedbackQuestionsAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackQuestionsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -11,24 +11,25 @@ import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.output.FeedbackQuestionsData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackQuestionData; +import teammates.ui.output.FeedbackQuestionsData; +import teammates.ui.request.Intent; /** * Get a list of feedback questions for a feedback session. */ -public class GetFeedbackQuestionsAction extends BasicFeedbackSubmissionAction { +class GetFeedbackQuestionsAction extends BasicFeedbackSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { @@ -53,7 +54,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); @@ -96,6 +97,11 @@ public ActionResult execute() { FeedbackQuestionsData response = new FeedbackQuestionsData(questions); response.normalizeQuestionNumber(); + if (intent.equals(Intent.STUDENT_SUBMISSION)) { + for (FeedbackQuestionData questionData : response.getQuestions()) { + questionData.hideInformationForStudent(); + } + } return new JsonResult(response); } diff --git a/src/main/java/teammates/ui/webapi/action/GetFeedbackResponseCommentAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackResponseCommentAction.java similarity index 67% rename from src/main/java/teammates/ui/webapi/action/GetFeedbackResponseCommentAction.java rename to src/main/java/teammates/ui/webapi/GetFeedbackResponseCommentAction.java index b26d5cbaa82..5d6c79a28a7 100644 --- a/src/main/java/teammates/ui/webapi/action/GetFeedbackResponseCommentAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackResponseCommentAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -11,23 +11,31 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; +import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackResponseCommentData; -import teammates.ui.webapi.request.Intent; +import teammates.common.util.StringHelper; +import teammates.ui.output.FeedbackResponseCommentData; +import teammates.ui.request.Intent; /** * Get all the comments given by the user for a response. */ -public class GetFeedbackResponseCommentAction extends BasicCommentSubmissionAction { +class GetFeedbackResponseCommentAction extends BasicCommentSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); + void checkSpecificAccessControl() { + String feedbackResponseId; + try { + feedbackResponseId = StringHelper.decrypt( + getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID)); + } catch (InvalidParametersException ipe) { + throw new InvalidHttpParameterException(ipe.getMessage(), ipe); + } FeedbackResponseAttributes feedbackResponseAttributes = logic.getFeedbackResponse(feedbackResponseId); if (feedbackResponseAttributes == null) { @@ -35,7 +43,7 @@ public void checkSpecificAccessControl() { } String courseId = feedbackResponseAttributes.courseId; FeedbackSessionAttributes feedbackSession = - logic.getFeedbackSession(feedbackResponseAttributes.getFeedbackSessionName(), + getNonNullFeedbackSession(feedbackResponseAttributes.getFeedbackSessionName(), feedbackResponseAttributes.getCourseId()); FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackResponseAttributes.getFeedbackQuestionId()); @@ -61,8 +69,14 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); + JsonResult execute() { + String feedbackResponseId; + try { + feedbackResponseId = StringHelper.decrypt( + getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID)); + } catch (InvalidParametersException ipe) { + throw new InvalidHttpParameterException(ipe.getMessage(), ipe); + } Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { @@ -71,7 +85,12 @@ public ActionResult execute() { FeedbackResponseCommentAttributes comment = logic.getFeedbackResponseCommentForResponseFromParticipant(feedbackResponseId); if (comment == null) { - return new JsonResult("Comment not found", HttpStatus.SC_NOT_FOUND); + FeedbackResponseAttributes fr = logic.getFeedbackResponse(feedbackResponseId); + if (fr == null) { + throw new EntityNotFoundException( + new EntityDoesNotExistException("The feedback response does not exist.")); + } + return new JsonResult("Comment not found", HttpStatus.SC_NO_CONTENT); } return new JsonResult(new FeedbackResponseCommentData(comment)); default: diff --git a/src/main/java/teammates/ui/webapi/action/GetFeedbackResponsesAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackResponsesAction.java similarity index 64% rename from src/main/java/teammates/ui/webapi/action/GetFeedbackResponsesAction.java rename to src/main/java/teammates/ui/webapi/GetFeedbackResponsesAction.java index ff3e8712074..2280d5601f9 100644 --- a/src/main/java/teammates/ui/webapi/action/GetFeedbackResponsesAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackResponsesAction.java @@ -1,35 +1,41 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; + +import java.util.List; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackQuestionType; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackResponsesData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackResponseCommentData; +import teammates.ui.output.FeedbackResponsesData; +import teammates.ui.request.Intent; /** * Get all responses given by the user for a question. */ -public class GetFeedbackResponsesAction extends BasicFeedbackSubmissionAction { +class GetFeedbackResponsesAction extends BasicFeedbackSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); if (feedbackQuestion == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback question does not exist.")); } FeedbackSessionAttributes feedbackSession = - logic.getFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId()); + getNonNullFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId()); verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion); verifyNotPreview(); @@ -52,27 +58,38 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); FeedbackQuestionAttributes questionAttributes = logic.getFeedbackQuestion(feedbackQuestionId); - FeedbackResponsesData result; + List responses; switch (intent) { case STUDENT_SUBMISSION: StudentAttributes studentAttributes = getStudentOfCourseFromRequest(questionAttributes.getCourseId()); - result = new FeedbackResponsesData( - logic.getFeedbackResponsesFromStudentOrTeamForQuestion(questionAttributes, studentAttributes)); + responses = logic.getFeedbackResponsesFromStudentOrTeamForQuestion(questionAttributes, studentAttributes); break; case INSTRUCTOR_SUBMISSION: InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(questionAttributes.getCourseId()); - result = new FeedbackResponsesData( - logic.getFeedbackResponsesFromInstructorForQuestion(questionAttributes, instructorAttributes)); + responses = logic.getFeedbackResponsesFromInstructorForQuestion(questionAttributes, instructorAttributes); break; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } + FeedbackResponsesData result = new FeedbackResponsesData(responses); + result.getResponses().forEach(response -> { + if (questionAttributes.getQuestionType() != FeedbackQuestionType.MCQ) { + // Only MCQ questions can have participant comment + return; + } + FeedbackResponseCommentAttributes comment = + logic.getFeedbackResponseCommentForResponseFromParticipant(response.getFeedbackResponseId()); + if (comment != null) { + response.setGiverComment(new FeedbackResponseCommentData(comment)); + } + }); + return new JsonResult(result); } diff --git a/src/main/java/teammates/ui/webapi/action/GetFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackSessionAction.java similarity index 66% rename from src/main/java/teammates/ui/webapi/action/GetFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/GetFeedbackSessionAction.java index adcb8bd4d52..e2833dcf219 100644 --- a/src/main/java/teammates/ui/webapi/action/GetFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackSessionAction.java @@ -1,28 +1,30 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; + +import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.request.Intent; /** * Get a feedback session. */ -public class GetFeedbackSessionAction extends BasicFeedbackSubmissionAction { +class GetFeedbackSessionAction extends BasicFeedbackSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { @@ -33,25 +35,35 @@ public void checkSpecificAccessControl() { break; case FULL_DETAIL: gateKeeper.verifyLoggedInUserPrivileges(); - gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(courseId, userInfo.getId()), feedbackSession); + gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(courseId, userInfo.getId()), + feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); break; case INSTRUCTOR_SUBMISSION: - case INSTRUCTOR_RESULT: InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(courseId); checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession); break; + case INSTRUCTOR_RESULT: + gateKeeper.verifyLoggedInUserPrivileges(); + gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(courseId, userInfo.getId()), + feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS); + break; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); - Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); + + if (feedbackSession == null) { + return new JsonResult("No feedback session with name " + feedbackSessionName + + " for course " + courseId, HttpStatus.SC_NOT_FOUND); + } + Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); FeedbackSessionData response = new FeedbackSessionData(feedbackSession); switch (intent) { @@ -62,6 +74,8 @@ public ActionResult execute() { response.hideInformationForStudent(); break; case INSTRUCTOR_RESULT: + response.hideInformationForInstructor(); + break; case FULL_DETAIL: break; default: diff --git a/src/main/java/teammates/ui/webapi/action/GetFeedbackSessionSubmittedGiverSetAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackSessionSubmittedGiverSetAction.java similarity index 70% rename from src/main/java/teammates/ui/webapi/action/GetFeedbackSessionSubmittedGiverSetAction.java rename to src/main/java/teammates/ui/webapi/GetFeedbackSessionSubmittedGiverSetAction.java index f6acb039e82..bb5ed79326d 100644 --- a/src/main/java/teammates/ui/webapi/action/GetFeedbackSessionSubmittedGiverSetAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackSessionSubmittedGiverSetAction.java @@ -1,33 +1,33 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionSubmittedGiverSet; +import teammates.ui.output.FeedbackSessionSubmittedGiverSet; /** * Get a set of givers that has given at least one response in the feedback session. */ -public class GetFeedbackSessionSubmittedGiverSetAction extends Action { +class GetFeedbackSessionSubmittedGiverSetAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); - gateKeeper.verifyAccessible(instructor, fsa); + gateKeeper.verifyAccessible(instructor, feedbackSession); } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/webapi/action/GetFeedbackSessionsAction.java b/src/main/java/teammates/ui/webapi/GetFeedbackSessionsAction.java similarity index 70% rename from src/main/java/teammates/ui/webapi/action/GetFeedbackSessionsAction.java rename to src/main/java/teammates/ui/webapi/GetFeedbackSessionsAction.java index 48a9043d2f2..8aa0e518922 100644 --- a/src/main/java/teammates/ui/webapi/action/GetFeedbackSessionsAction.java +++ b/src/main/java/teammates/ui/webapi/GetFeedbackSessionsAction.java @@ -1,7 +1,10 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import teammates.common.datatransfer.attributes.CourseAttributes; @@ -10,21 +13,22 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.output.FeedbackSessionsData; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionsData; +import teammates.ui.output.InstructorPrivilegeData; /** * Get a list of feedback sessions. */ -public class GetFeedbackSessionsAction extends Action { +class GetFeedbackSessionsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (userInfo.isAdmin) { return; } @@ -61,11 +65,12 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); List feedbackSessionAttributes; + List instructors = new ArrayList<>(); if (courseId == null) { if (entityType.equals(Const.EntityType.STUDENT)) { @@ -74,19 +79,24 @@ public ActionResult execute() { for (StudentAttributes student : students) { feedbackSessionAttributes.addAll(logic.getFeedbackSessionsForCourse(student.getCourse())); } - } else { + } else if (entityType.equals(Const.EntityType.INSTRUCTOR)) { boolean isInRecycleBin = getBooleanRequestParamValue(Const.ParamsNames.IS_IN_RECYCLE_BIN); - List instructors = logic.getInstructorsForGoogleId(userInfo.getId(), true); + instructors = logic.getInstructorsForGoogleId(userInfo.getId(), true); if (isInRecycleBin) { feedbackSessionAttributes = logic.getSoftDeletedFeedbackSessionsListForInstructors(instructors); } else { feedbackSessionAttributes = logic.getFeedbackSessionsListForInstructor(instructors); } + } else { + feedbackSessionAttributes = new ArrayList<>(); } } else { feedbackSessionAttributes = logic.getFeedbackSessionsForCourse(courseId); + if (entityType.equals(Const.EntityType.INSTRUCTOR)) { + instructors = Collections.singletonList(logic.getInstructorForGoogleId(courseId, userInfo.getId())); + } } if (entityType.equals(Const.EntityType.STUDENT)) { @@ -95,9 +105,23 @@ public ActionResult execute() { .filter(FeedbackSessionAttributes::isVisible).collect(Collectors.toList()); } + Map courseIdToInstructor = new HashMap<>(); + instructors.forEach(instructor -> courseIdToInstructor.put(instructor.courseId, instructor)); + FeedbackSessionsData responseData = new FeedbackSessionsData(feedbackSessionAttributes); if (entityType.equals(Const.EntityType.STUDENT)) { responseData.getFeedbackSessions().forEach(FeedbackSessionData::hideInformationForStudent); + } else if (entityType.equals(Const.EntityType.INSTRUCTOR)) { + responseData.getFeedbackSessions().forEach(session -> { + InstructorAttributes instructor = courseIdToInstructor.get(session.getCourseId()); + if (instructor == null) { + return; + } + + InstructorPrivilegeData privilege = + constructInstructorPrivileges(instructor, session.getFeedbackSessionName()); + session.setPrivileges(privilege); + }); } return new JsonResult(responseData); } diff --git a/src/main/java/teammates/ui/webapi/action/GetHasResponsesAction.java b/src/main/java/teammates/ui/webapi/GetHasResponsesAction.java similarity index 88% rename from src/main/java/teammates/ui/webapi/action/GetHasResponsesAction.java rename to src/main/java/teammates/ui/webapi/GetHasResponsesAction.java index 32e7730630e..09a8df73b62 100644 --- a/src/main/java/teammates/ui/webapi/action/GetHasResponsesAction.java +++ b/src/main/java/teammates/ui/webapi/GetHasResponsesAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,21 +7,21 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.HasResponsesData; +import teammates.ui.output.HasResponsesData; /** * Checks whether a course or question has responses for instructor. * Checks whether a student has responded a feedback session. */ -public class GetHasResponsesAction extends Action { +class GetHasResponsesAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); @@ -34,7 +34,7 @@ public void checkSpecificAccessControl() { String questionId = getRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); if (questionId != null) { FeedbackQuestionAttributes feedbackQuestionAttributes = logic.getFeedbackQuestion(questionId); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession( + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession( feedbackQuestionAttributes.getFeedbackSessionName(), feedbackQuestionAttributes.getCourseId()); @@ -59,12 +59,12 @@ public void checkSpecificAccessControl() { gateKeeper.verifyAccessible( logic.getStudentForGoogleId(courseId, userInfo.getId()), - logic.getFeedbackSession(feedbackSessionName, courseId)); + getNonNullFeedbackSession(feedbackSessionName, courseId)); } } @Override - public ActionResult execute() { + JsonResult execute() { String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); if (entityType.equals(Const.EntityType.INSTRUCTOR)) { @@ -88,7 +88,7 @@ public ActionResult execute() { } else { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); if (feedbackSession == null) { return new JsonResult("No feedback session found with name: " + feedbackSessionName, HttpStatus.SC_NOT_FOUND); diff --git a/src/main/java/teammates/ui/webapi/action/GetInstructorAction.java b/src/main/java/teammates/ui/webapi/GetInstructorAction.java similarity index 78% rename from src/main/java/teammates/ui/webapi/action/GetInstructorAction.java rename to src/main/java/teammates/ui/webapi/GetInstructorAction.java index 94bf8440d3d..3f80b00e350 100644 --- a/src/main/java/teammates/ui/webapi/action/GetInstructorAction.java +++ b/src/main/java/teammates/ui/webapi/GetInstructorAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -8,27 +8,27 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.InstructorData; +import teammates.ui.request.Intent; /** * Get the information of an instructor inside a course. */ -public class GetInstructorAction extends BasicFeedbackSubmissionAction { +class GetInstructorAction extends BasicFeedbackSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case INSTRUCTOR_SUBMISSION: String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); if (feedbackSession == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("Feedback Session could not be " @@ -47,7 +47,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); InstructorAttributes instructorAttributes; @@ -68,7 +68,12 @@ public ActionResult execute() { return new JsonResult("Instructor could not be found for this course", HttpStatus.SC_NOT_FOUND); } - return new JsonResult(new InstructorData(instructorAttributes)); + InstructorData instructorData = new InstructorData(instructorAttributes); + if (intent == Intent.FULL_DETAIL) { + instructorData.setGoogleId(instructorAttributes.googleId); + } + + return new JsonResult(instructorData); } } diff --git a/src/main/java/teammates/ui/webapi/action/GetInstructorPrivilegeAction.java b/src/main/java/teammates/ui/webapi/GetInstructorPrivilegeAction.java similarity index 77% rename from src/main/java/teammates/ui/webapi/action/GetInstructorPrivilegeAction.java rename to src/main/java/teammates/ui/webapi/GetInstructorPrivilegeAction.java index 6e99fc33d86..8c0ef2ff47b 100644 --- a/src/main/java/teammates/ui/webapi/action/GetInstructorPrivilegeAction.java +++ b/src/main/java/teammates/ui/webapi/GetInstructorPrivilegeAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.HashMap; import java.util.Map; @@ -8,15 +8,15 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.InstructorPermissionRole; -import teammates.ui.webapi.output.InstructorPrivilegeData; +import teammates.ui.output.InstructorPermissionRole; +import teammates.ui.output.InstructorPrivilegeData; /** * Get the instructor privilege. */ -public class GetInstructorPrivilegeAction extends Action { +class GetInstructorPrivilegeAction extends Action { - static final Map INSTRUCTOR_PRIVILEGES = new HashMap<>(); + private static final Map INSTRUCTOR_PRIVILEGES = new HashMap<>(); static { InstructorPrivilegeData coOwnerPrivilegeData = new InstructorPrivilegeData(); @@ -83,12 +83,12 @@ public class GetInstructorPrivilegeAction extends Action { } @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (userInfo.isAdmin) { return; } @@ -101,7 +101,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String instructorRole = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_ROLE_NAME); if (instructorRole != null) { @@ -139,26 +139,8 @@ public ActionResult execute() { String sectionName = getRequestParamValue(Const.ParamsNames.SECTION_NAME); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - InstructorPrivilegeData response = new InstructorPrivilegeData(); - - // course level privileges. - response.constructCourseLevelPrivilege(instructor.privileges); - - if (sectionName == null && feedbackSessionName != null) { - response.setCanSubmitSessionInSections( - instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS) - || instructor.isAllowedForPrivilegeAnySection( - feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); - response.setCanViewSessionInSections( - instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS) - || instructor.isAllowedForPrivilegeAnySection( - feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - response.setCanModifySessionCommentsInSections( - instructor.isAllowedForPrivilege( - Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS) - || instructor.isAllowedForPrivilegeAnySection(feedbackSessionName, - Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS)); - } else if (sectionName != null) { + InstructorPrivilegeData response = constructInstructorPrivileges(instructor, feedbackSessionName); + if (sectionName != null) { response.constructSectionLevelPrivilege(instructor.privileges, sectionName); if (feedbackSessionName != null) { response.constructSessionLevelPrivilege(instructor.privileges, sectionName, feedbackSessionName); diff --git a/src/main/java/teammates/ui/webapi/action/GetInstructorsAction.java b/src/main/java/teammates/ui/webapi/GetInstructorsAction.java similarity index 70% rename from src/main/java/teammates/ui/webapi/action/GetInstructorsAction.java rename to src/main/java/teammates/ui/webapi/GetInstructorsAction.java index 5af8e6ba79d..8175d2f575a 100644 --- a/src/main/java/teammates/ui/webapi/action/GetInstructorsAction.java +++ b/src/main/java/teammates/ui/webapi/GetInstructorsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; import java.util.stream.Collectors; @@ -10,21 +10,23 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.output.InstructorsData; -import teammates.ui.webapi.request.Intent; +import teammates.common.util.StringHelper; +import teammates.ui.output.InstructorData; +import teammates.ui.output.InstructorsData; +import teammates.ui.request.Intent; /** * Get a list of instructors of a course. */ -public class GetInstructorsAction extends Action { +class GetInstructorsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (userInfo.isAdmin) { return; } @@ -53,7 +55,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); List instructorsOfCourse = logic.getInstructorsForCourse(courseId); @@ -76,7 +78,21 @@ public ActionResult execute() { }); } else if (intentStr.equals(Intent.FULL_DETAIL.toString())) { // get all instructors of a course without information hiding - data = new InstructorsData(instructorsOfCourse); + // adds googleId if caller is admin or has the appropriate privilege to modify instructor + if (userInfo.isAdmin || logic.getInstructorForGoogleId(courseId, userInfo.getId()).getPrivileges() + .isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR)) { + data = new InstructorsData(); + for (InstructorAttributes instructor : instructorsOfCourse) { + InstructorData instructorData = new InstructorData(instructor); + instructorData.setGoogleId(instructor.googleId); + if (userInfo.isAdmin) { + instructorData.setKey(StringHelper.encrypt(instructor.getKey())); + } + data.getInstructors().add(instructorData); + } + } else { + data = new InstructorsData(instructorsOfCourse); + } } else { throw new InvalidHttpParameterException("unknown intent"); } diff --git a/src/main/java/teammates/ui/webapi/action/GetLocalDateTimeInfoAction.java b/src/main/java/teammates/ui/webapi/GetLocalDateTimeInfoAction.java similarity index 89% rename from src/main/java/teammates/ui/webapi/action/GetLocalDateTimeInfoAction.java rename to src/main/java/teammates/ui/webapi/GetLocalDateTimeInfoAction.java index eaa6586c8ae..c1a6436e65d 100644 --- a/src/main/java/teammates/ui/webapi/action/GetLocalDateTimeInfoAction.java +++ b/src/main/java/teammates/ui/webapi/GetLocalDateTimeInfoAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.time.DateTimeException; import java.time.Instant; @@ -10,29 +10,29 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Assumption; import teammates.common.util.Const; -import teammates.ui.webapi.output.LocalDateTimeInfo; +import teammates.ui.output.LocalDateTimeInfo; /** * Resolve local date time under certain timezone to an UNIX timestamp. */ -public class GetLocalDateTimeInfoAction extends Action { +class GetLocalDateTimeInfoAction extends Action { private static final DateTimeFormatter LOCAL_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Only instructor can get local date time information"); } } @Override - public ActionResult execute() { + JsonResult execute() { String localDateTimeStr = getNonNullRequestParamValue(Const.ParamsNames.LOCAL_DATE_TIME); String zoneIdStr = getNonNullRequestParamValue(Const.ParamsNames.TIME_ZONE); diff --git a/src/main/java/teammates/ui/webapi/action/GetNationalitiesAction.java b/src/main/java/teammates/ui/webapi/GetNationalitiesAction.java similarity index 59% rename from src/main/java/teammates/ui/webapi/action/GetNationalitiesAction.java rename to src/main/java/teammates/ui/webapi/GetNationalitiesAction.java index a7de77bade4..216319124b7 100644 --- a/src/main/java/teammates/ui/webapi/action/GetNationalitiesAction.java +++ b/src/main/java/teammates/ui/webapi/GetNationalitiesAction.java @@ -1,24 +1,24 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.util.NationalityHelper; -import teammates.ui.webapi.output.NationalitiesData; +import teammates.ui.output.NationalitiesData; /** * Action: Get a list of valid nationalities. */ -public class GetNationalitiesAction extends Action { +class GetNationalitiesAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Anyone can fetch the nationality data } @Override - public ActionResult execute() { + JsonResult execute() { NationalitiesData nationalities = new NationalitiesData(NationalityHelper.getNationalities()); return new JsonResult(nationalities); } diff --git a/src/main/java/teammates/ui/webapi/action/GetOngoingSessionsAction.java b/src/main/java/teammates/ui/webapi/GetOngoingSessionsAction.java similarity index 87% rename from src/main/java/teammates/ui/webapi/action/GetOngoingSessionsAction.java rename to src/main/java/teammates/ui/webapi/GetOngoingSessionsAction.java index a70d6024ab6..7e62c9fa742 100644 --- a/src/main/java/teammates/ui/webapi/action/GetOngoingSessionsAction.java +++ b/src/main/java/teammates/ui/webapi/GetOngoingSessionsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.time.Instant; import java.util.ArrayList; @@ -13,34 +13,20 @@ import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.OngoingSession; -import teammates.ui.webapi.output.OngoingSessionsData; +import teammates.ui.output.OngoingSession; +import teammates.ui.output.OngoingSessionsData; /** * Gets the list of all ongoing sessions. */ -public class GetOngoingSessionsAction extends Action { +class GetOngoingSessionsAction extends AdminOnlyAction { private static final String UNKNOWN_INSTITUTION = "Unknown Institution"; - @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - // Only admins can get the list of all ongoing sessions - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } - @Override @SuppressWarnings("PMD.PreserveStackTrace") - public ActionResult execute() { + JsonResult execute() { String startTimeString = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_STARTTIME); long startTime; try { diff --git a/src/main/java/teammates/ui/webapi/action/GetRegkeyValidityAction.java b/src/main/java/teammates/ui/webapi/GetRegkeyValidityAction.java similarity index 69% rename from src/main/java/teammates/ui/webapi/action/GetRegkeyValidityAction.java rename to src/main/java/teammates/ui/webapi/GetRegkeyValidityAction.java index e81e674a47c..4c78729a007 100644 --- a/src/main/java/teammates/ui/webapi/action/GetRegkeyValidityAction.java +++ b/src/main/java/teammates/ui/webapi/GetRegkeyValidityAction.java @@ -1,17 +1,17 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.output.RegkeyValidityData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.RegkeyValidityData; +import teammates.ui.request.Intent; /** * Action: checks whether the provided registration key is valid for the logged in user. * *

    This does not log in or log out the user. */ -public class GetRegkeyValidityAction extends Action { +class GetRegkeyValidityAction extends Action { @Override public AuthType getMinAuthLevel() { @@ -19,37 +19,40 @@ public AuthType getMinAuthLevel() { } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Regkey information is available to everyone } @Override - public ActionResult execute() { + JsonResult execute() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); String regkey = getNonNullRequestParamValue(Const.ParamsNames.REGKEY); if (intent == Intent.STUDENT_SUBMISSION || intent == Intent.STUDENT_RESULT) { - boolean isValid = false; StudentAttributes student = logic.getStudentForRegistrationKey(regkey); + boolean isValid = student != null; + boolean isUsed = false; + boolean isAllowedAccess = false; - if (student != null) { + if (isValid) { if (StringHelper.isEmpty(student.googleId)) { // If registration key has not been used, always allow access - isValid = true; + isAllowedAccess = true; } else { + isUsed = true; // If the registration key has been used to register, the logged in user needs to match // Block access to not logged in user and mismatched user - isValid = userInfo != null && student.googleId.equals(userInfo.id); + isAllowedAccess = userInfo != null && student.googleId.equals(userInfo.id); } } - return new JsonResult(new RegkeyValidityData(isValid)); + return new JsonResult(new RegkeyValidityData(isValid, isUsed, isAllowedAccess)); } // Other intents are invalid for this purpose. // This includes instructor submission/result intents, because instructors are expected to be registered // in order to use the system. - return new JsonResult(new RegkeyValidityData(false)); + return new JsonResult(new RegkeyValidityData(false, false, false)); } } diff --git a/src/main/java/teammates/ui/webapi/action/GetSessionResponseStatsAction.java b/src/main/java/teammates/ui/webapi/GetSessionResponseStatsAction.java similarity index 56% rename from src/main/java/teammates/ui/webapi/action/GetSessionResponseStatsAction.java rename to src/main/java/teammates/ui/webapi/GetSessionResponseStatsAction.java index dc61d2c0823..5457e9fcfb2 100644 --- a/src/main/java/teammates/ui/webapi/action/GetSessionResponseStatsAction.java +++ b/src/main/java/teammates/ui/webapi/GetSessionResponseStatsAction.java @@ -1,49 +1,49 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; -import teammates.common.datatransfer.FeedbackSessionDetailsBundle; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionStatsData; +import teammates.ui.output.FeedbackSessionStatsData; /** * Action: gets the response stats (submitted / total) of a feedback session. */ -public class GetSessionResponseStatsAction extends Action { +class GetSessionResponseStatsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (userInfo.isAdmin) { return; } String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes fsa = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes fsa = getNonNullFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); gateKeeper.verifyAccessible(instructor, fsa); } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - try { - FeedbackSessionDetailsBundle fsdb = logic.getFeedbackSessionDetails(feedbackSessionName, courseId); - FeedbackSessionStatsData output = - new FeedbackSessionStatsData(fsdb.stats.submittedTotal, fsdb.stats.expectedTotal); - return new JsonResult(output); - } catch (EntityDoesNotExistException e) { - throw new EntityNotFoundException(e); + FeedbackSessionAttributes fsa = getNonNullFeedbackSession(feedbackSessionName, courseId); + if (fsa == null) { + throw new EntityNotFoundException(new EntityDoesNotExistException("Feedback session is not found")); } + + int expectedTotal = logic.getExpectedTotalSubmission(fsa); + int actualTotal = logic.getActualTotalSubmission(fsa); + FeedbackSessionStatsData output = new FeedbackSessionStatsData(actualTotal, expectedTotal); + return new JsonResult(output); } } diff --git a/src/main/java/teammates/ui/webapi/action/GetSessionResultsAction.java b/src/main/java/teammates/ui/webapi/GetSessionResultsAction.java similarity index 85% rename from src/main/java/teammates/ui/webapi/action/GetSessionResultsAction.java rename to src/main/java/teammates/ui/webapi/GetSessionResultsAction.java index 1f6aa2a8e1c..e09c4466e7e 100644 --- a/src/main/java/teammates/ui/webapi/action/GetSessionResultsAction.java +++ b/src/main/java/teammates/ui/webapi/GetSessionResultsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.datatransfer.SessionResultsBundle; import teammates.common.datatransfer.UserRole; @@ -10,25 +10,25 @@ import teammates.common.exception.InvalidHttpParameterException; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.SessionResultsData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.SessionResultsData; +import teammates.ui.request.Intent; /** * Gets feedback session results including statistics where necessary. */ -public class GetSessionResultsAction extends Action { +class GetSessionResultsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes fs = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes fs = getNonNullFeedbackSession(feedbackSessionName, courseId); if (fs == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("Feedback session is not found")); @@ -57,15 +57,14 @@ public void checkSpecificAccessControl() { } private StudentAttributes getStudent(String courseId) { - if (userInfo == null) { - String regkey = getNonNullRequestParamValue(Const.ParamsNames.REGKEY); - return logic.getStudentForRegistrationKey(regkey); - } - return logic.getStudentForGoogleId(courseId, userInfo.id); + return getUnregisteredStudent().orElseGet(() -> { + gateKeeper.verifyLoggedInUserPrivileges(); + return logic.getStudentForGoogleId(courseId, userInfo.getId()); + }); } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/webapi/action/GetStudentAction.java b/src/main/java/teammates/ui/webapi/GetStudentAction.java similarity index 75% rename from src/main/java/teammates/ui/webapi/action/GetStudentAction.java rename to src/main/java/teammates/ui/webapi/GetStudentAction.java index 5170a01f764..0edd7f85d43 100644 --- a/src/main/java/teammates/ui/webapi/action/GetStudentAction.java +++ b/src/main/java/teammates/ui/webapi/GetStudentAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,37 +7,38 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.StudentData; +import teammates.common.util.StringHelper; +import teammates.ui.output.StudentData; /** * Get the information of a student inside a course. */ -public class GetStudentAction extends Action { - - /** String indicating ACCESS is not given. */ - public static final String UNAUTHORIZED_ACCESS = "You are not allowed to view this resource!"; +class GetStudentAction extends Action { /** Message indicating that a student not found. */ - public static final String STUDENT_NOT_FOUND = "No student found"; + static final String STUDENT_NOT_FOUND = "No student found"; + + /** String indicating ACCESS is not given. */ + private static final String UNAUTHORIZED_ACCESS = "You are not allowed to view this resource!"; @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseAttributes course = logic.getCourse(courseId); - StudentAttributes student = null; + StudentAttributes student; String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String regKey = getRequestParamValue(Const.ParamsNames.REGKEY); if (studentEmail != null) { student = logic.getStudentForEmail(courseId, studentEmail); - if (student == null || !userInfo.isInstructor) { + if (student == null || userInfo == null || !userInfo.isInstructor) { throw new UnauthorizedAccessException(UNAUTHORIZED_ACCESS); } @@ -47,7 +48,7 @@ public void checkSpecificAccessControl() { } else if (regKey != null) { getUnregisteredStudent().orElseThrow(() -> new UnauthorizedAccessException(UNAUTHORIZED_ACCESS)); } else { - if (!userInfo.isStudent) { + if (userInfo == null || !userInfo.isStudent) { throw new UnauthorizedAccessException(UNAUTHORIZED_ACCESS); } @@ -57,9 +58,9 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); - StudentAttributes student = null; + StudentAttributes student; String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); @@ -80,11 +81,14 @@ public ActionResult execute() { } StudentData studentData = new StudentData(student); + if (userInfo != null && userInfo.isAdmin) { + studentData.setKey(StringHelper.encrypt(student.getKey())); + studentData.setGoogleId(student.googleId); + } // hide information if not an instructor if (studentEmail == null) { - studentData.setComments(null); - studentData.setJoinState(null); + studentData.hideInformationForStudent(); } return new JsonResult(studentData); diff --git a/src/main/java/teammates/ui/webapi/action/GetStudentProfileAction.java b/src/main/java/teammates/ui/webapi/GetStudentProfileAction.java similarity index 71% rename from src/main/java/teammates/ui/webapi/action/GetStudentProfileAction.java rename to src/main/java/teammates/ui/webapi/GetStudentProfileAction.java index 0685024cd5b..095e56b333a 100644 --- a/src/main/java/teammates/ui/webapi/action/GetStudentProfileAction.java +++ b/src/main/java/teammates/ui/webapi/GetStudentProfileAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,27 +7,25 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.output.StudentProfileData; +import teammates.ui.output.StudentProfileData; /** * Get a student's profile by an instructor, a classmate of the student, or the student itself. */ -public class GetStudentProfileAction extends Action { +class GetStudentProfileAction extends Action { private static final String MESSAGE_NOT_STUDENT_ACCOUNT = "You did not login as a student," + " so you cannot view your profile"; private static final String MESSAGE_STUDENT_NOT_FOUND = "The student is not in the course you are given," + " so you cannot access the profile."; - private static final String MESSAGE_STUDENT_NOT_REGISTERED = "The student has not registered," - + " and does not have profile"; @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); if (studentEmail == null || courseId == null) { @@ -47,34 +45,43 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String studentId; String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); + String studentName = ""; if (studentEmail == null || courseId == null) { + if (userInfo == null) { + return new JsonResult("No student found", HttpStatus.SC_NOT_FOUND); + } studentId = userInfo.id; } else { StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail); + if (student == null) { + return new JsonResult("No student found", HttpStatus.SC_NOT_FOUND); + } studentId = student.getGoogleId(); + studentName = student.getName(); } + StudentProfileAttributes studentProfile; + if (StringHelper.isEmpty(studentId)) { - // The student has not registered. - return new JsonResult(MESSAGE_STUDENT_NOT_REGISTERED, HttpStatus.SC_NOT_FOUND); + studentProfile = StudentProfileAttributes.builder("").build(); + } else { + studentProfile = logic.getStudentProfile(studentId); + studentName = logic.getAccount(studentId).name; } - StudentProfileAttributes studentProfile = logic.getStudentProfile(studentId); - String name = logic.getAccount(studentId).name; - if (studentProfile == null) { // create one on the fly studentProfile = StudentProfileAttributes.builder(studentId).build(); } - StudentProfileData output = new StudentProfileData(name, studentProfile); + StudentProfileData output = new StudentProfileData(studentName, studentProfile); // If student requesting and is not the student's own profile, hide some fields - if (userInfo.isStudent && !studentId.equals(userInfo.id)) { + if (userInfo == null || userInfo.isStudent && !userInfo.isInstructor && !studentId.equals(userInfo.id)) { output.hideInformationWhenViewedByOtherStudent(); } diff --git a/src/main/java/teammates/ui/webapi/action/GetStudentProfilePictureAction.java b/src/main/java/teammates/ui/webapi/GetStudentProfilePictureAction.java similarity index 79% rename from src/main/java/teammates/ui/webapi/action/GetStudentProfilePictureAction.java rename to src/main/java/teammates/ui/webapi/GetStudentProfilePictureAction.java index 1a53231550a..c0f76c885bf 100644 --- a/src/main/java/teammates/ui/webapi/action/GetStudentProfilePictureAction.java +++ b/src/main/java/teammates/ui/webapi/GetStudentProfilePictureAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -11,21 +11,18 @@ /** * Action: serves a profile picture that is stored in Google Cloud Storage. */ -public class GetStudentProfilePictureAction extends Action { +class GetStudentProfilePictureAction extends Action { /** Indicates ACCESS is not given. */ - public static final String UNAUTHORIZED_ACCESS = "You are not allowed to view this resource!"; - - /** Indicates profile picture not found. */ - public static final String PROFILE_PIC_NOT_FOUND = "Student has no profile picture"; + private static final String UNAUTHORIZED_ACCESS = "You are not allowed to view this resource!"; @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); @@ -47,7 +44,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + ActionResult execute() { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); @@ -57,6 +54,9 @@ public ActionResult execute() { studentProfile = logic.getStudentProfile(userInfo.id); } else { StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail); + if (student == null) { + return new JsonResult("No student found", HttpStatus.SC_NOT_FOUND); + } if (!StringHelper.isEmpty(student.googleId)) { studentProfile = logic.getStudentProfile(student.googleId); @@ -64,7 +64,7 @@ public ActionResult execute() { } if (studentProfile == null || studentProfile.pictureKey.equals("")) { - return new JsonResult(PROFILE_PIC_NOT_FOUND, HttpStatus.SC_NOT_FOUND); + return new ImageResult(); } return new ImageResult(studentProfile.pictureKey); diff --git a/src/main/java/teammates/ui/webapi/action/GetStudentsAction.java b/src/main/java/teammates/ui/webapi/GetStudentsAction.java similarity index 81% rename from src/main/java/teammates/ui/webapi/action/GetStudentsAction.java rename to src/main/java/teammates/ui/webapi/GetStudentsAction.java index a036fe66536..18a8d49df72 100644 --- a/src/main/java/teammates/ui/webapi/action/GetStudentsAction.java +++ b/src/main/java/teammates/ui/webapi/GetStudentsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -6,20 +6,21 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.StudentsData; +import teammates.ui.output.StudentData; +import teammates.ui.output.StudentsData; /** * Get a list of students. */ -public class GetStudentsAction extends Action { +class GetStudentsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String teamName = getRequestParamValue(Const.ParamsNames.TEAM_NAME); if (teamName == null) { @@ -36,7 +37,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String teamName = getRequestParamValue(Const.ParamsNames.TEAM_NAME); @@ -48,13 +49,7 @@ public ActionResult execute() { // request to get team members by current student List studentsForTeam = logic.getStudentsForTeam(teamName, courseId); StudentsData studentsData = new StudentsData(studentsForTeam); - - // hide information for students - studentsData.getStudents().forEach(s -> { - s.setComments(null); - s.setJoinState(null); - }); - + studentsData.getStudents().forEach(StudentData::hideInformationForStudent); return new JsonResult(studentsData); } diff --git a/src/main/java/teammates/ui/webapi/action/GetTimeZonesAction.java b/src/main/java/teammates/ui/webapi/GetTimeZonesAction.java similarity index 57% rename from src/main/java/teammates/ui/webapi/action/GetTimeZonesAction.java rename to src/main/java/teammates/ui/webapi/GetTimeZonesAction.java index 0ef9181f1c4..69d17cfaea6 100644 --- a/src/main/java/teammates/ui/webapi/action/GetTimeZonesAction.java +++ b/src/main/java/teammates/ui/webapi/GetTimeZonesAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.time.Instant; import java.time.ZoneId; @@ -6,28 +6,15 @@ import java.util.Map; import java.util.TreeMap; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.ui.webapi.output.TimeZonesData; +import teammates.ui.output.TimeZonesData; /** * Action: get supported time zones. */ -public class GetTimeZonesAction extends Action { +class GetTimeZonesAction extends AdminOnlyAction { @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } - - @Override - public JsonResult execute() { + JsonResult execute() { String tzVersion = ZoneRulesProvider.getVersions("UTC").firstKey(); Instant now = Instant.now(); Map tzOffsets = new TreeMap<>(); diff --git a/src/main/java/teammates/ui/webapi/ImageResult.java b/src/main/java/teammates/ui/webapi/ImageResult.java new file mode 100644 index 00000000000..0d22dea7f78 --- /dev/null +++ b/src/main/java/teammates/ui/webapi/ImageResult.java @@ -0,0 +1,40 @@ +package teammates.ui.webapi; + +import java.io.IOException; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.http.HttpStatus; + +import teammates.common.util.GoogleCloudStorageHelper; + +/** + * Action result in form of an image. + */ +class ImageResult extends ActionResult { + + /** The blob key for the image. */ + private String blobKey; + + ImageResult() { + super(HttpStatus.SC_NO_CONTENT); + } + + ImageResult(String blobKey) { + super(HttpStatus.SC_OK); + this.blobKey = blobKey; + } + + String getBlobKey() { + return blobKey; + } + + @Override + void send(HttpServletResponse resp) throws IOException { + resp.setContentType("image/png"); + if (blobKey != null) { + GoogleCloudStorageHelper.serve(resp, blobKey); + } + } + +} diff --git a/src/main/java/teammates/ui/automated/InstructorCourseJoinEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/InstructorCourseJoinEmailWorkerAction.java similarity index 92% rename from src/main/java/teammates/ui/automated/InstructorCourseJoinEmailWorkerAction.java rename to src/main/java/teammates/ui/webapi/InstructorCourseJoinEmailWorkerAction.java index e014678f0a8..3816ba1312f 100644 --- a/src/main/java/teammates/ui/automated/InstructorCourseJoinEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/InstructorCourseJoinEmailWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; @@ -10,10 +10,10 @@ /** * Task queue worker action: sends registration email for an instructor of a course. */ -public class InstructorCourseJoinEmailWorkerAction extends AutomatedAction { +class InstructorCourseJoinEmailWorkerAction extends AdminOnlyAction { @Override - public void execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(ParamsNames.COURSE_ID); String instructorEmail = getNonNullRequestParamValue(ParamsNames.INSTRUCTOR_EMAIL); boolean isRejoin = getBooleanRequestParamValue(ParamsNames.IS_INSTRUCTOR_REJOINING); @@ -43,6 +43,7 @@ public void execute() { } emailSender.sendEmail(email); + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/webapi/action/JoinCourseAction.java b/src/main/java/teammates/ui/webapi/JoinCourseAction.java similarity index 94% rename from src/main/java/teammates/ui/webapi/action/JoinCourseAction.java rename to src/main/java/teammates/ui/webapi/JoinCourseAction.java index 7a745b04f90..089d06026d4 100644 --- a/src/main/java/teammates/ui/webapi/action/JoinCourseAction.java +++ b/src/main/java/teammates/ui/webapi/JoinCourseAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -14,20 +14,20 @@ /** * Action: joins a course for a student/instructor. */ -public class JoinCourseAction extends Action { +class JoinCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Any user can use a join link as long as its parameters are valid } @Override - public ActionResult execute() { + JsonResult execute() { String regKey = getNonNullRequestParamValue(Const.ParamsNames.REGKEY); String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); switch (entityType) { diff --git a/src/main/java/teammates/ui/webapi/action/JsonResult.java b/src/main/java/teammates/ui/webapi/JsonResult.java similarity index 68% rename from src/main/java/teammates/ui/webapi/action/JsonResult.java rename to src/main/java/teammates/ui/webapi/JsonResult.java index 0bc14cb3e26..250fe087e8a 100644 --- a/src/main/java/teammates/ui/webapi/action/JsonResult.java +++ b/src/main/java/teammates/ui/webapi/JsonResult.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; import java.io.PrintWriter; @@ -12,57 +12,58 @@ import teammates.common.util.Config; import teammates.common.util.JsonUtils; -import teammates.ui.webapi.output.ApiOutput; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.ApiOutput; +import teammates.ui.output.MessageOutput; /** * Action result in form of JSON object. * *

    This is the most common format for REST-ful back-end API response. */ -public class JsonResult extends ActionResult { +class JsonResult extends ActionResult { private final ApiOutput output; private List cookies; - public JsonResult(ApiOutput output) { + JsonResult(ApiOutput output) { super(HttpStatus.SC_OK); this.output = output; this.cookies = new ArrayList<>(); } - public JsonResult(ApiOutput output, List cookies) { + JsonResult(ApiOutput output, List cookies) { this(output); this.cookies = cookies; } - public JsonResult(String message) { + JsonResult(String message) { this(message, HttpStatus.SC_OK); } - public JsonResult(String message, int statusCode) { + JsonResult(String message, int statusCode) { super(statusCode); this.output = new MessageOutput(message); this.cookies = new ArrayList<>(); } - public ApiOutput getOutput() { + ApiOutput getOutput() { return output; } @Override - public void send(HttpServletResponse resp) throws IOException { + void send(HttpServletResponse resp) throws IOException { output.setRequestId(Config.getRequestId()); for (Cookie cookie : cookies) { + cookie.setSecure(!Config.isDevServer()); resp.addCookie(cookie); } resp.setStatus(getStatusCode()); resp.setContentType("application/json"); PrintWriter pw = resp.getWriter(); - pw.print(JsonUtils.toJson(output)); + pw.print(JsonUtils.toCompactJson(output)); } - public List getCookies() { + List getCookies() { return cookies; } diff --git a/src/main/java/teammates/ui/webapi/action/LegacyUrlMapper.java b/src/main/java/teammates/ui/webapi/LegacyUrlMapper.java similarity index 87% rename from src/main/java/teammates/ui/webapi/action/LegacyUrlMapper.java rename to src/main/java/teammates/ui/webapi/LegacyUrlMapper.java index 2604f305c57..ebe2968f714 100644 --- a/src/main/java/teammates/ui/webapi/action/LegacyUrlMapper.java +++ b/src/main/java/teammates/ui/webapi/LegacyUrlMapper.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; @@ -6,8 +6,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import teammates.common.util.AppUrl; import teammates.common.util.Config; import teammates.common.util.Const; +import teammates.common.util.StringHelper; /** * Maps some selected legacy URLs to new one. This is primarily for URLs send via email. @@ -31,10 +33,16 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc switch (uri) { case Const.LegacyURIs.INSTRUCTOR_COURSE_JOIN: key = req.getParameter(Const.ParamsNames.REGKEY); - redirectUrl = Config.getFrontEndAppUrl(Const.WebPageURIs.JOIN_PAGE) + String institute = req.getParameter(Const.ParamsNames.INSTRUCTOR_INSTITUTION); + AppUrl newUrl = Config.getFrontEndAppUrl(Const.WebPageURIs.JOIN_PAGE) .withRegistrationKey(key) - .withParam(Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR) - .toString(); + .withParam(Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR); + if (institute != null) { + newUrl = newUrl + .withInstructorInstitution(institute) + .withInstitutionMac(StringHelper.generateSignature(institute)); + } + redirectUrl = newUrl.toString(); break; case Const.LegacyURIs.STUDENT_COURSE_JOIN: case Const.LegacyURIs.STUDENT_COURSE_JOIN_NEW: diff --git a/src/main/java/teammates/ui/webapi/action/LogoutServlet.java b/src/main/java/teammates/ui/webapi/LogoutServlet.java similarity index 95% rename from src/main/java/teammates/ui/webapi/action/LogoutServlet.java rename to src/main/java/teammates/ui/webapi/LogoutServlet.java index a3c338cb1fd..932fe69f638 100644 --- a/src/main/java/teammates/ui/webapi/action/LogoutServlet.java +++ b/src/main/java/teammates/ui/webapi/LogoutServlet.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; diff --git a/src/main/java/teammates/ui/webapi/action/OriginCheckFilter.java b/src/main/java/teammates/ui/webapi/OriginCheckFilter.java similarity index 98% rename from src/main/java/teammates/ui/webapi/action/OriginCheckFilter.java rename to src/main/java/teammates/ui/webapi/OriginCheckFilter.java index 027d47e2579..c0053d44dc1 100644 --- a/src/main/java/teammates/ui/webapi/action/OriginCheckFilter.java +++ b/src/main/java/teammates/ui/webapi/OriginCheckFilter.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; import java.util.Arrays; @@ -44,7 +44,8 @@ public class OriginCheckFilter implements Filter { private static final String ALLOWED_HEADERS = String.join(", ", Arrays.asList( Const.CsrfConfig.TOKEN_HEADER_NAME, - "Content-Type" + "Content-Type", + "ngsw-bypass" )); @Override diff --git a/src/main/java/teammates/ui/webapi/action/PostStudentProfilePictureAction.java b/src/main/java/teammates/ui/webapi/PostStudentProfilePictureAction.java similarity index 89% rename from src/main/java/teammates/ui/webapi/action/PostStudentProfilePictureAction.java rename to src/main/java/teammates/ui/webapi/PostStudentProfilePictureAction.java index 4acad2de273..b0cf009424f 100644 --- a/src/main/java/teammates/ui/webapi/action/PostStudentProfilePictureAction.java +++ b/src/main/java/teammates/ui/webapi/PostStudentProfilePictureAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; import java.io.InputStream; @@ -14,26 +14,26 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.GoogleCloudStorageHelper; -import teammates.ui.webapi.output.StudentProfilePictureResults; +import teammates.ui.output.StudentProfilePictureResults; /** * Action: saves the file information of the profile picture that was just uploaded. */ -public class PostStudentProfilePictureAction extends Action { +class PostStudentProfilePictureAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isStudent) { throw new UnauthorizedAccessException("Student privilege is required to access this resource."); } } @Override - public ActionResult execute() { + JsonResult execute() { try { Part image = req.getPart("studentprofilephoto"); if (image == null) { diff --git a/src/main/java/teammates/ui/webapi/action/PublishFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/PublishFeedbackSessionAction.java similarity index 80% rename from src/main/java/teammates/ui/webapi/action/PublishFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/PublishFeedbackSessionAction.java index bf3ad2e30be..a5856b5b423 100644 --- a/src/main/java/teammates/ui/webapi/action/PublishFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/PublishFeedbackSessionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,32 +7,32 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionData; /** * Publish a feedback session. */ -public class PublishFeedbackSessionAction extends Action { +class PublishFeedbackSessionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); - FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); - gateKeeper.verifyAccessible(instructor, session, + gateKeeper.verifyAccessible(instructor, feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/webapi/action/PutDataBundleAction.java b/src/main/java/teammates/ui/webapi/PutDataBundleAction.java similarity index 82% rename from src/main/java/teammates/ui/webapi/action/PutDataBundleAction.java rename to src/main/java/teammates/ui/webapi/PutDataBundleAction.java index 1b7d3fc516a..62cb5c76583 100644 --- a/src/main/java/teammates/ui/webapi/action/PutDataBundleAction.java +++ b/src/main/java/teammates/ui/webapi/PutDataBundleAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -11,22 +11,22 @@ /** * Persists a data bundle into the DB. */ -public class PutDataBundleAction extends Action { +class PutDataBundleAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.ALL_ACCESS; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!Config.isDevServer()) { throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } } @Override - public JsonResult execute() { + JsonResult execute() { DataBundle dataBundle = JsonUtils.fromJson(getRequestBody(), DataBundle.class); try { diff --git a/src/main/java/teammates/ui/webapi/action/PutDataBundleDocumentsAction.java b/src/main/java/teammates/ui/webapi/PutDataBundleDocumentsAction.java similarity index 77% rename from src/main/java/teammates/ui/webapi/action/PutDataBundleDocumentsAction.java rename to src/main/java/teammates/ui/webapi/PutDataBundleDocumentsAction.java index b24f3b45410..60f203af0e4 100644 --- a/src/main/java/teammates/ui/webapi/action/PutDataBundleDocumentsAction.java +++ b/src/main/java/teammates/ui/webapi/PutDataBundleDocumentsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -10,22 +10,22 @@ /** * Puts searchable documents from the data bundle into the DB. */ -public class PutDataBundleDocumentsAction extends Action { +class PutDataBundleDocumentsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.ALL_ACCESS; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!Config.isDevServer()) { throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } } @Override - public JsonResult execute() { + JsonResult execute() { DataBundle dataBundle = JsonUtils.fromJson(getRequestBody(), DataBundle.class); logic.putDocuments(dataBundle); return new JsonResult("Data bundle documents successfully added.", HttpStatus.SC_OK); diff --git a/src/main/java/teammates/ui/webapi/action/RegenerateStudentCourseLinksAction.java b/src/main/java/teammates/ui/webapi/RegenerateStudentCourseLinksAction.java similarity index 65% rename from src/main/java/teammates/ui/webapi/action/RegenerateStudentCourseLinksAction.java rename to src/main/java/teammates/ui/webapi/RegenerateStudentCourseLinksAction.java index 9f6ef35a57b..848d2958137 100644 --- a/src/main/java/teammates/ui/webapi/action/RegenerateStudentCourseLinksAction.java +++ b/src/main/java/teammates/ui/webapi/RegenerateStudentCourseLinksAction.java @@ -1,55 +1,42 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.RegenerateStudentException; -import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.EmailSendingStatus; import teammates.common.util.EmailWrapper; import teammates.common.util.StringHelper; import teammates.common.util.Templates; -import teammates.ui.webapi.output.RegenerateStudentCourseLinksData; +import teammates.ui.output.RegenerateStudentCourseLinksData; /** * Regenerates the course join and feedback session links for a given student in a course. */ -public class RegenerateStudentCourseLinksAction extends Action { +class RegenerateStudentCourseLinksAction extends AdminOnlyAction { /** Message indicating that the email parameter value is not a valid email address. */ - public static final String STUDENT_NOT_FOUND = "The student with the email %s could not be found for " - + "the course with ID [%s]."; - - private static final String UNSUCCESSFUL_REGENERATION = - "Regeneration of the student's links for this course was unsuccessful."; + static final String STUDENT_NOT_FOUND = + "The student with the email %s could not be found for the course with ID [%s]."; private static final String SUCCESSFUL_REGENERATION = - "Student's links for this course have been successfully regenerated,"; + "Student's links for this course have been successfully regenerated,"; /** Message indicating that the links regeneration was successful, and corresponding email was sent. */ - public static final String SUCCESSFUL_REGENERATION_WITH_EMAIL_SENT = - SUCCESSFUL_REGENERATION + " and the email has been sent."; - - /** Message indicating that the links regeneration was successful, but corresponding email could not be sent. */ - public static final String SUCCESSFUL_REGENERATION_BUT_EMAIL_FAILED = - SUCCESSFUL_REGENERATION + " but the email failed to send."; + static final String SUCCESSFUL_REGENERATION_WITH_EMAIL_SENT = + SUCCESSFUL_REGENERATION + " and the email has been sent."; - @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } + private static final String UNSUCCESSFUL_REGENERATION = + "Regeneration of the student's links for this course was unsuccessful."; - @Override - public void checkSpecificAccessControl() { - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } + /** Message indicating that the links regeneration was successful, but corresponding email could not be sent. */ + private static final String SUCCESSFUL_REGENERATION_BUT_EMAIL_FAILED = + SUCCESSFUL_REGENERATION + " but the email failed to send."; @Override - public ActionResult execute() { + JsonResult execute() { String studentEmailAddress = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); diff --git a/src/main/java/teammates/ui/webapi/action/RemindFeedbackSessionResultAction.java b/src/main/java/teammates/ui/webapi/RemindFeedbackSessionResultAction.java similarity index 67% rename from src/main/java/teammates/ui/webapi/action/RemindFeedbackSessionResultAction.java rename to src/main/java/teammates/ui/webapi/RemindFeedbackSessionResultAction.java index 2440816359e..cf6362b4ed7 100644 --- a/src/main/java/teammates/ui/webapi/action/RemindFeedbackSessionResultAction.java +++ b/src/main/java/teammates/ui/webapi/RemindFeedbackSessionResultAction.java @@ -1,26 +1,26 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.request.FeedbackSessionStudentRemindRequest; +import teammates.ui.request.FeedbackSessionRespondentRemindRequest; /** * Remind the student about the published result of a feedback session. */ -public class RemindFeedbackSessionResultAction extends Action { +class RemindFeedbackSessionResultAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.getId()), @@ -29,18 +29,18 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); if (!feedbackSession.isPublished()) { return new JsonResult("Published email could not be resent " + "as the feedback session is not published.", HttpStatus.SC_BAD_REQUEST); } - FeedbackSessionStudentRemindRequest remindRequest = - getAndValidateRequestBody(FeedbackSessionStudentRemindRequest.class); + FeedbackSessionRespondentRemindRequest remindRequest = + getAndValidateRequestBody(FeedbackSessionRespondentRemindRequest.class); String[] usersToEmail = remindRequest.getUsersToRemind(); taskQueuer.scheduleFeedbackSessionResendPublishedEmail(courseId, feedbackSessionName, usersToEmail); diff --git a/src/main/java/teammates/ui/webapi/action/RemindFeedbackSessionSubmissionAction.java b/src/main/java/teammates/ui/webapi/RemindFeedbackSessionSubmissionAction.java similarity index 67% rename from src/main/java/teammates/ui/webapi/action/RemindFeedbackSessionSubmissionAction.java rename to src/main/java/teammates/ui/webapi/RemindFeedbackSessionSubmissionAction.java index 73948d794b4..715a4067916 100644 --- a/src/main/java/teammates/ui/webapi/action/RemindFeedbackSessionSubmissionAction.java +++ b/src/main/java/teammates/ui/webapi/RemindFeedbackSessionSubmissionAction.java @@ -1,27 +1,27 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.request.FeedbackSessionStudentRemindRequest; +import teammates.ui.request.FeedbackSessionRespondentRemindRequest; /** * Remind students about the feedback submission. */ -public class RemindFeedbackSessionSubmissionAction extends Action { +class RemindFeedbackSessionSubmissionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.getId()), @@ -30,18 +30,18 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); if (!feedbackSession.isOpened()) { return new JsonResult("Reminder email could not be sent out " + "as the feedback session is not open for submissions.", HttpStatus.SC_BAD_REQUEST); } - FeedbackSessionStudentRemindRequest remindRequest = - getAndValidateRequestBody(FeedbackSessionStudentRemindRequest.class); + FeedbackSessionRespondentRemindRequest remindRequest = + getAndValidateRequestBody(FeedbackSessionRespondentRemindRequest.class); String[] usersToRemind = remindRequest.getUsersToRemind(); taskQueuer.scheduleFeedbackSessionRemindersForParticularUsers(courseId, feedbackSessionName, diff --git a/src/main/java/teammates/ui/webapi/action/ResetAccountAction.java b/src/main/java/teammates/ui/webapi/ResetAccountAction.java similarity index 84% rename from src/main/java/teammates/ui/webapi/action/ResetAccountAction.java rename to src/main/java/teammates/ui/webapi/ResetAccountAction.java index ea92810667f..fe43b82360f 100644 --- a/src/main/java/teammates/ui/webapi/action/ResetAccountAction.java +++ b/src/main/java/teammates/ui/webapi/ResetAccountAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,29 +7,15 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; /** * Action: resets an account ID. */ -public class ResetAccountAction extends Action { +class ResetAccountAction extends AdminOnlyAction { @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - // Only admins can reset accounts - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } - - @Override - public ActionResult execute() { + JsonResult execute() { String studentEmail = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); String instructorEmail = getRequestParamValue(Const.ParamsNames.INSTRUCTOR_EMAIL); diff --git a/src/main/java/teammates/ui/webapi/action/RestoreCourseAction.java b/src/main/java/teammates/ui/webapi/RestoreCourseAction.java similarity index 86% rename from src/main/java/teammates/ui/webapi/action/RestoreCourseAction.java rename to src/main/java/teammates/ui/webapi/RestoreCourseAction.java index 37c2f34b6eb..c04ac6e6fda 100644 --- a/src/main/java/teammates/ui/webapi/action/RestoreCourseAction.java +++ b/src/main/java/teammates/ui/webapi/RestoreCourseAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -9,15 +9,15 @@ /** * Action: Restores a course from Recycle Bin. */ -public class RestoreCourseAction extends Action { +class RestoreCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } @@ -28,7 +28,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String idOfCourseToRestore = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String statusMessage; diff --git a/src/main/java/teammates/ui/webapi/action/RestoreFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/RestoreFeedbackSessionAction.java similarity index 68% rename from src/main/java/teammates/ui/webapi/action/RestoreFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/RestoreFeedbackSessionAction.java index 4c9be8aec74..ef3ddce8fa7 100644 --- a/src/main/java/teammates/ui/webapi/action/RestoreFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/RestoreFeedbackSessionAction.java @@ -1,26 +1,28 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.InstructorPrivilegeData; /** * Restore a feedback session from the recycle bin. */ -public class RestoreFeedbackSessionAction extends Action { +class RestoreFeedbackSessionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSessionFromRecycleBin(feedbackSessionName, courseId); @@ -32,7 +34,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); @@ -48,8 +50,13 @@ public ActionResult execute() { new JsonResult(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } - FeedbackSessionAttributes restoredFs = logic.getFeedbackSession(feedbackSessionName, courseId); - return new JsonResult(new FeedbackSessionData(restoredFs)); + FeedbackSessionAttributes restoredFs = getNonNullFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionData output = new FeedbackSessionData(restoredFs); + InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); + InstructorPrivilegeData privilege = constructInstructorPrivileges(instructor, feedbackSessionName); + output.setPrivileges(privilege); + + return new JsonResult(output); } } diff --git a/src/main/java/teammates/ui/webapi/action/SearchCommentsAction.java b/src/main/java/teammates/ui/webapi/SearchCommentsAction.java similarity index 81% rename from src/main/java/teammates/ui/webapi/action/SearchCommentsAction.java rename to src/main/java/teammates/ui/webapi/SearchCommentsAction.java index 88793fdf727..d1c0309b236 100644 --- a/src/main/java/teammates/ui/webapi/action/SearchCommentsAction.java +++ b/src/main/java/teammates/ui/webapi/SearchCommentsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -6,20 +6,20 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; -import teammates.ui.webapi.output.CommentSearchResultsData; +import teammates.ui.output.CommentSearchResultsData; /** * Action searches for comments. Keyword hits on session, question, or response will also be returned. */ -public class SearchCommentsAction extends Action { +class SearchCommentsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Only instructors can search for comments if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); @@ -27,7 +27,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String searchKey = getNonNullRequestParamValue(Const.ParamsNames.SEARCH_KEY); List instructors = logic.getInstructorsForGoogleId(userInfo.id); diff --git a/src/main/java/teammates/ui/webapi/action/SearchInstructorsAction.java b/src/main/java/teammates/ui/webapi/SearchInstructorsAction.java similarity index 67% rename from src/main/java/teammates/ui/webapi/action/SearchInstructorsAction.java rename to src/main/java/teammates/ui/webapi/SearchInstructorsAction.java index 5c9b40d9cb0..e0c254cb6a6 100644 --- a/src/main/java/teammates/ui/webapi/action/SearchInstructorsAction.java +++ b/src/main/java/teammates/ui/webapi/SearchInstructorsAction.java @@ -1,33 +1,19 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.output.InstructorsData; +import teammates.ui.output.InstructorData; +import teammates.ui.output.InstructorsData; /** * Searches for instructors. */ -public class SearchInstructorsAction extends Action { - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - // Only admins can search for instructors - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } +class SearchInstructorsAction extends AdminOnlyAction { private String getInstituteFromGoogleId(String googleId) { if (googleId != null) { @@ -40,7 +26,7 @@ private String getInstituteFromGoogleId(String googleId) { } @Override - public ActionResult execute() { + JsonResult execute() { String searchKey = getNonNullRequestParamValue(Const.ParamsNames.ADMIN_SEARCH_KEY); List instructors = logic.searchInstructorsInWholeSystem(searchKey).instructorList; @@ -49,8 +35,8 @@ public ActionResult execute() { InstructorData instructorData = new InstructorData(instructor); instructorData.addAdditionalInformationForAdminSearch( StringHelper.encrypt(instructor.getKey()), - getInstituteFromGoogleId(instructor.getGoogleId())); - instructorData.hideInformationForSearch(); + getInstituteFromGoogleId(instructor.getGoogleId()), + instructor.getGoogleId()); instructorDataList.add(instructorData); } diff --git a/src/main/java/teammates/ui/webapi/action/SearchStudentsAction.java b/src/main/java/teammates/ui/webapi/SearchStudentsAction.java similarity index 79% rename from src/main/java/teammates/ui/webapi/action/SearchStudentsAction.java rename to src/main/java/teammates/ui/webapi/SearchStudentsAction.java index 1c462ddc428..6e728caf5b7 100644 --- a/src/main/java/teammates/ui/webapi/action/SearchStudentsAction.java +++ b/src/main/java/teammates/ui/webapi/SearchStudentsAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -6,24 +6,25 @@ import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.exception.InvalidHttpParameterException; import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.output.StudentData; -import teammates.ui.webapi.output.StudentsData; +import teammates.ui.output.StudentData; +import teammates.ui.output.StudentsData; /** * Action for searching for students. */ -public class SearchStudentsAction extends Action { +class SearchStudentsAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Only instructors and admins can search for student if (!userInfo.isInstructor && !userInfo.isAdmin) { throw new UnauthorizedAccessException("Instructor or Admin privilege is required to access this resource."); @@ -70,28 +71,31 @@ private String findAvailableInstructorGoogleIdForCourse(String courseId) { } @Override - public ActionResult execute() { + JsonResult execute() { String searchKey = getNonNullRequestParamValue(Const.ParamsNames.SEARCH_KEY); + String entity = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); List students; - List studentDataList = new ArrayList<>(); // Search for students - if (userInfo.isAdmin) { - students = logic.searchStudentsInWholeSystem(searchKey).studentList; - } else { + if (userInfo.isInstructor && entity.equals(Const.EntityType.INSTRUCTOR)) { List instructors = logic.getInstructorsForGoogleId(userInfo.id); students = logic.searchStudents(searchKey, instructors).studentList; + } else if (userInfo.isAdmin && entity.equals(Const.EntityType.ADMIN)) { + students = logic.searchStudentsInWholeSystem(searchKey).studentList; + } else { + throw new InvalidHttpParameterException("Invalid entity type for search"); } + List studentDataList = new ArrayList<>(); for (StudentAttributes s : students) { StudentData studentData = new StudentData(s); - if (userInfo.isAdmin) { + if (userInfo.isAdmin && entity.equals(Const.EntityType.ADMIN)) { studentData.addAdditionalInformationForAdminSearch( StringHelper.encrypt(s.getKey()), - getInstituteFromCourseId(s.getCourse())); - } else { - studentData.hideInformationForInstructor(); + getInstituteFromCourseId(s.getCourse()), + s.getGoogleId() + ); } studentData.hideLastName(); diff --git a/src/main/java/teammates/ui/webapi/SendEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/SendEmailWorkerAction.java new file mode 100644 index 00000000000..a43e973fe40 --- /dev/null +++ b/src/main/java/teammates/ui/webapi/SendEmailWorkerAction.java @@ -0,0 +1,26 @@ +package teammates.ui.webapi; + +import org.apache.http.HttpStatus; + +import teammates.common.util.EmailSendingStatus; +import teammates.common.util.EmailWrapper; +import teammates.ui.request.SendEmailRequest; + +/** + * Task queue worker action: sends queued email. + */ +class SendEmailWorkerAction extends AdminOnlyAction { + + @Override + JsonResult execute() { + SendEmailRequest emailRequest = getAndValidateRequestBody(SendEmailRequest.class); + EmailWrapper email = emailRequest.getEmail(); + EmailSendingStatus status = emailSender.sendEmail(email); + if (!status.isSuccess()) { + // Set an arbitrary retry code outside of the range 200-299 so GAE will automatically retry upon failure + return new JsonResult("Failure", HttpStatus.SC_BAD_GATEWAY); + } + return new JsonResult("Successful"); + } + +} diff --git a/src/main/java/teammates/ui/webapi/action/SendErrorReportAction.java b/src/main/java/teammates/ui/webapi/SendErrorReportAction.java similarity index 77% rename from src/main/java/teammates/ui/webapi/action/SendErrorReportAction.java rename to src/main/java/teammates/ui/webapi/SendErrorReportAction.java index 4be6f23c874..178b306f373 100644 --- a/src/main/java/teammates/ui/webapi/action/SendErrorReportAction.java +++ b/src/main/java/teammates/ui/webapi/SendErrorReportAction.java @@ -1,27 +1,27 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import teammates.common.util.Logger; -import teammates.ui.webapi.request.ErrorReportRequest; +import teammates.ui.request.ErrorReportRequest; /** * Actions: sends an error report to the system admin. */ -public class SendErrorReportAction extends Action { +class SendErrorReportAction extends Action { private static final Logger log = Logger.getLogger(); @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { // Anyone can submit an error report return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // Anyone can submit an error report } @Override - public JsonResult execute() { + JsonResult execute() { ErrorReportRequest report = getAndValidateRequestBody(ErrorReportRequest.class); // Severe logs will trigger email to the system admin @@ -33,7 +33,7 @@ public JsonResult execute() { /** * Gets the user error report that will be sent to the system admin. */ - public String getUserErrorReportLogMessage(ErrorReportRequest report) { + String getUserErrorReportLogMessage(ErrorReportRequest report) { String user = userInfo == null ? "Non-logged in user" : userInfo.id; return "====== USER FEEDBACK ABOUT ERROR ======" + System.lineSeparator() + "USER: " + user + System.lineSeparator() diff --git a/src/main/java/teammates/ui/webapi/action/SendJoinReminderEmailAction.java b/src/main/java/teammates/ui/webapi/SendJoinReminderEmailAction.java similarity index 95% rename from src/main/java/teammates/ui/webapi/action/SendJoinReminderEmailAction.java rename to src/main/java/teammates/ui/webapi/SendJoinReminderEmailAction.java index 9e779a6000a..d595d96285e 100644 --- a/src/main/java/teammates/ui/webapi/action/SendJoinReminderEmailAction.java +++ b/src/main/java/teammates/ui/webapi/SendJoinReminderEmailAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -14,15 +14,15 @@ /** * Send join reminder emails to register for a course. */ -public class SendJoinReminderEmailAction extends Action { +class SendJoinReminderEmailAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseAttributes course = logic.getCourse(courseId); @@ -50,7 +50,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); CourseAttributes course = logic.getCourse(courseId); diff --git a/src/main/java/teammates/ui/webapi/action/SessionLinksRecoveryAction.java b/src/main/java/teammates/ui/webapi/SessionLinksRecoveryAction.java similarity index 86% rename from src/main/java/teammates/ui/webapi/action/SessionLinksRecoveryAction.java rename to src/main/java/teammates/ui/webapi/SessionLinksRecoveryAction.java index f40bfd46759..1e9ea804340 100644 --- a/src/main/java/teammates/ui/webapi/action/SessionLinksRecoveryAction.java +++ b/src/main/java/teammates/ui/webapi/SessionLinksRecoveryAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import static teammates.common.util.FieldValidator.REGEX_EMAIL; @@ -8,25 +8,25 @@ import teammates.common.util.EmailSendingStatus; import teammates.common.util.EmailWrapper; import teammates.common.util.StringHelper; -import teammates.ui.webapi.output.SessionLinksRecoveryResponseData; +import teammates.ui.output.SessionLinksRecoveryResponseData; /** * Action specifically created for confirming email and sending session recovery links. */ -public class SessionLinksRecoveryAction extends Action { +class SessionLinksRecoveryAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { // no specific access control needed. } @Override - public ActionResult execute() { + JsonResult execute() { String recoveryEmailAddress = getNonNullRequestParamValue(Const.ParamsNames.SESSION_LINKS_RECOVERY_EMAIL); if (!StringHelper.isMatching(recoveryEmailAddress, REGEX_EMAIL)) { diff --git a/src/main/java/teammates/ui/automated/StudentCourseJoinEmailWorkerAction.java b/src/main/java/teammates/ui/webapi/StudentCourseJoinEmailWorkerAction.java similarity index 87% rename from src/main/java/teammates/ui/automated/StudentCourseJoinEmailWorkerAction.java rename to src/main/java/teammates/ui/webapi/StudentCourseJoinEmailWorkerAction.java index f95b6292d6d..829ea44767f 100644 --- a/src/main/java/teammates/ui/automated/StudentCourseJoinEmailWorkerAction.java +++ b/src/main/java/teammates/ui/webapi/StudentCourseJoinEmailWorkerAction.java @@ -1,4 +1,4 @@ -package teammates.ui.automated; +package teammates.ui.webapi; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; @@ -9,10 +9,10 @@ /** * Task queue worker action: sends registration email for a student of a course. */ -public class StudentCourseJoinEmailWorkerAction extends AutomatedAction { +class StudentCourseJoinEmailWorkerAction extends AdminOnlyAction { @Override - public void execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(ParamsNames.COURSE_ID); String studentEmail = getNonNullRequestParamValue(ParamsNames.STUDENT_EMAIL); boolean isRejoin = getBooleanRequestParamValue(ParamsNames.IS_STUDENT_REJOINING); @@ -27,6 +27,7 @@ public void execute() { ? emailGenerator.generateStudentCourseRejoinEmailAfterGoogleIdReset(course, student) : emailGenerator.generateStudentCourseJoinEmail(course, student); emailSender.sendEmail(email); + return new JsonResult("Successful"); } } diff --git a/src/main/java/teammates/ui/webapi/SubmitFeedbackResponsesAction.java b/src/main/java/teammates/ui/webapi/SubmitFeedbackResponsesAction.java new file mode 100644 index 00000000000..5c01cfed8aa --- /dev/null +++ b/src/main/java/teammates/ui/webapi/SubmitFeedbackResponsesAction.java @@ -0,0 +1,222 @@ +package teammates.ui.webapi; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import teammates.common.datatransfer.FeedbackParticipantType; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.datatransfer.questions.FeedbackResponseDetails; +import teammates.common.exception.EntityAlreadyExistsException; +import teammates.common.exception.EntityDoesNotExistException; +import teammates.common.exception.EntityNotFoundException; +import teammates.common.exception.InvalidHttpParameterException; +import teammates.common.exception.InvalidHttpRequestBodyException; +import teammates.common.exception.InvalidParametersException; +import teammates.common.exception.UnauthorizedAccessException; +import teammates.common.util.Const; +import teammates.ui.output.FeedbackResponsesData; +import teammates.ui.request.FeedbackResponsesRequest; +import teammates.ui.request.Intent; + +/** + * Submits a list of feedback responses to a feedback question. + * + *

    This action is meant to completely overwrite the feedback responses that are previously attached to the + * same feedback question. + */ +class SubmitFeedbackResponsesAction extends BasicFeedbackSubmissionAction { + + @Override + AuthType getMinAuthLevel() { + return AuthType.PUBLIC; + } + + @Override + void checkSpecificAccessControl() { + String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); + FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); + if (feedbackQuestion == null) { + throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback question does not exist.")); + } + FeedbackSessionAttributes feedbackSession = + getNonNullFeedbackSession(feedbackQuestion.feedbackSessionName, feedbackQuestion.courseId); + + verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion); + verifySessionOpenExceptForModeration(feedbackSession); + verifyNotPreview(); + + Map recipientsOfTheQuestion; + Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); + switch (intent) { + case STUDENT_SUBMISSION: + gateKeeper.verifyAnswerableForStudent(feedbackQuestion); + StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackQuestion.getCourseId()); + checkAccessControlForStudentFeedbackSubmission(studentAttributes, feedbackSession); + recipientsOfTheQuestion = logic.getRecipientsOfQuestion(feedbackQuestion, null, studentAttributes); + break; + case INSTRUCTOR_SUBMISSION: + gateKeeper.verifyAnswerableForInstructor(feedbackQuestion); + InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackQuestion.getCourseId()); + checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession); + recipientsOfTheQuestion = logic.getRecipientsOfQuestion(feedbackQuestion, instructorAttributes, null); + break; + case INSTRUCTOR_RESULT: + case STUDENT_RESULT: + throw new InvalidHttpParameterException("Invalid intent for this action"); + default: + throw new InvalidHttpParameterException("Unknown intent " + intent); + } + + FeedbackResponsesRequest submitRequest = getAndValidateRequestBody(FeedbackResponsesRequest.class); + + for (String recipient : submitRequest.getRecipients()) { + if (!recipientsOfTheQuestion.containsKey(recipient)) { + throw new UnauthorizedAccessException("The recipient is not a valid recipient of the question"); + } + } + } + + @Override + JsonResult execute() { + String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); + FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); + if (feedbackQuestion == null) { + throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback question does not exist.")); + } + + List existingResponses; + Map recipientsOfTheQuestion; + + String giverIdentifier; + String giverSection; + Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); + switch (intent) { + case STUDENT_SUBMISSION: + StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackQuestion.getCourseId()); + giverIdentifier = + feedbackQuestion.getGiverType() == FeedbackParticipantType.TEAMS + ? studentAttributes.getTeam() : studentAttributes.getEmail(); + giverSection = studentAttributes.getSection(); + existingResponses = logic.getFeedbackResponsesFromStudentOrTeamForQuestion(feedbackQuestion, studentAttributes); + recipientsOfTheQuestion = logic.getRecipientsOfQuestion(feedbackQuestion, null, studentAttributes); + logic.populateFieldsToGenerateInQuestion(feedbackQuestion, + studentAttributes.getEmail(), studentAttributes.getTeam()); + break; + case INSTRUCTOR_SUBMISSION: + InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackQuestion.getCourseId()); + giverIdentifier = instructorAttributes.getEmail(); + giverSection = Const.DEFAULT_SECTION; + existingResponses = logic.getFeedbackResponsesFromInstructorForQuestion(feedbackQuestion, instructorAttributes); + recipientsOfTheQuestion = logic.getRecipientsOfQuestion(feedbackQuestion, instructorAttributes, null); + logic.populateFieldsToGenerateInQuestion(feedbackQuestion, + instructorAttributes.getEmail(), null); + break; + default: + throw new InvalidHttpParameterException("Unknown intent " + intent); + } + + Map existingResponsesPerRecipient = new HashMap<>(); + existingResponses.forEach(response -> existingResponsesPerRecipient.put(response.getRecipient(), response)); + + List feedbackResponsesToValidate = new ArrayList<>(); + List feedbackResponsesToAdd = new ArrayList<>(); + List feedbackResponsesToUpdate = new ArrayList<>(); + + FeedbackResponsesRequest submitRequest = getAndValidateRequestBody(FeedbackResponsesRequest.class); + + submitRequest.getResponses().forEach(responseRequest -> { + String recipient = responseRequest.getRecipient(); + FeedbackResponseDetails responseDetails = responseRequest.getResponseDetails(); + + if (existingResponsesPerRecipient.containsKey(recipient)) { + String recipientSection = getRecipientSection(feedbackQuestion.getCourseId(), + feedbackQuestion.getGiverType(), + feedbackQuestion.getRecipientType(), recipient); + FeedbackResponseAttributes updatedResponse = + new FeedbackResponseAttributes(existingResponsesPerRecipient.get(recipient)); + FeedbackResponseAttributes.UpdateOptions updateOptions = + FeedbackResponseAttributes.updateOptionsBuilder(updatedResponse.getId()) + .withGiver(giverIdentifier) + .withGiverSection(giverSection) + .withRecipient(recipient) + .withRecipientSection(recipientSection) + .withResponseDetails(responseDetails) + .build(); + updatedResponse.update(updateOptions); + + feedbackResponsesToValidate.add(updatedResponse); + feedbackResponsesToUpdate.add(updateOptions); + } else { + FeedbackResponseAttributes feedbackResponse = FeedbackResponseAttributes + .builder(feedbackQuestion.getId(), giverIdentifier, recipient) + .withGiverSection(giverSection) + .withRecipientSection(getRecipientSection(feedbackQuestion.getCourseId(), + feedbackQuestion.getGiverType(), + feedbackQuestion.getRecipientType(), recipient)) + .withCourseId(feedbackQuestion.getCourseId()) + .withFeedbackSessionName(feedbackQuestion.getFeedbackSessionName()) + .withResponseDetails(responseDetails) + .build(); + + feedbackResponsesToValidate.add(feedbackResponse); + feedbackResponsesToAdd.add(feedbackResponse); + } + }); + + List responseDetails = feedbackResponsesToValidate.stream() + .map(FeedbackResponseAttributes::getResponseDetails) + .collect(Collectors.toList()); + + int numRecipients = feedbackQuestion.numberOfEntitiesToGiveFeedbackTo; + if (numRecipients == Const.MAX_POSSIBLE_RECIPIENTS + || numRecipients > recipientsOfTheQuestion.size()) { + numRecipients = recipientsOfTheQuestion.size(); + } + + List questionSpecificErrors = + feedbackQuestion.getQuestionDetails() + .validateResponsesDetails(responseDetails, numRecipients); + + if (!questionSpecificErrors.isEmpty()) { + throw new InvalidHttpRequestBodyException(questionSpecificErrors.toString()); + } + + List recipients = submitRequest.getRecipients(); + List feedbackResponsesToDelete = existingResponsesPerRecipient.entrySet().stream() + .filter(entry -> !recipients.contains(entry.getKey())) + .map(entry -> entry.getValue()) + .collect(Collectors.toList()); + + for (FeedbackResponseAttributes feedbackResponse : feedbackResponsesToDelete) { + logic.deleteFeedbackResponseCascade(feedbackResponse.getId()); + } + + List output = new ArrayList<>(); + + for (FeedbackResponseAttributes feedbackResponse : feedbackResponsesToAdd) { + try { + output.add(logic.createFeedbackResponse(feedbackResponse)); + } catch (InvalidParametersException | EntityAlreadyExistsException e) { + throw new InvalidHttpRequestBodyException(e.getMessage(), e); + } + } + + for (FeedbackResponseAttributes.UpdateOptions feedbackResponse : feedbackResponsesToUpdate) { + try { + output.add(logic.updateFeedbackResponseCascade(feedbackResponse)); + } catch (InvalidParametersException | EntityAlreadyExistsException | EntityDoesNotExistException e) { + throw new InvalidHttpRequestBodyException(e.getMessage(), e); + } + } + + return new JsonResult(new FeedbackResponsesData(output)); + } + +} diff --git a/src/main/java/teammates/ui/webapi/action/UnpublishFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/UnpublishFeedbackSessionAction.java similarity index 80% rename from src/main/java/teammates/ui/webapi/action/UnpublishFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/UnpublishFeedbackSessionAction.java index 9c1d05cd8eb..8d30f39064e 100644 --- a/src/main/java/teammates/ui/webapi/action/UnpublishFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/UnpublishFeedbackSessionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,32 +7,32 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionData; /** * Unpublish a feedback session. */ -public class UnpublishFeedbackSessionAction extends Action { +class UnpublishFeedbackSessionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); - FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); - gateKeeper.verifyAccessible(instructor, session, + gateKeeper.verifyAccessible(instructor, feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/webapi/action/UpdateCourseAction.java b/src/main/java/teammates/ui/webapi/UpdateCourseAction.java similarity index 88% rename from src/main/java/teammates/ui/webapi/action/UpdateCourseAction.java rename to src/main/java/teammates/ui/webapi/UpdateCourseAction.java index 656225a86a9..a8c4f9b20a1 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateCourseAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateCourseAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.time.ZoneId; @@ -12,21 +12,21 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.FieldValidator; -import teammates.ui.webapi.output.CourseData; -import teammates.ui.webapi.request.CourseUpdateRequest; +import teammates.ui.output.CourseData; +import teammates.ui.request.CourseUpdateRequest; /** * Updates a course. */ -public class UpdateCourseAction extends Action { +class UpdateCourseAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } @@ -38,7 +38,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { CourseUpdateRequest courseUpdateRequest = getAndValidateRequestBody(CourseUpdateRequest.class); String courseTimeZone = courseUpdateRequest.getTimeZone(); diff --git a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackQuestionAction.java b/src/main/java/teammates/ui/webapi/UpdateFeedbackQuestionAction.java similarity index 91% rename from src/main/java/teammates/ui/webapi/action/UpdateFeedbackQuestionAction.java rename to src/main/java/teammates/ui/webapi/UpdateFeedbackQuestionAction.java index 2ca8ce43d49..2bd9dfbbc57 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackQuestionAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateFeedbackQuestionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -12,21 +12,21 @@ import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackQuestionData; -import teammates.ui.webapi.request.FeedbackQuestionUpdateRequest; +import teammates.ui.output.FeedbackQuestionData; +import teammates.ui.request.FeedbackQuestionUpdateRequest; /** * Updates a feedback question. */ -public class UpdateFeedbackQuestionAction extends Action { +class UpdateFeedbackQuestionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes questionAttributes = logic.getFeedbackQuestion(feedbackQuestionId); @@ -35,12 +35,12 @@ public void checkSpecificAccessControl() { } gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(questionAttributes.getCourseId(), userInfo.getId()), - logic.getFeedbackSession(questionAttributes.getFeedbackSessionName(), questionAttributes.getCourseId()), + getNonNullFeedbackSession(questionAttributes.getFeedbackSessionName(), questionAttributes.getCourseId()), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } @Override - public ActionResult execute() { + JsonResult execute() { String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); FeedbackQuestionAttributes oldQuestion = logic.getFeedbackQuestion(feedbackQuestionId); diff --git a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackResponseCommentAction.java b/src/main/java/teammates/ui/webapi/UpdateFeedbackResponseCommentAction.java similarity index 93% rename from src/main/java/teammates/ui/webapi/action/UpdateFeedbackResponseCommentAction.java rename to src/main/java/teammates/ui/webapi/UpdateFeedbackResponseCommentAction.java index 8b3f5c33c7d..46c83e3805d 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackResponseCommentAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateFeedbackResponseCommentAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.time.Instant; import java.util.List; @@ -18,22 +18,22 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Assumption; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackResponseCommentData; -import teammates.ui.webapi.request.FeedbackResponseCommentUpdateRequest; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackResponseCommentData; +import teammates.ui.request.FeedbackResponseCommentUpdateRequest; +import teammates.ui.request.Intent; /** * Updates a feedback response comment. */ -public class UpdateFeedbackResponseCommentAction extends BasicCommentSubmissionAction { +class UpdateFeedbackResponseCommentAction extends BasicCommentSubmissionAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.PUBLIC; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { long feedbackResponseCommentId = getLongRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID); FeedbackResponseCommentAttributes frc = logic.getFeedbackResponseComment(feedbackResponseCommentId); @@ -46,7 +46,7 @@ public void checkSpecificAccessControl() { String feedbackResponseId = frc.feedbackResponseId; FeedbackResponseAttributes response = logic.getFeedbackResponse(feedbackResponseId); String feedbackSessionName = frc.feedbackSessionName; - FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes session = getNonNullFeedbackSession(feedbackSessionName, courseId); Assumption.assertNotNull(response); String questionId = response.getFeedbackQuestionId(); FeedbackQuestionAttributes question = logic.getFeedbackQuestion(questionId); @@ -96,7 +96,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { long feedbackResponseCommentId = getLongRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_COMMENT_ID); FeedbackResponseCommentAttributes frc = logic.getFeedbackResponseComment(feedbackResponseCommentId); diff --git a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackSessionAction.java b/src/main/java/teammates/ui/webapi/UpdateFeedbackSessionAction.java similarity index 84% rename from src/main/java/teammates/ui/webapi/action/UpdateFeedbackSessionAction.java rename to src/main/java/teammates/ui/webapi/UpdateFeedbackSessionAction.java index de46cd24c43..28d0f1cc8ab 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackSessionAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateFeedbackSessionAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,24 +7,24 @@ import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.request.FeedbackSessionUpdateRequest; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.request.FeedbackSessionUpdateRequest; /** * Updates a feedback session. */ -public class UpdateFeedbackSessionAction extends Action { +class UpdateFeedbackSessionAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); - FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); + FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.getId()), @@ -33,7 +33,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); diff --git a/src/main/java/teammates/ui/webapi/action/UpdateInstructorAction.java b/src/main/java/teammates/ui/webapi/UpdateInstructorAction.java similarity index 94% rename from src/main/java/teammates/ui/webapi/action/UpdateInstructorAction.java rename to src/main/java/teammates/ui/webapi/UpdateInstructorAction.java index 3071515aed4..702a8fd03c5 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateInstructorAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateInstructorAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; @@ -11,21 +11,21 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.SanitizationHelper; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.request.InstructorCreateRequest; +import teammates.ui.output.InstructorData; +import teammates.ui.request.InstructorCreateRequest; /** * Edits an instructor in a course. */ -public class UpdateInstructorAction extends UpdateInstructorPrivilegesAbstractAction { +class UpdateInstructorAction extends UpdateInstructorPrivilegesAbstractAction { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } @@ -38,7 +38,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorCreateRequest instructorRequest = getAndValidateRequestBody(InstructorCreateRequest.class); @@ -69,7 +69,9 @@ public ActionResult execute() { .withRole(instructorToEdit.role) .build()); } - return new JsonResult(new InstructorData(updatedInstructor)); + InstructorData newInstructorData = new InstructorData(updatedInstructor); + newInstructorData.setGoogleId(updatedInstructor.getGoogleId()); + return new JsonResult(newInstructorData); } catch (InvalidParametersException e) { return new JsonResult(e.getMessage(), HttpStatus.SC_BAD_REQUEST); } catch (EntityDoesNotExistException ednee) { diff --git a/src/main/java/teammates/ui/webapi/action/UpdateInstructorPrivilegeAction.java b/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegeAction.java similarity index 94% rename from src/main/java/teammates/ui/webapi/action/UpdateInstructorPrivilegeAction.java rename to src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegeAction.java index 0c100a467f2..7d1889c1df9 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateInstructorPrivilegeAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegeAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.List; import java.util.Map; @@ -9,21 +9,21 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.output.InstructorPrivilegeData; -import teammates.ui.webapi.request.InstructorPrivilegeUpdateRequest; +import teammates.ui.output.InstructorPrivilegeData; +import teammates.ui.request.InstructorPrivilegeUpdateRequest; /** * Update instructor privilege by instructors with instructor modify permission. */ -public class UpdateInstructorPrivilegeAction extends Action { +class UpdateInstructorPrivilegeAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); @@ -32,7 +32,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String emailOfInstructorToUpdate = getNonNullRequestParamValue(Const.ParamsNames.INSTRUCTOR_EMAIL); diff --git a/src/main/java/teammates/ui/webapi/action/UpdateInstructorPrivilegesAbstractAction.java b/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegesAbstractAction.java similarity index 99% rename from src/main/java/teammates/ui/webapi/action/UpdateInstructorPrivilegesAbstractAction.java rename to src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegesAbstractAction.java index a42fe5da7c2..996098fad0f 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateInstructorPrivilegesAbstractAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateInstructorPrivilegesAbstractAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.HashMap; @@ -13,7 +13,7 @@ /** * Abstract action: updates an instructor's privileges. */ -public abstract class UpdateInstructorPrivilegesAbstractAction extends Action { +abstract class UpdateInstructorPrivilegesAbstractAction extends Action { /** * Updates section and session level privileges for the instructor. diff --git a/src/main/java/teammates/ui/webapi/action/UpdateStudentAction.java b/src/main/java/teammates/ui/webapi/UpdateStudentAction.java similarity index 94% rename from src/main/java/teammates/ui/webapi/action/UpdateStudentAction.java rename to src/main/java/teammates/ui/webapi/UpdateStudentAction.java index 5e2381298ad..cc67ff13401 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateStudentAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateStudentAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.util.Arrays; @@ -15,23 +15,23 @@ import teammates.common.util.EmailSendingStatus; import teammates.common.util.EmailWrapper; import teammates.common.util.Templates; -import teammates.ui.webapi.request.StudentUpdateRequest; +import teammates.ui.request.StudentUpdateRequest; /** * Action: Edits details of a student in a course. */ -public class UpdateStudentAction extends Action { +class UpdateStudentAction extends Action { private static final String SUCCESSFUL_UPDATE = "Student has been updated"; private static final String SUCCESSFUL_UPDATE_WITH_EMAIL = SUCCESSFUL_UPDATE + " and email sent"; private static final String SUCCESSFUL_UPDATE_BUT_EMAIL_FAILED = SUCCESSFUL_UPDATE + " but email failed to send"; @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return authType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } @@ -43,7 +43,7 @@ public void checkSpecificAccessControl() { } @Override - public ActionResult execute() { + JsonResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String studentEmail = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); diff --git a/src/main/java/teammates/ui/webapi/action/UpdateStudentProfileAction.java b/src/main/java/teammates/ui/webapi/UpdateStudentProfileAction.java similarity index 92% rename from src/main/java/teammates/ui/webapi/action/UpdateStudentProfileAction.java rename to src/main/java/teammates/ui/webapi/UpdateStudentProfileAction.java index 82f300de4b7..56973816e2e 100644 --- a/src/main/java/teammates/ui/webapi/action/UpdateStudentProfileAction.java +++ b/src/main/java/teammates/ui/webapi/UpdateStudentProfileAction.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import org.apache.http.HttpStatus; @@ -7,27 +7,27 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.request.StudentProfileUpdateRequest; +import teammates.ui.request.StudentProfileUpdateRequest; /** * Update a student's profile. */ -public class UpdateStudentProfileAction extends Action { +class UpdateStudentProfileAction extends Action { @Override - protected AuthType getMinAuthLevel() { + AuthType getMinAuthLevel() { return AuthType.LOGGED_IN; } @Override - public void checkSpecificAccessControl() { + void checkSpecificAccessControl() { if (!userInfo.isStudent) { throw new UnauthorizedAccessException("Student privilege is required to access this resource."); } } @Override - public ActionResult execute() { + JsonResult execute() { String studentId = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_ID); if (!studentId.equals(userInfo.id) && !isMasqueradeMode()) { return new JsonResult("You are not authorized to update this student's profile.", diff --git a/src/main/java/teammates/ui/webapi/action/WebApiServlet.java b/src/main/java/teammates/ui/webapi/WebApiServlet.java similarity index 62% rename from src/main/java/teammates/ui/webapi/action/WebApiServlet.java rename to src/main/java/teammates/ui/webapi/WebApiServlet.java index 7a6ecca7b00..518e154a141 100644 --- a/src/main/java/teammates/ui/webapi/action/WebApiServlet.java +++ b/src/main/java/teammates/ui/webapi/WebApiServlet.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; @@ -63,11 +63,29 @@ private void invokeServlet(HttpServletRequest req, HttpServletResponse resp) thr resp.setHeader("Cache-Control", "no-store"); resp.setHeader("Pragma", "no-cache"); + String requestParametersAsString; + try { + // Make sure that all parameters are valid UTF-8 + requestParametersAsString = HttpRequestHelper.getRequestParametersAsString(req); + } catch (RuntimeException e) { + if (e.getClass().getSimpleName().equals("BadMessageException")) { + throwErrorBasedOnRequester(req, resp, e, HttpStatus.SC_BAD_REQUEST); + return; + } + throw e; + } + log.info("Request received: [" + req.getMethod() + "] " + req.getRequestURL().toString() - + ", Params: " + HttpRequestHelper.getRequestParametersAsString(req) + + ", Params: " + requestParametersAsString + ", Headers: " + HttpRequestHelper.getRequestHeadersAsString(req) + ", Request ID: " + Config.getRequestId()); + if (Config.MAINTENANCE) { + throwError(resp, HttpStatus.SC_SERVICE_UNAVAILABLE, + "The server is currently undergoing some maintenance."); + return; + } + try { Action action = new ActionFactory().getAction(req, req.getMethod()); action.checkAccessControl(); @@ -75,16 +93,16 @@ private void invokeServlet(HttpServletRequest req, HttpServletResponse resp) thr ActionResult result = action.execute(); result.send(resp); } catch (ActionMappingException e) { - throwError(resp, e.getStatusCode(), e.getMessage()); - } catch (InvalidHttpRequestBodyException e) { - throwError(resp, HttpStatus.SC_BAD_REQUEST, e.getMessage()); - } catch (InvalidHttpParameterException e) { - log.warning(e.getClass().getSimpleName() + " caught by WebApiServlet: " + e.getMessage()); - throwError(resp, HttpStatus.SC_BAD_REQUEST, "The request is not valid."); + throwErrorBasedOnRequester(req, resp, e, e.getStatusCode()); + } catch (InvalidHttpRequestBodyException | InvalidHttpParameterException e) { + throwErrorBasedOnRequester(req, resp, e, HttpStatus.SC_BAD_REQUEST); } catch (UnauthorizedAccessException uae) { - log.warning(uae.getClass().getSimpleName() + " caught by WebApiServlet: " + uae.getMessage()); + log.warning(uae.getClass().getSimpleName() + " caught by WebApiServlet: " + + TeammatesException.toStringWithStackTrace(uae)); throwError(resp, HttpStatus.SC_FORBIDDEN, "You are not authorized to access this resource."); } catch (EntityNotFoundException enfe) { + log.warning(enfe.getClass().getSimpleName() + " caught by WebApiServlet: " + + TeammatesException.toStringWithStackTrace(enfe)); throwError(resp, HttpStatus.SC_NOT_FOUND, enfe.getMessage()); } catch (DeadlineExceededException | DatastoreTimeoutException e) { @@ -104,6 +122,28 @@ private void invokeServlet(HttpServletRequest req, HttpServletResponse resp) thr } } + private void throwErrorBasedOnRequester(HttpServletRequest req, HttpServletResponse resp, Exception e, int statusCode) + throws IOException { + // The header X-AppEngine-QueueName cannot be spoofed as GAE will strip any user-sent X-AppEngine-QueueName headers. + // Reference: https://cloud.google.com/appengine/docs/standard/java/taskqueue/push/creating-handlers#reading_request_headers + boolean isRequestFromAppEngineQueue = req.getHeader("X-AppEngine-QueueName") != null; + + if (isRequestFromAppEngineQueue) { + log.severe(e.getClass().getSimpleName() + " caught by WebApiServlet: " + + TeammatesException.toStringWithStackTrace(e)); + + // Response status is not set to 4XX to 5XX to prevent GAE retry mechanism because + // if the cause of the exception is improper request URL, no amount of retry is going to help. + // The action will be inaccurately marked as "success", but the severe log can be used + // to trace the origin of the problem. + throwError(resp, HttpStatus.SC_ACCEPTED, e.getMessage()); + } else { + log.warning(e.getClass().getSimpleName() + " caught by WebApiServlet: " + + TeammatesException.toStringWithStackTrace(e)); + throwError(resp, statusCode, e.getMessage()); + } + } + private void throwError(HttpServletResponse resp, int statusCode, String message) throws IOException { JsonResult result = new JsonResult(message, statusCode); result.send(resp); diff --git a/src/main/java/teammates/ui/webapi/action/WebPageServlet.java b/src/main/java/teammates/ui/webapi/WebPageServlet.java similarity index 61% rename from src/main/java/teammates/ui/webapi/action/WebPageServlet.java rename to src/main/java/teammates/ui/webapi/WebPageServlet.java index a03e6b9b641..eb713d0c584 100644 --- a/src/main/java/teammates/ui/webapi/action/WebPageServlet.java +++ b/src/main/java/teammates/ui/webapi/WebPageServlet.java @@ -1,4 +1,4 @@ -package teammates.ui.webapi.action; +package teammates.ui.webapi; import java.io.IOException; import java.util.Arrays; @@ -8,19 +8,26 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.http.HttpStatus; + +import teammates.common.exception.TeammatesException; +import teammates.common.util.Logger; + /** * Servlet that handles the single web page. */ @SuppressWarnings("serial") public class WebPageServlet extends HttpServlet { + private static final Logger log = Logger.getLogger(); + private static final String CSP_POLICY = String.join("; ", Arrays.asList( "default-src 'none'", - "script-src 'self' https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/", - "style-src 'self' 'unsafe-inline'", + "script-src 'self' https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/ https://cdn.jsdelivr.net/", + "style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net/", "frame-src 'self' docs.google.com https://www.google.com/recaptcha/", "img-src 'self' data: http: https:", - "font-src 'self'", + "font-src 'self' https://cdn.jsdelivr.net/", "connect-src 'self'", "manifest-src 'self'", "form-action 'none'", @@ -35,7 +42,16 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws Servl resp.setHeader("X-Frame-Options", "SAMEORIGIN"); resp.setHeader("X-XSS-Protection", "1; mode=block"); resp.setHeader("Strict-Transport-Security", "max-age=31536000"); - req.getRequestDispatcher("/index.html").forward(req, resp); + try { + req.getRequestDispatcher("/index.html").forward(req, resp); + } catch (IllegalArgumentException e) { + if (e.getClass().getSimpleName().equals("NotUtf8Exception")) { + log.warning(TeammatesException.toStringWithStackTrace(e)); + resp.setStatus(HttpStatus.SC_BAD_REQUEST); + } else { + throw e; + } + } } } diff --git a/src/main/java/teammates/ui/webapi/action/CreateFeedbackResponseAction.java b/src/main/java/teammates/ui/webapi/action/CreateFeedbackResponseAction.java deleted file mode 100644 index bc701c14465..00000000000 --- a/src/main/java/teammates/ui/webapi/action/CreateFeedbackResponseAction.java +++ /dev/null @@ -1,122 +0,0 @@ -package teammates.ui.webapi.action; - -import java.util.Map; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.exception.EntityAlreadyExistsException; -import teammates.common.exception.EntityDoesNotExistException; -import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.InvalidHttpRequestBodyException; -import teammates.common.exception.InvalidParametersException; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackResponseData; -import teammates.ui.webapi.request.FeedbackResponseCreateRequest; -import teammates.ui.webapi.request.Intent; - -/** - * Create a feedback response. - */ -public class CreateFeedbackResponseAction extends BasicFeedbackSubmissionAction { - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.PUBLIC; - } - - @Override - public void checkSpecificAccessControl() { - String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); - FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); - if (feedbackQuestion == null) { - throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback question does not exist.")); - } - FeedbackSessionAttributes feedbackSession = - logic.getFeedbackSession(feedbackQuestion.getFeedbackSessionName(), feedbackQuestion.getCourseId()); - - verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion); - verifySessionOpenExceptForModeration(feedbackSession); - verifyNotPreview(); - - Map recipientsOfTheQuestion; - Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); - switch (intent) { - case STUDENT_SUBMISSION: - gateKeeper.verifyAnswerableForStudent(feedbackQuestion); - StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackQuestion.getCourseId()); - recipientsOfTheQuestion = logic.getRecipientsOfQuestion(feedbackQuestion, null, studentAttributes); - break; - case INSTRUCTOR_SUBMISSION: - gateKeeper.verifyAnswerableForInstructor(feedbackQuestion); - InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackQuestion.getCourseId()); - recipientsOfTheQuestion = logic.getRecipientsOfQuestion(feedbackQuestion, instructorAttributes, null); - break; - default: - throw new InvalidHttpParameterException("Unknown intent " + intent); - } - - FeedbackResponseCreateRequest createRequest = getAndValidateRequestBody(FeedbackResponseCreateRequest.class); - if (!recipientsOfTheQuestion.containsKey(createRequest.getRecipientIdentifier())) { - throw new UnauthorizedAccessException("The recipient is not a valid recipient of the question"); - } - } - - @Override - public ActionResult execute() { - Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); - String feedbackQuestionId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_QUESTION_ID); - FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackQuestionId); - - String giverIdentifier; - String giverSection; - switch (intent) { - case STUDENT_SUBMISSION: - StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackQuestion.getCourseId()); - giverIdentifier = feedbackQuestion.getGiverType() == FeedbackParticipantType.TEAMS - ? studentAttributes.getTeam() : studentAttributes.getEmail(); - giverSection = studentAttributes.getSection(); - logic.populateFieldsToGenerateInQuestion(feedbackQuestion, - studentAttributes.getEmail(), studentAttributes.getTeam()); - break; - case INSTRUCTOR_SUBMISSION: - InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackQuestion.getCourseId()); - giverIdentifier = instructorAttributes.getEmail(); - giverSection = Const.DEFAULT_SECTION; - logic.populateFieldsToGenerateInQuestion(feedbackQuestion, - instructorAttributes.getEmail(), null); - break; - default: - throw new InvalidHttpParameterException("Unknown intent " + intent); - } - - FeedbackResponseCreateRequest createRequest = getAndValidateRequestBody(FeedbackResponseCreateRequest.class); - FeedbackResponseAttributes feedbackResponse = - FeedbackResponseAttributes - .builder(feedbackQuestion.getId(), giverIdentifier, createRequest.getRecipientIdentifier()) - .withGiverSection(giverSection) - .withRecipientSection(getRecipientSection(feedbackQuestion.getCourseId(), feedbackQuestion.getGiverType(), - feedbackQuestion.getRecipientType(), createRequest.getRecipientIdentifier())) - .withCourseId(feedbackQuestion.getCourseId()) - .withFeedbackSessionName(feedbackQuestion.getFeedbackSessionName()) - .withResponseDetails(createRequest.getResponseDetails()) - .build(); - - validResponseOfQuestion(feedbackQuestion, feedbackResponse); - try { - logic.createFeedbackResponse(feedbackResponse); - } catch (InvalidParametersException | EntityAlreadyExistsException e) { - throw new InvalidHttpRequestBodyException(e.getMessage(), e); - } - - FeedbackResponseAttributes createdFeedbackResponse = logic.getFeedbackResponse( - feedbackQuestion.getId() + "%" + feedbackResponse.giver + "%" + feedbackResponse.recipient); - return new JsonResult(new FeedbackResponseData(createdFeedbackResponse)); - } - -} diff --git a/src/main/java/teammates/ui/webapi/action/DeleteAccountAction.java b/src/main/java/teammates/ui/webapi/action/DeleteAccountAction.java deleted file mode 100644 index 4cc60efd845..00000000000 --- a/src/main/java/teammates/ui/webapi/action/DeleteAccountAction.java +++ /dev/null @@ -1,33 +0,0 @@ -package teammates.ui.webapi.action; - -import org.apache.http.HttpStatus; - -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; - -/** - * Action: deletes an existing account (either student or instructor). - */ -public class DeleteAccountAction extends Action { - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - // Only admins can delete accounts - if (!userInfo.isAdmin) { - throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); - } - } - - @Override - public ActionResult execute() { - String instructorId = getNonNullRequestParamValue(Const.ParamsNames.INSTRUCTOR_ID); - logic.deleteAccountCascade(instructorId); - return new JsonResult("Account is successfully deleted.", HttpStatus.SC_OK); - } - -} diff --git a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackResponseAction.java b/src/main/java/teammates/ui/webapi/action/DeleteFeedbackResponseAction.java deleted file mode 100644 index 91722548603..00000000000 --- a/src/main/java/teammates/ui/webapi/action/DeleteFeedbackResponseAction.java +++ /dev/null @@ -1,87 +0,0 @@ -package teammates.ui.webapi.action; - -import java.util.List; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.exception.EntityDoesNotExistException; -import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.ui.webapi.request.Intent; - -/** - * Delete a feedback response. - */ -public class DeleteFeedbackResponseAction extends BasicFeedbackSubmissionAction { - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.PUBLIC; - } - - @Override - public void checkSpecificAccessControl() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); - FeedbackResponseAttributes feedbackResponse = logic.getFeedbackResponse(feedbackResponseId); - if (feedbackResponse == null) { - throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback response does not exist.")); - } - FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackResponse.feedbackQuestionId); - FeedbackSessionAttributes feedbackSession = - logic.getFeedbackSession(feedbackResponse.feedbackSessionName, feedbackResponse.courseId); - - verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion); - verifySessionOpenExceptForModeration(feedbackSession); - verifyNotPreview(); - - // verify user is the giver of the response - Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); - switch (intent) { - case STUDENT_SUBMISSION: - gateKeeper.verifyAnswerableForStudent(feedbackQuestion); - StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackQuestion.getCourseId()); - if (feedbackQuestion.getGiverType() == FeedbackParticipantType.TEAMS) { - if (!studentAttributes.getTeam().equals(feedbackResponse.giver)) { - List teamMember = - logic.getStudentsForTeam(studentAttributes.getTeam(), studentAttributes.getCourse()); - boolean isTeamMemberGiven = - teamMember.stream().anyMatch(student -> student.getEmail().equals(feedbackResponse.giver)); - if (!isTeamMemberGiven) { - throw new UnauthorizedAccessException("You are not the authenticated team member of the response"); - } - } - } else { - if (!studentAttributes.getEmail().equals(feedbackResponse.giver)) { - throw new UnauthorizedAccessException("You are not the authenticated giver of the response"); - } - } - break; - case INSTRUCTOR_SUBMISSION: - gateKeeper.verifyAnswerableForInstructor(feedbackQuestion); - InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackQuestion.getCourseId()); - if (!instructorAttributes.getEmail().equals(feedbackResponse.giver)) { - throw new UnauthorizedAccessException("You are not the authenticated giver of the response"); - } - break; - default: - throw new InvalidHttpParameterException("Unknown intent " + intent); - } - } - - @Override - public ActionResult execute() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); - FeedbackResponseAttributes feedbackResponse = logic.getFeedbackResponse(feedbackResponseId); - - logic.deleteFeedbackResponseCascade(feedbackResponse.getId()); - - return new JsonResult("Feedback response deleted"); - } - -} diff --git a/src/main/java/teammates/ui/webapi/action/GetCoursesAction.java b/src/main/java/teammates/ui/webapi/action/GetCoursesAction.java deleted file mode 100644 index a01706bc674..00000000000 --- a/src/main/java/teammates/ui/webapi/action/GetCoursesAction.java +++ /dev/null @@ -1,96 +0,0 @@ -package teammates.ui.webapi.action; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.http.HttpStatus; - -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.ui.webapi.output.CoursesData; - -/** - * Gets all courses for the instructor, and filtered by active, archived and soft-deleted. - * Or gets all courses for the student he belongs to. - */ -public class GetCoursesAction extends Action { - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); - - if (!((entityType.equals(Const.EntityType.STUDENT) && userInfo.isStudent) - || (entityType.equals(Const.EntityType.INSTRUCTOR) && userInfo.isInstructor))) { - throw new UnauthorizedAccessException("Current account cannot access to courses of request entity type"); - } - } - - @Override - public ActionResult execute() { - String entityType = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); - switch (entityType) { - case Const.EntityType.STUDENT: - return getStudentCourses(); - case Const.EntityType.INSTRUCTOR: - return getInstructorCourses(); - default: - return new JsonResult("Error: invalid entity type", HttpStatus.SC_BAD_REQUEST); - - } - } - - private ActionResult getStudentCourses() { - List courses = logic.getCoursesForStudentAccount(userInfo.id); - return new JsonResult(new CoursesData(courses)); - } - - private ActionResult getInstructorCourses() { - String courseStatus = getNonNullRequestParamValue(Const.ParamsNames.COURSE_STATUS); - List courses; - switch (courseStatus) { - case Const.CourseStatus.ACTIVE: - courses = getActiveCourse(); - break; - case Const.CourseStatus.ARCHIVED: - courses = getArchivedCourse(); - break; - case Const.CourseStatus.SOFT_DELETED: - courses = getSoftDeletedCourse(); - break; - default: - return new JsonResult("Error: invalid course status", HttpStatus.SC_BAD_REQUEST); - } - - CourseAttributes.sortById(courses); - return new JsonResult(new CoursesData(courses)); - - } - - private List getActiveCourse() { - return logic.getCoursesForInstructor(userInfo.id, true); - } - - private List getArchivedCourse() { - - List allInstructors = logic.getInstructorsForGoogleId(userInfo.id, false); - List archivedInstructors = new ArrayList<>(); - for (InstructorAttributes instructor : allInstructors) { - if (instructor.isArchived) { - archivedInstructors.add(instructor); - } - } - - return logic.getCoursesForInstructor(archivedInstructors); - } - - private List getSoftDeletedCourse() { - return logic.getSoftDeletedCoursesForInstructors(logic.getInstructorsForGoogleId(userInfo.id)); - } -} diff --git a/src/main/java/teammates/ui/webapi/action/ImageResult.java b/src/main/java/teammates/ui/webapi/action/ImageResult.java deleted file mode 100644 index 2a1a3428fbb..00000000000 --- a/src/main/java/teammates/ui/webapi/action/ImageResult.java +++ /dev/null @@ -1,30 +0,0 @@ -package teammates.ui.webapi.action; - -import java.io.IOException; - -import javax.servlet.http.HttpServletResponse; - -import org.apache.http.HttpStatus; - -import teammates.common.util.GoogleCloudStorageHelper; - -/** - * Action result in form of an image. - */ -public class ImageResult extends ActionResult { - - /** The blob key for the image. */ - public String blobKey; - - public ImageResult(String blobKey) { - super(HttpStatus.SC_OK); - this.blobKey = blobKey; - } - - @Override - public void send(HttpServletResponse resp) throws IOException { - resp.setContentType("image/png"); - GoogleCloudStorageHelper.serve(resp, blobKey); - } - -} diff --git a/src/main/java/teammates/ui/webapi/action/InstructorGetCoursesAction.java b/src/main/java/teammates/ui/webapi/action/InstructorGetCoursesAction.java deleted file mode 100644 index 456d442bd16..00000000000 --- a/src/main/java/teammates/ui/webapi/action/InstructorGetCoursesAction.java +++ /dev/null @@ -1,133 +0,0 @@ -package teammates.ui.webapi.action; - -import java.util.ArrayList; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.ui.webapi.output.ApiOutput; - -/** - * Action: for an instructor to get his/her list of courses. - */ -public class InstructorGetCoursesAction extends Action { - // TODO: Write tests - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - if (!userInfo.isInstructor) { - throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); - } - } - - @Override - public ActionResult execute() { - - Map courseInstructor = new HashMap<>(); - - List courses = logic.getCoursesForInstructor(userInfo.id); - - List instructorList = logic.getInstructorsForGoogleId(userInfo.id); - for (InstructorAttributes instructor : instructorList) { - courseInstructor.put(instructor.courseId, instructor); - } - - List coursesToDisplay = new ArrayList<>(); - for (CourseAttributes course : courses) { - InstructorAttributes instructor = courseInstructor.get(course.getId()); - boolean isInstructorAllowedToModify = instructor.isAllowedForPrivilege( - Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); - - coursesToDisplay.add(new CourseDetails( - course.getId(), course.getName(), instructor.isArchived, isInstructorAllowedToModify)); - } - - InstructorGetCoursesResult result = new InstructorGetCoursesResult(coursesToDisplay); - - return new JsonResult(result); - } - - /** - * A data model containing details of a course for some instructor. - */ - public static class CourseDetails { - - private final String id; - private final String name; - private final boolean isArchived; - private final boolean isInstructorAllowedToModify; - - public CourseDetails(String id, String name, boolean isArchived, boolean isInstructorAllowedToModify) { - this.id = id; - this.name = name; - this.isArchived = isArchived; - this.isInstructorAllowedToModify = isInstructorAllowedToModify; - } - - public String getId() { - return id; - } - - public String getName() { - return name; - } - - public boolean isArchived() { - return isArchived; - } - - public boolean isInstructorAllowedToModify() { - return isInstructorAllowedToModify; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CourseDetails that = (CourseDetails) o; - return isArchived == that.isArchived - && isInstructorAllowedToModify == that.isInstructorAllowedToModify - && Objects.equals(id, that.id) - && Objects.equals(name, that.name); - } - - @Override - public int hashCode() { - - return Objects.hash(id, name, isArchived, isInstructorAllowedToModify); - } - } - - /** - * Output format for {@link InstructorGetCoursesAction}. - */ - public static class InstructorGetCoursesResult extends ApiOutput { - - private final List courses; - - public InstructorGetCoursesResult(List courses) { - this.courses = courses; - - this.courses.sort(Comparator.comparing(CourseDetails::getId)); - } - - public List getCourses() { - return courses; - } - } -} diff --git a/src/main/java/teammates/ui/webapi/action/InstructorInfo.java b/src/main/java/teammates/ui/webapi/action/InstructorInfo.java deleted file mode 100644 index 3bfb956fcdb..00000000000 --- a/src/main/java/teammates/ui/webapi/action/InstructorInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -package teammates.ui.webapi.action; - -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.ui.webapi.output.ApiOutput; - -/** - * Data transfer objects for {@link InstructorAttributes} between controller and HTTP. - */ -public class InstructorInfo { - - /** - * The response for an instructor attribute. - */ - public static class InstructorResponse extends ApiOutput { - - private final String name; - - public InstructorResponse(InstructorAttributes instructorAttributes) { - this.name = instructorAttributes.getName(); - } - - public String getName() { - return name; - } - } - -} diff --git a/src/main/java/teammates/ui/webapi/action/StudentGetCourseDetailsAction.java b/src/main/java/teammates/ui/webapi/action/StudentGetCourseDetailsAction.java deleted file mode 100644 index 16b4f73874a..00000000000 --- a/src/main/java/teammates/ui/webapi/action/StudentGetCourseDetailsAction.java +++ /dev/null @@ -1,179 +0,0 @@ -package teammates.ui.webapi.action; - -import java.util.LinkedList; -import java.util.List; -import java.util.Objects; - -import org.apache.http.HttpStatus; - -import teammates.common.datatransfer.TeamDetailsBundle; -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.datatransfer.attributes.StudentProfileAttributes; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.ui.webapi.output.ApiOutput; - -/** - * Action: for student to get his/her own details in the course given. - */ -public class StudentGetCourseDetailsAction extends Action { - // TODO: Write tests - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.LOGGED_IN; - } - - @Override - public void checkSpecificAccessControl() { - if (!userInfo.isStudent) { - throw new UnauthorizedAccessException("An student account is required to access this resource."); - } - - String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); - - if (!hasStudentJoinedCourse(courseId)) { - throw new UnauthorizedAccessException("The student is yet to join the course."); - } - - CourseAttributes course = logic.getCourse(courseId); - gateKeeper.verifyAccessible(logic.getStudentForGoogleId(courseId, userInfo.id), course); - - } - - @Override - public ActionResult execute() { - - String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); - - StudentAttributes student = logic.getStudentForGoogleId(courseId, userInfo.id); - if (student == null) { - return new JsonResult(String.format("Student with id (%s) cannot be found.", userInfo.id), - HttpStatus.SC_NOT_FOUND); - } - student.lastName = null; - student.comments = null; - student.key = null; - - List instructors = logic.getInstructorsForCourse(courseId); - List instructorDetails = new LinkedList<>(); - instructors.forEach( - instructor -> { - if (instructor.isDisplayedToStudents()) { - instructorDetails.add( - new InstructorDetails(instructor.getDisplayedName(), instructor.getEmail())); - } - }); - - TeamDetailsBundle teamDetails = logic.getTeamDetailsForStudent(student); - if (teamDetails == null) { - return new JsonResult(String.format("Team for the student with id (%s) cannot be found.", userInfo.id), - HttpStatus.SC_NOT_FOUND); - } - - List teammateProfiles = new LinkedList<>(); - if (teamDetails.students != null) { - teamDetails.students.removeIf(st -> st.googleId.equals(userInfo.id)); - - teamDetails.students.forEach(teammate -> { - StudentProfileAttributes teammateProfile = logic.getStudentProfile(teammate.googleId); - if (teammateProfile != null) { - teammateProfile.googleId = null; - teammateProfile.modifiedDate = null; - - teammateProfiles.add(teammateProfile); - } - }); - } - - StudentGetCourseDetailsResult result = new StudentGetCourseDetailsResult( - student, logic.getCourse(courseId), instructorDetails, teammateProfiles); - - return new JsonResult(result); - } - - private boolean hasStudentJoinedCourse(String courseId) { - if (userInfo != null && userInfo.isStudent) { - return logic.getStudentForGoogleId(courseId, userInfo.id) != null; - } - return false; - } - - /** - * A data model to contain details of an instructor. - */ - public static class InstructorDetails { - - private final String name; - private final String email; - - public InstructorDetails(String name, String email) { - this.name = name; - this.email = email; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - InstructorDetails that = (InstructorDetails) o; - return Objects.equals(name, that.name) - && Objects.equals(email, that.email); - } - - @Override - public int hashCode() { - return Objects.hash(name, email); - } - } - - /** - * Output format for {@link StudentGetCourseDetailsAction}. - */ - public static class StudentGetCourseDetailsResult extends ApiOutput { - - private final StudentAttributes student; - private final CourseAttributes course; - private final List instructorDetails; - private final List teammateProfiles; - - public StudentGetCourseDetailsResult(StudentAttributes student, CourseAttributes course, - List instructorDetails, - List teammateProfiles) { - this.student = student; - this.course = course; - this.instructorDetails = instructorDetails; - this.teammateProfiles = teammateProfiles; - } - - public StudentAttributes getStudent() { - return student; - } - - public CourseAttributes getCourse() { - return course; - } - - public List getInstructorDetails() { - return instructorDetails; - } - - public List getTeammateProfiles() { - return teammateProfiles; - } - } -} diff --git a/src/main/java/teammates/ui/webapi/action/StudentInfo.java b/src/main/java/teammates/ui/webapi/action/StudentInfo.java deleted file mode 100644 index 90c96ef3eb3..00000000000 --- a/src/main/java/teammates/ui/webapi/action/StudentInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package teammates.ui.webapi.action; - -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.ui.webapi.output.ApiOutput; - -/** - * Data transfer objects for {@link StudentAttributes} between controller and HTTP. - */ -public class StudentInfo { - - /** - * The response for a student attribute. - */ - public static class StudentResponse extends ApiOutput { - - private final String name; - private final String lastName; - - public StudentResponse(StudentAttributes studentAttributes) { - this.name = studentAttributes.getName(); - this.lastName = studentAttributes.getLastName(); - } - - public String getName() { - return name; - } - - public String getLastName() { - return lastName; - } - } - -} diff --git a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackResponseAction.java b/src/main/java/teammates/ui/webapi/action/UpdateFeedbackResponseAction.java deleted file mode 100644 index 45bf13fb303..00000000000 --- a/src/main/java/teammates/ui/webapi/action/UpdateFeedbackResponseAction.java +++ /dev/null @@ -1,133 +0,0 @@ -package teammates.ui.webapi.action; - -import java.util.Map; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.exception.EntityDoesNotExistException; -import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.InvalidHttpRequestBodyException; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.ui.webapi.output.FeedbackResponseData; -import teammates.ui.webapi.request.FeedbackResponseUpdateRequest; -import teammates.ui.webapi.request.Intent; - -/** - * Updates a feedback response. - */ -public class UpdateFeedbackResponseAction extends BasicFeedbackSubmissionAction { - - @Override - protected AuthType getMinAuthLevel() { - return AuthType.PUBLIC; - } - - @Override - public void checkSpecificAccessControl() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); - FeedbackResponseAttributes feedbackResponse = logic.getFeedbackResponse(feedbackResponseId); - if (feedbackResponse == null) { - throw new EntityNotFoundException(new EntityDoesNotExistException("The feedback response does not exist.")); - } - FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackResponse.feedbackQuestionId); - FeedbackSessionAttributes feedbackSession = - logic.getFeedbackSession(feedbackResponse.feedbackSessionName, feedbackResponse.courseId); - - verifyInstructorCanSeeQuestionIfInModeration(feedbackQuestion); - verifySessionOpenExceptForModeration(feedbackSession); - verifyNotPreview(); - - Map recipientsOfTheQuestion; - Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); - switch (intent) { - case STUDENT_SUBMISSION: - gateKeeper.verifyAnswerableForStudent(feedbackQuestion); - StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackQuestion.getCourseId()); - checkAccessControlForStudentFeedbackSubmission(studentAttributes, feedbackSession); - recipientsOfTheQuestion = - logic.getRecipientsOfQuestion(feedbackQuestion, null, studentAttributes); - break; - case INSTRUCTOR_SUBMISSION: - gateKeeper.verifyAnswerableForInstructor(feedbackQuestion); - InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackQuestion.getCourseId()); - checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession); - recipientsOfTheQuestion = - logic.getRecipientsOfQuestion(feedbackQuestion, instructorAttributes, null); - break; - case INSTRUCTOR_RESULT: - case STUDENT_RESULT: - throw new InvalidHttpParameterException("Invalid intent for this action"); - default: - throw new InvalidHttpParameterException("Unknown intent " + intent); - } - - FeedbackResponseUpdateRequest updateRequest = getAndValidateRequestBody(FeedbackResponseUpdateRequest.class); - if (!recipientsOfTheQuestion.containsKey(updateRequest.getRecipientIdentifier())) { - throw new UnauthorizedAccessException("The recipient is not a valid recipient of the question"); - } - } - - @Override - public ActionResult execute() { - String feedbackResponseId = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_RESPONSE_ID); - FeedbackResponseAttributes feedbackResponse = logic.getFeedbackResponse(feedbackResponseId); - FeedbackQuestionAttributes feedbackQuestion = logic.getFeedbackQuestion(feedbackResponse.feedbackQuestionId); - - String giverIdentifier; - String giverSection; - Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); - switch (intent) { - case STUDENT_SUBMISSION: - StudentAttributes studentAttributes = getStudentOfCourseFromRequest(feedbackQuestion.getCourseId()); - giverIdentifier = - feedbackQuestion.getGiverType() == FeedbackParticipantType.TEAMS - ? studentAttributes.getTeam() : studentAttributes.getEmail(); - giverSection = studentAttributes.getSection(); - logic.populateFieldsToGenerateInQuestion(feedbackQuestion, - studentAttributes.getEmail(), studentAttributes.getTeam()); - break; - case INSTRUCTOR_SUBMISSION: - InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(feedbackQuestion.getCourseId()); - giverIdentifier = instructorAttributes.getEmail(); - giverSection = Const.DEFAULT_SECTION; - logic.populateFieldsToGenerateInQuestion(feedbackQuestion, - instructorAttributes.getEmail(), null); - break; - default: - throw new InvalidHttpParameterException("Unknown intent " + intent); - } - - FeedbackResponseUpdateRequest updateRequest = getAndValidateRequestBody(FeedbackResponseUpdateRequest.class); - feedbackResponse.giver = giverIdentifier; - feedbackResponse.giverSection = giverSection; - feedbackResponse.recipient = updateRequest.getRecipientIdentifier(); - feedbackResponse.recipientSection = - getRecipientSection(feedbackQuestion.getCourseId(), feedbackQuestion.getGiverType(), - feedbackQuestion.getRecipientType(), updateRequest.getRecipientIdentifier()); - feedbackResponse.responseDetails = updateRequest.getResponseDetails(); - - validResponseOfQuestion(feedbackQuestion, feedbackResponse); - - try { - FeedbackResponseAttributes updatedFeedbackResponse = logic.updateFeedbackResponseCascade( - FeedbackResponseAttributes.updateOptionsBuilder(feedbackResponse.getId()) - .withGiver(feedbackResponse.giver) - .withGiverSection(feedbackResponse.giverSection) - .withRecipient(feedbackResponse.recipient) - .withRecipientSection(feedbackResponse.recipientSection) - .withResponseDetails(feedbackResponse.getResponseDetails()) - .build()); - - return new JsonResult(new FeedbackResponseData(updatedFeedbackResponse)); - } catch (Exception e) { - throw new InvalidHttpRequestBodyException(e.getMessage(), e); - } - } - -} diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionStudentResponseData.java b/src/main/java/teammates/ui/webapi/output/FeedbackSessionStudentResponseData.java deleted file mode 100644 index fa603cd4a3d..00000000000 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionStudentResponseData.java +++ /dev/null @@ -1,42 +0,0 @@ -package teammates.ui.webapi.output; - -/** - * The API output format of feedback session student response status. - */ -public class FeedbackSessionStudentResponseData extends ApiOutput { - private final String email; - private final String name; - private final String sectionName; - private final String teamName; - private final boolean responseStatus; - - FeedbackSessionStudentResponseData(String email, String name, String sectionName, String teamName, - boolean responseStatus) { - this.email = email; - this.name = name; - this.sectionName = sectionName; - this.teamName = teamName; - this.responseStatus = responseStatus; - } - - public String getName() { - return name; - } - - public String getEmail() { - return email; - } - - public String getSectionName() { - return sectionName; - } - - public String getTeamName() { - return teamName; - } - - public boolean getResponseStatus() { - return responseStatus; - } - -} diff --git a/src/main/java/teammates/ui/webapi/output/FeedbackSessionStudentsResponseData.java b/src/main/java/teammates/ui/webapi/output/FeedbackSessionStudentsResponseData.java deleted file mode 100644 index a3a8d736b7d..00000000000 --- a/src/main/java/teammates/ui/webapi/output/FeedbackSessionStudentsResponseData.java +++ /dev/null @@ -1,36 +0,0 @@ -package teammates.ui.webapi.output; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import teammates.common.datatransfer.FeedbackSessionResponseStatus; - -/** - * The API output format of a list of {@link FeedbackSessionResponseStatus}. - */ -public class FeedbackSessionStudentsResponseData extends ApiOutput { - - private List studentsResponse; - - public FeedbackSessionStudentsResponseData(FeedbackSessionResponseStatus responseStatus) { - studentsResponse = new ArrayList<>(); - - Map allStudentsResponse = responseStatus.studentsWhoResponded.stream() - .collect(Collectors.toMap(studentEmail -> studentEmail, response -> true)); - allStudentsResponse.putAll(responseStatus.studentsWhoDidNotRespond.stream() - .collect(Collectors.toMap(studentEmail -> studentEmail, response -> false))); - - allStudentsResponse.forEach((studentEmail, response) -> { - studentsResponse.add(new FeedbackSessionStudentResponseData( - studentEmail, responseStatus.emailNameTable.get(studentEmail), - responseStatus.emailSectionTable.get(studentEmail), - responseStatus.emailTeamNameTable.get(studentEmail), response)); - }); - } - - public List getStudentsResponse() { - return studentsResponse; - } -} diff --git a/src/main/java/teammates/ui/webapi/output/RegkeyValidityData.java b/src/main/java/teammates/ui/webapi/output/RegkeyValidityData.java deleted file mode 100644 index 022f0afc41f..00000000000 --- a/src/main/java/teammates/ui/webapi/output/RegkeyValidityData.java +++ /dev/null @@ -1,20 +0,0 @@ -package teammates.ui.webapi.output; - -/** - * The API output format to represent if the registration key is valid for the logged in user (or lack thereof). - */ -public class RegkeyValidityData extends ApiOutput { - private final boolean isValid; - - public RegkeyValidityData(boolean isValid) { - this.isValid = isValid; - } - - /** - * Returns true if the registration key is valid, false otherwise. - */ - public boolean isValid() { - return isValid; - } - -} diff --git a/src/main/java/teammates/ui/webapi/action/package-info.java b/src/main/java/teammates/ui/webapi/package-info.java similarity index 67% rename from src/main/java/teammates/ui/webapi/action/package-info.java rename to src/main/java/teammates/ui/webapi/package-info.java index 05b52251045..0b77ddbedec 100644 --- a/src/main/java/teammates/ui/webapi/action/package-info.java +++ b/src/main/java/teammates/ui/webapi/package-info.java @@ -1,4 +1,4 @@ /** * Contains servlets and action classes for user-invoked actions. */ -package teammates.ui.webapi.action; +package teammates.ui.webapi; diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackResponseBasicRequest.java b/src/main/java/teammates/ui/webapi/request/FeedbackResponseBasicRequest.java deleted file mode 100644 index 460cb216e9a..00000000000 --- a/src/main/java/teammates/ui/webapi/request/FeedbackResponseBasicRequest.java +++ /dev/null @@ -1,64 +0,0 @@ -package teammates.ui.webapi.request; - -import java.util.Map; - -import teammates.common.datatransfer.questions.FeedbackQuestionType; -import teammates.common.datatransfer.questions.FeedbackResponseDetails; -import teammates.common.util.JsonUtils; - -/** - * The basic request of modifying a feedback response. - */ -public class FeedbackResponseBasicRequest extends BasicRequest { - - private String recipientIdentifier; - - private FeedbackQuestionType questionType; - - private Map responseDetails; - - public String getRecipientIdentifier() { - return recipientIdentifier; - } - - /** - * Gets the question type of the response. - */ - public FeedbackQuestionType getQuestionType() { - // TODO remove this after migrate CONSTSUM to either CONSTSUM_OPTIONS or CONSTSUM_RECIPIENTS - if (questionType == FeedbackQuestionType.CONSTSUM_OPTIONS - || questionType == FeedbackQuestionType.CONSTSUM_RECIPIENTS) { - return FeedbackQuestionType.CONSTSUM; - } - return questionType; - } - - /** - * Get the feedback response details in the request. - */ - public FeedbackResponseDetails getResponseDetails() { - FeedbackResponseDetails details = - JsonUtils.fromJson(JsonUtils.toJson(responseDetails), getQuestionType().getResponseDetailsClass()); - details.setQuestionType(getQuestionType()); - return details; - } - - public void setRecipientIdentifier(String recipientIdentifier) { - this.recipientIdentifier = recipientIdentifier; - } - - public void setQuestionType(FeedbackQuestionType feedbackQuestionType) { - this.questionType = feedbackQuestionType; - } - - public void setResponseDetails(FeedbackResponseDetails feedbackResponseDetails) { - this.responseDetails = JsonUtils.fromJson(JsonUtils.toJson(feedbackResponseDetails), Map.class); - } - - @Override - public void validate() { - assertTrue(recipientIdentifier != null, "recipientIdentifier cannot be null"); - assertTrue(questionType != null, "questionType cannot be null"); - assertTrue(responseDetails != null, "responseDetails cannot be null"); - } -} diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCreateRequest.java b/src/main/java/teammates/ui/webapi/request/FeedbackResponseCreateRequest.java deleted file mode 100644 index 8483eb0ecdc..00000000000 --- a/src/main/java/teammates/ui/webapi/request/FeedbackResponseCreateRequest.java +++ /dev/null @@ -1,7 +0,0 @@ -package teammates.ui.webapi.request; - -/** - * The create request of a feedback response. - */ -public class FeedbackResponseCreateRequest extends FeedbackResponseBasicRequest { -} diff --git a/src/main/java/teammates/ui/webapi/request/FeedbackResponseUpdateRequest.java b/src/main/java/teammates/ui/webapi/request/FeedbackResponseUpdateRequest.java deleted file mode 100644 index 16f874287e3..00000000000 --- a/src/main/java/teammates/ui/webapi/request/FeedbackResponseUpdateRequest.java +++ /dev/null @@ -1,7 +0,0 @@ -package teammates.ui.webapi.request; - -/** - * The update request of a feedback response. - */ -public class FeedbackResponseUpdateRequest extends FeedbackResponseBasicRequest { -} diff --git a/src/main/resources/build.template.properties b/src/main/resources/build.template.properties index c09b64b39f2..2952b47dc0a 100644 --- a/src/main/resources/build.template.properties +++ b/src/main/resources/build.template.properties @@ -11,8 +11,8 @@ app.id = teammates-john # This is the version number of the app. # Use dashes instead of dots because GAE does not allow dots in version number. -# e.g. app.version = 6-0-0 -app.version = 6-0-0 +# e.g. app.version = 7-0-0 +app.version = 7-0-0 # This is the URL for the front-end dev server. # This should be used only during development mode where the dev server needs to be whitelisted for CORS. @@ -35,6 +35,10 @@ app.backup.gcs.bucketname=teammates-john-backup # It does not have any effect in dev server. app.enable.datastore.backup=false +# This flag sets whether the server is in maintenance mode. +# Under maintenance mode, all API requests will return a 503 error. +app.maintenance=false + # This is the key used to bypass origin check for web API endpoints. # It can be any random string you choose. # Make sure that this key is secure. diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index ee1aeb22495..570f39f4560 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -30,7 +30,7 @@ OriginCheckFilter - teammates.ui.webapi.action.OriginCheckFilter + teammates.ui.webapi.OriginCheckFilter OriginCheckFilter @@ -43,7 +43,7 @@ Servlet that handles the single web page application WebPageServlet - teammates.ui.webapi.action.WebPageServlet + teammates.ui.webapi.WebPageServlet 0 @@ -52,20 +52,22 @@ - Servlet that handles requests from web application + REST API Servlet WebApiServlet - teammates.ui.webapi.action.WebApiServlet + teammates.ui.webapi.WebApiServlet 0 WebApiServlet /webapi/* + /auto/* + /worker/* Servlet that handles logout requests LogoutServlet - teammates.ui.webapi.action.LogoutServlet + teammates.ui.webapi.LogoutServlet 0 @@ -76,33 +78,13 @@ Servlet that handles mapping from legacy URL to new one LegacyUrlMapper - teammates.ui.webapi.action.LegacyUrlMapper + teammates.ui.webapi.LegacyUrlMapper LegacyUrlMapper /page/* - - Servlet that handles cron jobs - CronJobServlet - teammates.ui.automated.CronJobServlet - - - CronJobServlet - /auto/* - - - - Servlet that handles task queues - TaskQueueServlet - teammates.ui.automated.TaskQueueServlet - - - TaskQueueServlet - /worker/* - - AllResources @@ -130,7 +112,6 @@ AdminResources For admin use only - /remote_api /web/admin/* diff --git a/src/test/java/teammates/test/cases/architecture/ArchitectureTest.java b/src/test/java/teammates/architecture/ArchitectureTest.java similarity index 82% rename from src/test/java/teammates/test/cases/architecture/ArchitectureTest.java rename to src/test/java/teammates/architecture/ArchitectureTest.java index a89ed0d0c7b..5bc23d20ff7 100644 --- a/src/test/java/teammates/test/cases/architecture/ArchitectureTest.java +++ b/src/test/java/teammates/architecture/ArchitectureTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.architecture; +package teammates.architecture; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; @@ -14,11 +14,6 @@ */ public class ArchitectureTest { - @Deprecated - private static final String LEGACY_PAGEOBJECT_PACKAGE = "teammates.test.pageobjects"; - @Deprecated - private static final String LEGACY_BROWSERTESTS_PACKAGE = "teammates.test.cases.browsertests"; - private static final JavaClasses ALL_CLASSES = forClasses("teammates"); private static final String COMMON_PACKAGE = "teammates.common"; @@ -34,15 +29,11 @@ public class ArchitectureTest { private static final String LOGIC_API_PACKAGE = LOGIC_PACKAGE + ".api"; private static final String UI_PACKAGE = "teammates.ui"; - private static final String UI_AUTOMATED_PACKAGE = UI_PACKAGE + ".automated"; - private static final String UI_WEBAPI_PACKAGE = UI_PACKAGE + ".webapi.action"; - private static final String UI_OUTPUT_PACKAGE = UI_PACKAGE + ".webapi.output"; - private static final String UI_REQUEST_PACKAGE = UI_PACKAGE + ".webapi.request"; - - private static final String TEST_PACKAGE = "teammates.test"; + private static final String UI_WEBAPI_PACKAGE = UI_PACKAGE + ".webapi"; + private static final String UI_OUTPUT_PACKAGE = UI_PACKAGE + ".output"; + private static final String UI_REQUEST_PACKAGE = UI_PACKAGE + ".request"; - private static final String TEST_CASES_PACKAGE = TEST_PACKAGE + ".cases"; - private static final String TEST_DRIVER_PACKAGE = TEST_PACKAGE + ".driver"; + private static final String TEST_DRIVER_PACKAGE = "teammates.test"; private static final String E2E_PACKAGE = "teammates.e2e"; @@ -55,6 +46,8 @@ public class ArchitectureTest { private static final String CLIENT_SCRIPTS_PACKAGE = CLIENT_PACKAGE + ".scripts"; private static final String CLIENT_UTIL_PACKAGE = CLIENT_PACKAGE + ".util"; + private static final String TEST_FILE_SUFFIX = "Test"; + private static String includeSubpackages(String pack) { return pack + ".."; } @@ -73,8 +66,15 @@ public void testArchitecture_uiShouldNotTouchStorage() { @Test public void testArchitecture_logicShouldNotTouchUi() { noClasses().that().resideInAPackage(includeSubpackages(LOGIC_PACKAGE)) + .and().doNotHaveSimpleName("TaskQueuer") .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_PACKAGE)) .check(forClasses(LOGIC_PACKAGE, UI_PACKAGE)); + + noClasses().that().resideInAPackage(includeSubpackages(LOGIC_PACKAGE)) + .and().haveSimpleName("TaskQueuer") + .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) + .orShould().accessClassesThat().resideInAPackage(includeSubpackages(UI_OUTPUT_PACKAGE)) + .check(forClasses(LOGIC_PACKAGE, UI_PACKAGE)); } @Test @@ -121,7 +121,6 @@ public void testArchitecture_commonShouldNotTouchUi() { @Test public void testArchitecture_uiShouldNotTouchLogicExceptForApi() { noClasses().that().resideInAPackage(includeSubpackages(UI_PACKAGE)) - .and().resideOutsideOfPackage(includeSubpackages(UI_AUTOMATED_PACKAGE)) .and().resideOutsideOfPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) .should().accessClassesThat().resideInAPackage(includeSubpackages(LOGIC_API_PACKAGE)) .check(forClasses(UI_PACKAGE, LOGIC_PACKAGE)); @@ -153,16 +152,14 @@ public void testArchitecture_ui_onlyWebApiCanTouchRequest() { @Test public void testArchitecture_ui_apiRequestCanOnlyTouchRequestAndOutput() { noClasses().that().resideInAPackage(includeSubpackages(UI_REQUEST_PACKAGE)) - .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_AUTOMATED_PACKAGE)) - .orShould().accessClassesThat().resideInAPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) + .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) .check(forClasses(UI_PACKAGE)); } @Test public void testArchitecture_ui_apiOutputCanOnlyTouchOutput() { noClasses().that().resideInAPackage(includeSubpackages(UI_OUTPUT_PACKAGE)) - .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_AUTOMATED_PACKAGE)) - .orShould().accessClassesThat().resideInAPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) + .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) .orShould().accessClassesThat().resideInAPackage(includeSubpackages(UI_REQUEST_PACKAGE)) .check(forClasses(UI_PACKAGE)); } @@ -175,23 +172,6 @@ public void testArchitecture_ui_controllerShouldBeSelfContained() { .check(forClasses(UI_PACKAGE)); } - @Test - public void testArchitecture_ui_automatedActionsShouldBeSelfContained() { - noClasses().that().resideInAPackage(includeSubpackages(UI_PACKAGE)) - .and().resideOutsideOfPackage(includeSubpackages(UI_AUTOMATED_PACKAGE)) - .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_AUTOMATED_PACKAGE)) - .check(forClasses(UI_PACKAGE)); - } - - @Test - public void testArchitecture_ui_automatedActionsShouldNotTouchOtherUiClasses() { - noClasses().that().resideInAPackage(includeSubpackages(UI_AUTOMATED_PACKAGE)) - .should().accessClassesThat().resideInAPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) - .orShould().accessClassesThat().resideInAPackage(includeSubpackages(UI_OUTPUT_PACKAGE)) - .orShould().accessClassesThat().resideInAPackage(includeSubpackages(UI_REQUEST_PACKAGE)) - .check(forClasses(UI_PACKAGE)); - } - @Test public void testArchitecture_logic_logicCanOnlyAccessStorageApi() { noClasses().that().resideInAPackage(includeSubpackages(LOGIC_PACKAGE)) @@ -212,11 +192,15 @@ public void testArchitecture_logic_coreLogicCanOnlyAccessItsCorrespondingDb() { if ("DataBundleLogic".equals(logicClassName)) { continue; } + if (logicClassName.endsWith(TEST_FILE_SUFFIX)) { + continue; + } String dbClassName = logicClassName.replace("Logic", "Db"); noClasses() .that().resideInAPackage(includeSubpackages(LOGIC_CORE_PACKAGE)) .and().doNotHaveSimpleName(logicClassName) + .and().doNotHaveSimpleName(logicClassName + TEST_FILE_SUFFIX) .and().doNotHaveSimpleName("DataBundleLogic") .should() .accessClassesThat(new DescribedPredicate("") { @@ -258,72 +242,58 @@ public boolean apply(JavaClass input) { @Test public void testArchitecture_common_assumptionClassCanOnlyBeAccessedByProductionCode() { - noClasses().that().resideInAPackage(includeSubpackages(TEST_PACKAGE)) + noClasses().that().resideInAPackage(includeSubpackages(TEST_DRIVER_PACKAGE)) .and().resideInAPackage(includeSubpackages(E2E_PACKAGE)) .and().resideInAPackage(includeSubpackages(CLIENT_PACKAGE)) .should().accessClassesThat().haveSimpleName("Assumption") .check(ALL_CLASSES); - } - @Test - public void testArchitecture_testClasses_testCasesShouldBeIndependent() { - noClasses().that(new DescribedPredicate("") { - @Override - public boolean apply(JavaClass input) { - return input.getPackageName().startsWith(TEST_CASES_PACKAGE) && !input.isInnerClass(); - } - }).should().accessClassesThat(new DescribedPredicate("") { - @Override - public boolean apply(JavaClass input) { - return input.getPackageName().startsWith(TEST_CASES_PACKAGE) - && !input.getSimpleName().startsWith("Base") - && !input.isInnerClass(); - } - }).check(forClasses(TEST_CASES_PACKAGE)); + noClasses().that().haveSimpleNameEndingWith(TEST_FILE_SUFFIX) + .should().accessClassesThat().haveSimpleName("Assumption") + .check(ALL_CLASSES); } @Test - public void testArchitecture_testClasses_onlySomeTestClassesCanAccessEntities() { - noClasses().that().resideInAPackage(includeSubpackages(TEST_PACKAGE)) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".datatransfer")) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".storage")) - .should().accessClassesThat().resideInAPackage(includeSubpackages(STORAGE_ENTITY_PACKAGE)) - .check(forClasses(TEST_PACKAGE, STORAGE_ENTITY_PACKAGE)); - } - - @Test - public void testArchitecture_testClasses_onlySomeTestClassesCanAccessLogic() { - noClasses().that().resideInAPackage(includeSubpackages(TEST_PACKAGE)) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".storage")) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".logic")) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".action")) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".webapi")) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".automated")) - .and().resideOutsideOfPackage(includeSubpackages(TEST_CASES_PACKAGE + ".search")) - .and().doNotHaveSimpleName("BaseComponentTestCase") - .and().doNotHaveSimpleName("BaseTestCaseWithMinimalGaeEnvironment") - .should().accessClassesThat().haveSimpleName("GaeSimulation") - .orShould().accessClassesThat().haveSimpleName("Logic") - .check(ALL_CLASSES); + public void testArchitecture_testClasses_testCasesShouldBeIndependent() { + noClasses().that().haveSimpleNameEndingWith(TEST_FILE_SUFFIX) + .should().accessClassesThat(new DescribedPredicate("") { + @Override + public boolean apply(JavaClass input) { + return input.getSimpleName().endsWith(TEST_FILE_SUFFIX) + && !input.getSimpleName().startsWith("Base"); + } + }).check(ALL_CLASSES); } @Test public void testArchitecture_testClasses_driverShouldNotHaveAnyDependency() { + noClasses().that().resideInAPackage(includeSubpackages(TEST_DRIVER_PACKAGE)) + .should().accessClassesThat().haveSimpleNameEndingWith(TEST_FILE_SUFFIX) + .check(forClasses(TEST_DRIVER_PACKAGE)); + noClasses().that().resideInAPackage(includeSubpackages(TEST_DRIVER_PACKAGE)) .should().accessClassesThat(new DescribedPredicate("") { @Override public boolean apply(JavaClass input) { - return input.getPackageName().startsWith(TEST_PACKAGE) - && !input.getPackageName().equals(TEST_DRIVER_PACKAGE); + return input.getPackageName().startsWith(STORAGE_PACKAGE) + && !"OfyHelper".equals(input.getSimpleName()); } - }).check(forClasses(TEST_PACKAGE)); + }) + .orShould().accessClassesThat().resideInAPackage(includeSubpackages(LOGIC_CORE_PACKAGE)) + .orShould().accessClassesThat(new DescribedPredicate("") { + @Override + public boolean apply(JavaClass input) { + return input.getPackageName().startsWith(UI_PACKAGE) + && !"Action".equals(input.getSimpleName()) + && !"ActionFactory".equals(input.getSimpleName()); + } + }) + .check(forClasses(TEST_DRIVER_PACKAGE)); } @Test public void testArchitecture_e2e_e2eShouldBeSelfContained() { noClasses().that().resideOutsideOfPackage(includeSubpackages(E2E_PACKAGE)) - .and().resideOutsideOfPackage(includeSubpackages(LEGACY_PAGEOBJECT_PACKAGE)) - .and().resideOutsideOfPackage(includeSubpackages(LEGACY_BROWSERTESTS_PACKAGE)) .should().accessClassesThat().resideInAPackage(includeSubpackages(E2E_PACKAGE)) .check(ALL_CLASSES); } @@ -489,8 +459,7 @@ public void testArchitecture_externalApi_datastoreTypesCanOnlyBeAccessedByEntity @Test public void testArchitecture_externalApi_servletApiCanOnlyBeAccessedBySomePackages() { - noClasses().that().doNotHaveSimpleName("ActivityLogEntry") - .and().doNotHaveSimpleName("GoogleCloudStorageHelper") + noClasses().that().doNotHaveSimpleName("GoogleCloudStorageHelper") .and().doNotHaveSimpleName("HttpRequestHelper") .and().doNotHaveSimpleName("OfyHelper") .and().doNotHaveSimpleName("GaeSimulation") @@ -498,7 +467,6 @@ public void testArchitecture_externalApi_servletApiCanOnlyBeAccessedBySomePackag .and().doNotHaveSimpleName("MockHttpServletRequest") .and().doNotHaveSimpleName("MockHttpServletResponse") .and().doNotHaveSimpleName("MockPart") - .and().resideOutsideOfPackage(includeSubpackages(UI_AUTOMATED_PACKAGE)) .and().resideOutsideOfPackage(includeSubpackages(UI_WEBAPI_PACKAGE)) .should().accessClassesThat().haveFullyQualifiedName("javax.servlet..") .check(ALL_CLASSES); @@ -510,7 +478,6 @@ public void testArchitecture_externalApi_assertionApiCanOnlyBeAccessedBySomePack .and().doNotHaveSimpleName("BaseTestCase") .and().doNotHaveSimpleName("AssertHelper") .and().doNotHaveSimpleName("EmailChecker") - .and().resideOutsideOfPackage(includeSubpackages(LEGACY_PAGEOBJECT_PACKAGE)) .should().accessClassesThat().haveFullyQualifiedName("org.junit.Assert") .check(ALL_CLASSES); } diff --git a/src/test/java/teammates/architecture/package-info.java b/src/test/java/teammates/architecture/package-info.java new file mode 100644 index 00000000000..f91f0657d75 --- /dev/null +++ b/src/test/java/teammates/architecture/package-info.java @@ -0,0 +1,4 @@ +/** + * Test cases for checking the system's architectural integrity. + */ +package teammates.architecture; diff --git a/src/test/java/teammates/test/cases/datatransfer/AttributesDeletionQueryTest.java b/src/test/java/teammates/common/datatransfer/AttributesDeletionQueryTest.java similarity index 98% rename from src/test/java/teammates/test/cases/datatransfer/AttributesDeletionQueryTest.java rename to src/test/java/teammates/common/datatransfer/AttributesDeletionQueryTest.java index d22a902594a..1af09dc25a1 100644 --- a/src/test/java/teammates/test/cases/datatransfer/AttributesDeletionQueryTest.java +++ b/src/test/java/teammates/common/datatransfer/AttributesDeletionQueryTest.java @@ -1,9 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer; import org.testng.annotations.Test; -import teammates.common.datatransfer.AttributesDeletionQuery; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link AttributesDeletionQuery}. diff --git a/src/test/java/teammates/test/cases/datatransfer/CourseRosterTest.java b/src/test/java/teammates/common/datatransfer/CourseRosterTest.java similarity index 88% rename from src/test/java/teammates/test/cases/datatransfer/CourseRosterTest.java rename to src/test/java/teammates/common/datatransfer/CourseRosterTest.java index 8a2b81c46c3..efb5f2c2d6c 100644 --- a/src/test/java/teammates/test/cases/datatransfer/CourseRosterTest.java +++ b/src/test/java/teammates/common/datatransfer/CourseRosterTest.java @@ -1,18 +1,16 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; import org.testng.annotations.Test; -import teammates.common.datatransfer.CourseRoster; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link CourseRoster}. @@ -81,31 +79,6 @@ public void allTests() { } - @Test - public void testGetEmailToNameTableFromRoster() { - Map emailToNameTableExpected = new HashMap<>(); - - emailToNameTableExpected.put("ins1@email.com", "Jess"); - emailToNameTableExpected.put("s1@gmail.com", "student 1"); - emailToNameTableExpected.put("s2@gmail.com", "student 2"); - - List students = new ArrayList<>(); - StudentAttributes student1 = StudentAttributes - .builder("", "s1@gmail.com") - .withName("student 1") - .build(); - StudentAttributes student2 = StudentAttributes - .builder("", "s2@gmail.com") - .withName("student 2") - .build(); - students.add(student1); - students.add(student2); - - CourseRoster roster = new CourseRoster(students, createInstructorList("Jess", "ins1@email.com")); - Map emailToNameTableActual = roster.getEmailToNameTableFromRoster(); - assertEquals(emailToNameTableExpected, emailToNameTableActual); - } - @Test public void testBuildTeamToMembersTable_emptyStudentList_shouldReturnsEmptyMap() { Map> teamToMembersTable = diff --git a/src/test/java/teammates/test/cases/datatransfer/InstructorPrivilegesTest.java b/src/test/java/teammates/common/datatransfer/InstructorPrivilegesTest.java similarity index 80% rename from src/test/java/teammates/test/cases/datatransfer/InstructorPrivilegesTest.java rename to src/test/java/teammates/common/datatransfer/InstructorPrivilegesTest.java index d1f6d0b2bbb..8a6a5f9e208 100644 --- a/src/test/java/teammates/test/cases/datatransfer/InstructorPrivilegesTest.java +++ b/src/test/java/teammates/common/datatransfer/InstructorPrivilegesTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer; -import java.util.LinkedHashMap; import java.util.Map; import org.testng.annotations.Test; -import teammates.common.datatransfer.InstructorPrivileges; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link InstructorPrivileges}. @@ -224,32 +222,6 @@ public void testUpdatePrivilegeInSectionLevel() { } - @Test - public void testUpdatePrivilegesInSectionLevel() { - InstructorPrivileges privileges = - new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER); - String sectionId = "sectionId"; - Map privilegeMap = new LinkedHashMap<>(); - - privilegeMap.put(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS, false); - - privileges.updatePrivileges(sectionId, privilegeMap); - Map sectionPrivileges = privileges.getSectionLevelPrivileges().get(sectionId); - assertEquals(1, privileges.getSectionLevelPrivileges().size()); - assertTrue(privileges.getSectionLevelPrivileges().containsKey(sectionId)); - assertEquals(1, sectionPrivileges.size()); - assertFalse(sectionPrivileges.get(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS)); - - String invalidPrivilegeName = "invalidPrivilegeName"; - privilegeMap.put(invalidPrivilegeName, false); - privileges.updatePrivileges(sectionId, privilegeMap); - sectionPrivileges = privileges.getSectionLevelPrivileges().get(sectionId); - assertEquals(1, privileges.getSectionLevelPrivileges().size()); - assertTrue(privileges.getSectionLevelPrivileges().containsKey(sectionId)); - assertEquals(1, sectionPrivileges.size()); - assertFalse(sectionPrivileges.get(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS)); - } - @Test public void testUpdatePrivilegeInSessionLevel() { InstructorPrivileges privileges = @@ -278,35 +250,6 @@ public void testUpdatePrivilegeInSessionLevel() { assertFalse(sessionPrivileges.get(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); } - @Test - public void testUpdatePrivilegesInSessionLevel() { - InstructorPrivileges privileges = - new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER); - String sectionId = "sectionId"; - String sessionId = "sessionId"; - Map privilegeMap = new LinkedHashMap<>(); - - privilegeMap.put(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS, false); - privilegeMap.put(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS, false); - privileges.updatePrivileges(sectionId, sessionId, privilegeMap); - assertEquals(1, privileges.getSessionLevelPrivileges().size()); - assertTrue(privileges.getSessionLevelPrivileges().containsKey(sectionId)); - assertEquals(1, privileges.getSessionLevelPrivileges().get(sectionId).size()); - assertTrue(privileges.getSessionLevelPrivileges().get(sectionId).containsKey(sessionId)); - Map sessionPrivileges = privileges.getSessionLevelPrivileges().get(sectionId).get(sessionId); - assertEquals(2, sessionPrivileges.size()); - assertFalse(sessionPrivileges.get(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - assertFalse(sessionPrivileges.get(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); - - String invalidPrivilegeName = "invalidPrivilegeName"; - privilegeMap.put(invalidPrivilegeName, false); - privileges.updatePrivileges(sectionId, sessionId, privilegeMap); - sessionPrivileges = privileges.getSessionLevelPrivileges().get(sectionId).get(sessionId); - assertEquals(2, sessionPrivileges.size()); - assertFalse(sessionPrivileges.get(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - assertFalse(sessionPrivileges.get(Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); - } - @Test public void testAddSectionWithDefaultPrivilegesToSectionLevel() { InstructorPrivileges privileges = @@ -328,26 +271,6 @@ public void testAddSectionWithDefaultPrivilegesToSectionLevel() { //TODO: more checking for this and the method follows } - @Test - public void testAddSessionWithDefaultPrivilegesToSessionLevel() { - InstructorPrivileges privileges = - new InstructorPrivileges(Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER); - String sectionId = "sectionId"; - String sectionId2 = "sectionId2"; - String sessionId = "sessionId"; - String sessionId2 = "sessionId2"; - - privileges.addSessionWithDefaultPrivileges(sectionId, sessionId); - privileges.addSessionWithDefaultPrivileges(sectionId, sessionId); - privileges.addSessionWithDefaultPrivileges(sectionId, sessionId2); - privileges.addSessionWithDefaultPrivileges(sectionId2, sessionId); - assertEquals(2, privileges.getSessionLevelPrivileges().size()); - assertTrue(privileges.getSessionLevelPrivileges().containsKey(sectionId)); - assertTrue(privileges.getSessionLevelPrivileges().containsKey(sectionId2)); - assertEquals(2, privileges.getSessionLevelPrivileges().get(sectionId).size()); - assertEquals(1, privileges.getSessionLevelPrivileges().get(sectionId2).size()); - } - @Test public void testIsAllowedForPrivilege() { InstructorPrivileges privileges = @@ -365,18 +288,8 @@ public void testIsAllowedForPrivilege() { sectionId, Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); String sessionId = "sessionId"; - String sessionId2 = "sessionId2"; assertFalse(privileges.isAllowedForPrivilege( sectionId, sessionId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - privileges.addSessionWithDefaultPrivileges(sectionId, sessionId2); - assertFalse(privileges.isAllowedForPrivilege( - sectionId, sessionId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - privileges.updatePrivilege( - sectionId, sessionId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS, true); - assertTrue(privileges.isAllowedForPrivilege( - sectionId, sessionId, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - assertFalse(privileges.isAllowedForPrivilege( - sectionId, sessionId, Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS)); } @Test @@ -403,14 +316,10 @@ public void testValidatePrivileges() { privileges.updatePrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS, false); privileges.updatePrivilege(sectionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS, false); privileges.updatePrivilege(sectionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS, false); - String sessionName = "session"; - privileges.addSessionWithDefaultPrivileges(sectionName, sessionName); privileges.validatePrivileges(); assertTrue(privileges.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); assertTrue(privileges.isAllowedForPrivilege( sectionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); - assertTrue(privileges.isAllowedForPrivilege( - sectionName, sessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); } @Test diff --git a/src/test/java/teammates/test/cases/datatransfer/SessionResultsBundleTest.java b/src/test/java/teammates/common/datatransfer/SessionResultsBundleTest.java similarity index 96% rename from src/test/java/teammates/test/cases/datatransfer/SessionResultsBundleTest.java rename to src/test/java/teammates/common/datatransfer/SessionResultsBundleTest.java index 17aebfbca3c..2c219f55450 100644 --- a/src/test/java/teammates/test/cases/datatransfer/SessionResultsBundleTest.java +++ b/src/test/java/teammates/common/datatransfer/SessionResultsBundleTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer; import java.util.ArrayList; import java.util.HashMap; @@ -7,15 +7,11 @@ import org.testng.annotations.Test; -import teammates.common.datatransfer.CourseRoster; -import teammates.common.datatransfer.DataBundle; -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.SessionResultsBundle; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link SessionResultsBundle}. diff --git a/src/test/java/teammates/test/cases/datatransfer/TeamEvalResultTest.java b/src/test/java/teammates/common/datatransfer/TeamEvalResultTest.java similarity index 99% rename from src/test/java/teammates/test/cases/datatransfer/TeamEvalResultTest.java rename to src/test/java/teammates/common/datatransfer/TeamEvalResultTest.java index 232b53c7c0e..d84e74e1828 100644 --- a/src/test/java/teammates/test/cases/datatransfer/TeamEvalResultTest.java +++ b/src/test/java/teammates/common/datatransfer/TeamEvalResultTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer; import static teammates.common.datatransfer.TeamEvalResult.NA; import static teammates.common.datatransfer.TeamEvalResult.NSB; @@ -8,8 +8,7 @@ import org.testng.annotations.Test; -import teammates.common.datatransfer.TeamEvalResult; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link TeamEvalResult}. diff --git a/src/test/java/teammates/test/cases/datatransfer/AccountAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/AccountAttributesTest.java similarity index 98% rename from src/test/java/teammates/test/cases/datatransfer/AccountAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/AccountAttributesTest.java index bb4229253d2..24f7b456650 100644 --- a/src/test/java/teammates/test/cases/datatransfer/AccountAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/AccountAttributesTest.java @@ -1,13 +1,12 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import org.testng.annotations.Test; -import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.util.FieldValidator; import teammates.common.util.SanitizationHelper; import teammates.common.util.StringHelper; +import teammates.common.util.StringHelperExtension; import teammates.storage.entity.Account; -import teammates.test.driver.StringHelperExtension; /** * SUT: {@link AccountAttributes}. diff --git a/src/test/java/teammates/test/cases/datatransfer/BaseAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/BaseAttributesTest.java similarity index 76% rename from src/test/java/teammates/test/cases/datatransfer/BaseAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/BaseAttributesTest.java index 29fa7c909fd..2992ff0b4b2 100644 --- a/src/test/java/teammates/test/cases/datatransfer/BaseAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/BaseAttributesTest.java @@ -1,6 +1,6 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; -import teammates.test.cases.BaseTestCaseWithObjectifyAccess; +import teammates.test.BaseTestCaseWithObjectifyAccess; /** * Base class for attributes tests. Requires Objectify access for entities, which are generated in {@code toEntity} tests. diff --git a/src/test/java/teammates/test/cases/datatransfer/CourseAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/CourseAttributesTest.java similarity index 97% rename from src/test/java/teammates/test/cases/datatransfer/CourseAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/CourseAttributesTest.java index e9acc8550bc..77455d3182e 100644 --- a/src/test/java/teammates/test/cases/datatransfer/CourseAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/CourseAttributesTest.java @@ -1,17 +1,16 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import java.time.Instant; import java.time.ZoneId; import org.testng.annotations.Test; -import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.StringHelper; +import teammates.common.util.StringHelperExtension; import teammates.storage.entity.Course; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.StringHelperExtension; +import teammates.test.BaseTestCase; /** * SUT: {@link CourseAttributes}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackQuestionAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/FeedbackQuestionAttributesTest.java similarity index 99% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackQuestionAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/FeedbackQuestionAttributesTest.java index b332680f074..5fd809ab3e6 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackQuestionAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/FeedbackQuestionAttributesTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,6 @@ import teammates.common.datatransfer.DataBundle; import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.questions.FeedbackQuestionDetails; import teammates.common.datatransfer.questions.FeedbackQuestionType; import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; @@ -187,14 +186,14 @@ public void testValueOf_textQuestions_shouldDeserializeCorrectly() throws Invali FeedbackQuestionAttributes fqa = FeedbackQuestionAttributes.valueOf(qn); assertEquals("singleWord", fqa.questionDetails.getQuestionText()); - assertEquals(0, ((FeedbackTextQuestionDetails) fqa.questionDetails).getRecommendedLength()); + assertNull(((FeedbackTextQuestionDetails) fqa.questionDetails).getRecommendedLength()); ______TS("legacy data: plain text: multiple words, should deserialize correctly"); qn.setQuestionText("multiple words text"); FeedbackQuestionAttributes fqaMulti = FeedbackQuestionAttributes.valueOf(qn); assertEquals("multiple words text", fqaMulti.questionDetails.getQuestionText()); - assertEquals(0, ((FeedbackTextQuestionDetails) fqaMulti.questionDetails).getRecommendedLength()); + assertNull(((FeedbackTextQuestionDetails) fqaMulti.questionDetails).getRecommendedLength()); ______TS("json text: should deserialize as json"); String jsonQuestionText = "{\n" @@ -205,7 +204,7 @@ public void testValueOf_textQuestions_shouldDeserializeCorrectly() throws Invali qn.setQuestionText(jsonQuestionText); FeedbackQuestionAttributes fqaJson = FeedbackQuestionAttributes.valueOf(qn); assertEquals("normal question", fqaJson.questionDetails.getQuestionText()); - assertEquals(70, ((FeedbackTextQuestionDetails) fqaJson.questionDetails).getRecommendedLength()); + assertEquals(70, ((FeedbackTextQuestionDetails) fqaJson.questionDetails).getRecommendedLength().intValue()); } @Test diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackResponseAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/FeedbackResponseAttributesTest.java similarity index 99% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackResponseAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/FeedbackResponseAttributesTest.java index 10c5b355e34..cdac5616765 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackResponseAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/FeedbackResponseAttributesTest.java @@ -1,14 +1,13 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import org.testng.annotations.Test; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; import teammates.common.datatransfer.questions.FeedbackQuestionType; import teammates.common.datatransfer.questions.FeedbackResponseDetails; import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; import teammates.common.util.Const; import teammates.storage.entity.FeedbackResponse; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackResponseAttributes}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackResponseCommentAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/FeedbackResponseCommentAttributesTest.java similarity index 99% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackResponseCommentAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/FeedbackResponseCommentAttributesTest.java index 80b8e6fb6cb..7835a6d263b 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackResponseCommentAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/FeedbackResponseCommentAttributesTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import java.time.Instant; import java.util.ArrayList; @@ -7,10 +7,9 @@ import org.testng.collections.Lists; import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; import teammates.common.util.Const; import teammates.storage.entity.FeedbackResponseComment; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackResponseCommentAttributes}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackSessionAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributesTest.java similarity index 90% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackSessionAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributesTest.java index 68f6630d7da..713cc4af11c 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackSessionAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/FeedbackSessionAttributesTest.java @@ -1,82 +1,26 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import java.time.Duration; import java.time.Instant; import java.time.ZoneId; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; -import java.util.List; import org.testng.annotations.Test; import com.google.common.collect.Sets; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; import teammates.common.util.TimeHelper; +import teammates.common.util.TimeHelperExtension; import teammates.storage.entity.FeedbackSession; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.TimeHelperExtension; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackSessionAttributes}. */ public class FeedbackSessionAttributesTest extends BaseTestCase { - @Test - public void testSort() { - List testList = new ArrayList<>(); - List expected = new ArrayList<>(); - - Instant time1 = TimeHelper.parseInstant("2014-01-01 12:00 AM +0000"); - Instant time2 = TimeHelper.parseInstant("2014-02-01 12:00 AM +0000"); - Instant time3 = TimeHelper.parseInstant("2014-03-01 12:00 AM +0000"); - - FeedbackSessionAttributes s1 = - FeedbackSessionAttributes.builder("Session 1", "") - .withStartTime(time1) - .withEndTime(time2) - .build(); - FeedbackSessionAttributes s2 = - FeedbackSessionAttributes.builder("Session 2", "") - .withStartTime(time2) - .withEndTime(time3) - .build(); - FeedbackSessionAttributes s3 = - FeedbackSessionAttributes.builder("Session 3", "") - .withStartTime(time1) - .withEndTime(time2) - .build(); - FeedbackSessionAttributes s4 = - FeedbackSessionAttributes.builder("Session 4", "") - .withStartTime(time1) - .withEndTime(time3) - .build(); - FeedbackSessionAttributes s5 = - FeedbackSessionAttributes.builder("Session 5", "") - .withStartTime(time2) - .withEndTime(time3) - .build(); - - testList.add(s1); - testList.add(s2); - testList.add(s3); - testList.add(s4); - testList.add(s5); - - expected.add(s2); - expected.add(s5); - expected.add(s4); - expected.add(s1); - expected.add(s3); - - testList.sort(FeedbackSessionAttributes.DESCENDING_ORDER); - for (int i = 0; i < testList.size(); i++) { - assertEquals(expected.get(i), testList.get(i)); - } - } - @Test public void testBuilder_buildNothing_shouldUseDefaultValues() { FeedbackSessionAttributes fsa = FeedbackSessionAttributes @@ -272,10 +216,8 @@ public void testValueOf_modificationInAttributes_shouldNotLeakStateToEntity() { public void testBuilder_withTypicalData_shouldBuildCorrectly() { ZoneId timeZone = ZoneId.of("Asia/Singapore"); - Instant startTime = TimeHelper.convertLocalDateTimeToInstant( - TimeHelper.parseDateTimeFromSessionsForm("Mon, 09 May, 2016", "10", "0"), timeZone); - Instant endTime = TimeHelper.convertLocalDateTimeToInstant( - TimeHelper.parseDateTimeFromSessionsForm("Tue, 09 May, 2017", "10", "0"), timeZone); + Instant startTime = TimeHelper.parseInstant("2016-05-09 10:00 AM +0800"); + Instant endTime = TimeHelper.parseInstant("2017-05-09 10:00 AM +0800"); FeedbackSessionAttributes fsa = FeedbackSessionAttributes .builder("sessionName", "courseId") @@ -372,7 +314,8 @@ public void testValidate() { + "hyphens, underscores, and dollar signs. It cannot be longer than 40 characters, cannot be empty and " + "cannot contain spaces."; String creatorEmailError = "The field 'email' is empty. An email address contains some text followed " - + "by one '@' sign followed by some more text. It cannot be longer than 254 characters, cannot be empty" + + "by one '@' sign followed by some more text, and should end with a top level domain address like .com. " + + "It cannot be longer than 254 characters, cannot be empty" + " and cannot contain spaces."; String gracePeriodError = "Grace period should not be negative." + " " + "The value must be one of the options in the grace period dropdown selector."; @@ -569,10 +512,8 @@ public void testHashCode() { private FeedbackSessionAttributes generateTypicalFeedbackSessionAttributesObject() { ZoneId timeZone = ZoneId.of("Asia/Singapore"); - Instant startTime = TimeHelper.convertLocalDateTimeToInstant( - TimeHelper.parseDateTimeFromSessionsForm("Mon, 09 May, 2016", "10", "0"), timeZone); - Instant endTime = TimeHelper.convertLocalDateTimeToInstant( - TimeHelper.parseDateTimeFromSessionsForm("Tue, 09 May, 2017", "10", "0"), timeZone); + Instant startTime = TimeHelper.parseInstant("2016-05-09 10:00 AM +0800"); + Instant endTime = TimeHelper.parseInstant("2017-05-09 10:00 AM +0800"); return FeedbackSessionAttributes .builder("sessionName", "courseId") diff --git a/src/test/java/teammates/test/cases/datatransfer/GenderTest.java b/src/test/java/teammates/common/datatransfer/attributes/GenderTest.java similarity index 87% rename from src/test/java/teammates/test/cases/datatransfer/GenderTest.java rename to src/test/java/teammates/common/datatransfer/attributes/GenderTest.java index 2257290fa58..3cc975ffb62 100644 --- a/src/test/java/teammates/test/cases/datatransfer/GenderTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/GenderTest.java @@ -1,9 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import org.testng.annotations.Test; -import teammates.common.datatransfer.attributes.StudentProfileAttributes; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link StudentProfileAttributes.Gender}. diff --git a/src/test/java/teammates/test/cases/datatransfer/InstructorAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java similarity index 99% rename from src/test/java/teammates/test/cases/datatransfer/InstructorAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java index 4d4939f44d2..4e3e37f7527 100644 --- a/src/test/java/teammates/test/cases/datatransfer/InstructorAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/InstructorAttributesTest.java @@ -1,9 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import org.testng.annotations.Test; import teammates.common.datatransfer.InstructorPrivileges; -import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; diff --git a/src/test/java/teammates/test/cases/datatransfer/StudentAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/StudentAttributesTest.java similarity index 84% rename from src/test/java/teammates/test/cases/datatransfer/StudentAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/StudentAttributesTest.java index caac6f3b126..c6143dceb25 100644 --- a/src/test/java/teammates/test/cases/datatransfer/StudentAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/StudentAttributesTest.java @@ -1,18 +1,17 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import java.util.Arrays; import java.util.List; import org.testng.annotations.Test; -import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Config; import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.StringHelper; +import teammates.common.util.StringHelperExtension; import teammates.storage.entity.CourseStudent; -import teammates.test.cases.BaseTestCaseWithMinimalGaeEnvironment; -import teammates.test.driver.StringHelperExtension; +import teammates.test.BaseTestCaseWithMinimalGaeEnvironment; /** * SUT: {@link StudentAttributes}. @@ -375,70 +374,19 @@ public void testUpdateOptionsBuilder_withNullInput_shouldFailWithAssertionError( .withSectionName(null)); } - @Test - public void testIsEnrollInfoSameAs() { - StudentAttributes student = StudentAttributes.valueOf(generateTypicalStudentObject()); - StudentAttributes other = StudentAttributes.valueOf(generateTypicalStudentObject()); - - ______TS("Typical case: Same enroll info"); - assertTrue(student.isEnrollInfoSameAs(other)); - - ______TS("Typical case: Compare to null"); - assertFalse(student.isEnrollInfoSameAs(null)); - - ______TS("Typical case: Different in email"); - other.email = "other@email.com"; - assertFalse(student.isEnrollInfoSameAs(other)); - - ______TS("Typical case: Different in name"); - other = StudentAttributes.valueOf(generateTypicalStudentObject()); - other.name = "otherName"; - assertFalse(student.isEnrollInfoSameAs(other)); - - ______TS("Typical case: Different in course id"); - other = StudentAttributes.valueOf(generateTypicalStudentObject()); - other.course = "otherCourse"; - assertFalse(student.isEnrollInfoSameAs(other)); - - ______TS("Typical case: Different in comment"); - other = StudentAttributes.valueOf(generateTypicalStudentObject()); - other.comments = "otherComments"; - assertFalse(student.isEnrollInfoSameAs(other)); - - ______TS("Typical case: Different in team"); - other = StudentAttributes.valueOf(generateTypicalStudentObject()); - other.team = "otherTeam"; - assertFalse(student.isEnrollInfoSameAs(other)); - - ______TS("Typical case: Different in section"); - other = StudentAttributes.valueOf(generateStudentWithoutSectionObject()); - assertFalse(student.isEnrollInfoSameAs(other)); - } - - @Test - public void testSortByNameAndThenByEmail() { - List sortedList = generateTypicalStudentAttributesList(); - StudentAttributes.sortByNameAndThenByEmail(sortedList); - List unsortedList = generateTypicalStudentAttributesList(); - assertEquals(sortedList.get(0).toEnrollmentString(), unsortedList.get(0).toEnrollmentString()); - assertEquals(sortedList.get(1).toEnrollmentString(), unsortedList.get(3).toEnrollmentString()); - assertEquals(sortedList.get(2).toEnrollmentString(), unsortedList.get(2).toEnrollmentString()); - assertEquals(sortedList.get(3).toEnrollmentString(), unsortedList.get(1).toEnrollmentString()); - } - @Test public void testSortByTeam() { List sortedList = generateTypicalStudentAttributesList(); StudentAttributes.sortByTeamName(sortedList); List unsortedList = generateTypicalStudentAttributesList(); - assertEquals(sortedList.get(0).toEnrollmentString(), - unsortedList.get(2).toEnrollmentString()); - assertEquals(sortedList.get(1).toEnrollmentString(), - unsortedList.get(0).toEnrollmentString()); - assertEquals(sortedList.get(2).toEnrollmentString(), - unsortedList.get(1).toEnrollmentString()); - assertEquals(sortedList.get(3).toEnrollmentString(), - unsortedList.get(3).toEnrollmentString()); + assertEquals(sortedList.get(0).toString(), + unsortedList.get(2).toString()); + assertEquals(sortedList.get(1).toString(), + unsortedList.get(0).toString()); + assertEquals(sortedList.get(2).toString(), + unsortedList.get(1).toString()); + assertEquals(sortedList.get(3).toString(), + unsortedList.get(3).toString()); } @Test @@ -446,14 +394,14 @@ public void testSortBySection() { List sortedList = generateTypicalStudentAttributesList(); StudentAttributes.sortBySectionName(sortedList); List unsortedList = generateTypicalStudentAttributesList(); - assertEquals(sortedList.get(0).toEnrollmentString(), - unsortedList.get(3).toEnrollmentString()); - assertEquals(sortedList.get(1).toEnrollmentString(), - unsortedList.get(0).toEnrollmentString()); - assertEquals(sortedList.get(2).toEnrollmentString(), - unsortedList.get(1).toEnrollmentString()); - assertEquals(sortedList.get(3).toEnrollmentString(), - unsortedList.get(2).toEnrollmentString()); + assertEquals(sortedList.get(0).toString(), + unsortedList.get(3).toString()); + assertEquals(sortedList.get(1).toString(), + unsortedList.get(0).toString()); + assertEquals(sortedList.get(2).toString(), + unsortedList.get(1).toString()); + assertEquals(sortedList.get(3).toString(), + unsortedList.get(2).toString()); } @Test @@ -488,21 +436,7 @@ public void testToString() { .withTeamName("team 1") .build(); - assertEquals("Student:name 1[email@email.com]" + System.lineSeparator(), sd.toString()); - assertEquals(" Student:name 1[email@email.com]" + System.lineSeparator(), sd.toString(4)); - } - - @Test - public void testToEnrollmentString() { - StudentAttributes sd = StudentAttributes - .builder("course1", "email@email.com") - .withName("name 1") - .withSectionName("sect 1") - .withComment("comment 1") - .withTeamName("team 1") - .build(); - - assertEquals("sect 1|team 1|name 1|email@email.com|comment 1", sd.toEnrollmentString()); + assertEquals("Student:name 1[email@email.com]", sd.toString()); } @Test @@ -575,10 +509,6 @@ private CourseStudent generateTypicalStudentObject() { return new CourseStudent("email@email.com", "name 1", "googleId.1", "comment 1", "courseId1", "team 1", "sect 1"); } - private CourseStudent generateStudentWithoutSectionObject() { - return new CourseStudent("email@email.com", "name 1", "googleId.1", "comment 1", "courseId1", "team 1", null); - } - private List generateTypicalStudentAttributesList() { StudentAttributes studentAttributes1 = StudentAttributes .builder("courseId", "email 1") diff --git a/src/test/java/teammates/test/cases/datatransfer/StudentProfileAttributesTest.java b/src/test/java/teammates/common/datatransfer/attributes/StudentProfileAttributesTest.java similarity index 98% rename from src/test/java/teammates/test/cases/datatransfer/StudentProfileAttributesTest.java rename to src/test/java/teammates/common/datatransfer/attributes/StudentProfileAttributesTest.java index 3074bfe7529..9dee1464007 100644 --- a/src/test/java/teammates/test/cases/datatransfer/StudentProfileAttributesTest.java +++ b/src/test/java/teammates/common/datatransfer/attributes/StudentProfileAttributesTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.attributes; import java.util.ArrayList; import java.util.List; @@ -6,12 +6,11 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.util.FieldValidator; import teammates.common.util.SanitizationHelper; +import teammates.common.util.StringHelperExtension; import teammates.storage.entity.StudentProfile; -import teammates.test.driver.AssertHelper; -import teammates.test.driver.StringHelperExtension; +import teammates.test.AssertHelper; /** * SUT: {@link StudentProfileAttributes}. diff --git a/src/test/java/teammates/common/datatransfer/attributes/package-info.java b/src/test/java/teammates/common/datatransfer/attributes/package-info.java new file mode 100644 index 00000000000..964175129d3 --- /dev/null +++ b/src/test/java/teammates/common/datatransfer/attributes/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.common.datatransfer.attributes} package. + */ +package teammates.common.datatransfer.attributes; diff --git a/src/test/java/teammates/common/datatransfer/package-info.java b/src/test/java/teammates/common/datatransfer/package-info.java new file mode 100644 index 00000000000..ff2e86fc267 --- /dev/null +++ b/src/test/java/teammates/common/datatransfer/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.common.datatransfer} package. + */ +package teammates.common.datatransfer; diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackConstantSumResponseDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackConstantSumQuestionDetailsTest.java similarity index 59% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackConstantSumResponseDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackConstantSumQuestionDetailsTest.java index e6c3ddfbc16..240e5128966 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackConstantSumResponseDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackConstantSumQuestionDetailsTest.java @@ -1,29 +1,23 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import org.testng.annotations.Test; -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.questions.FeedbackConstantSumDistributePointsType; -import teammates.common.datatransfer.questions.FeedbackConstantSumQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackConstantSumResponseDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackConstantSumQuestionDetails}. */ -public class FeedbackConstantSumResponseDetailsTest extends BaseTestCase { +public class FeedbackConstantSumQuestionDetailsTest extends BaseTestCase { @Test public void testValidateResponseDetails_amongRecipientsValidAnswer_shouldReturnEmptyErrorList() { FeedbackConstantSumQuestionDetails constantSumQuestionDetails = new FeedbackConstantSumQuestionDetails(); constantSumQuestionDetails.setDistributeToRecipients(true); constantSumQuestionDetails.setConstSumOptions(new ArrayList<>()); - constantSumQuestionDetails.setNumOfConstSumOptions(0); constantSumQuestionDetails.setPoints(100); constantSumQuestionDetails.setForceUnevenDistribution(false); constantSumQuestionDetails.setDistributePointsFor( @@ -32,12 +26,12 @@ public void testValidateResponseDetails_amongRecipientsValidAnswer_shouldReturnE FeedbackConstantSumResponseDetails constantSumResponseDetails = new FeedbackConstantSumResponseDetails(); constantSumResponseDetails.setAnswers(Arrays.asList(0)); - assertTrue(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumResponseDetails.setAnswers(Arrays.asList(100)); - assertTrue(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertTrue(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); } @Test @@ -45,7 +39,6 @@ public void testValidateResponseDetails_amongRecipientsInvalidAnswer_shouldRetur FeedbackConstantSumQuestionDetails constantSumQuestionDetails = new FeedbackConstantSumQuestionDetails(); constantSumQuestionDetails.setDistributeToRecipients(true); constantSumQuestionDetails.setConstSumOptions(new ArrayList<>()); - constantSumQuestionDetails.setNumOfConstSumOptions(0); constantSumQuestionDetails.setPoints(100); constantSumQuestionDetails.setForceUnevenDistribution(false); constantSumQuestionDetails.setDistributePointsFor( @@ -54,16 +47,16 @@ public void testValidateResponseDetails_amongRecipientsInvalidAnswer_shouldRetur FeedbackConstantSumResponseDetails constantSumResponseDetails = new FeedbackConstantSumResponseDetails(); constantSumResponseDetails.setAnswers(Arrays.asList()); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumResponseDetails.setAnswers(Arrays.asList(-1)); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumResponseDetails.setAnswers(Arrays.asList(100, 101)); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); } @Test @@ -71,7 +64,6 @@ public void testValidateResponseDetails_amongOptionsValidAnswer_shouldReturnEmpt FeedbackConstantSumQuestionDetails constantSumQuestionDetails = new FeedbackConstantSumQuestionDetails(); constantSumQuestionDetails.setDistributeToRecipients(false); constantSumQuestionDetails.setConstSumOptions(Arrays.asList("a", "b", "c")); - constantSumQuestionDetails.setNumOfConstSumOptions(3); constantSumQuestionDetails.setPoints(100); constantSumQuestionDetails.setForceUnevenDistribution(false); constantSumQuestionDetails.setDistributePointsFor( @@ -80,35 +72,35 @@ public void testValidateResponseDetails_amongOptionsValidAnswer_shouldReturnEmpt FeedbackConstantSumResponseDetails constantSumResponseDetails = new FeedbackConstantSumResponseDetails(); constantSumResponseDetails.setAnswers(Arrays.asList(1, 99, 0)); - assertTrue(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertTrue(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumResponseDetails.setAnswers(Arrays.asList(0, 100, 0)); - assertTrue(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertTrue(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumQuestionDetails.setPointsPerOption(true); constantSumQuestionDetails.setPoints(100); constantSumResponseDetails.setAnswers(Arrays.asList(100, 100, 100)); - assertTrue(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertTrue(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumQuestionDetails.setForceUnevenDistribution(true); constantSumQuestionDetails.setDistributePointsFor( FeedbackConstantSumDistributePointsType.DISTRIBUTE_SOME_UNEVENLY.getDisplayedOption()); constantSumResponseDetails.setAnswers(Arrays.asList(99, 101, 100)); - assertTrue(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertTrue(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumQuestionDetails.setForceUnevenDistribution(true); constantSumQuestionDetails.setDistributePointsFor( FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption()); constantSumResponseDetails.setAnswers(Arrays.asList(40, 50, 210)); - assertTrue(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertTrue(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); } @Test @@ -116,7 +108,6 @@ public void testValidateResponseDetails_amongOptionsInvalidAnswer_shouldReturnNo FeedbackConstantSumQuestionDetails constantSumQuestionDetails = new FeedbackConstantSumQuestionDetails(); constantSumQuestionDetails.setDistributeToRecipients(false); constantSumQuestionDetails.setConstSumOptions(Arrays.asList("a", "b", "c")); - constantSumQuestionDetails.setNumOfConstSumOptions(3); constantSumQuestionDetails.setPointsPerOption(false); constantSumQuestionDetails.setPoints(99); constantSumQuestionDetails.setForceUnevenDistribution(false); @@ -126,28 +117,28 @@ public void testValidateResponseDetails_amongOptionsInvalidAnswer_shouldReturnNo FeedbackConstantSumResponseDetails constantSumResponseDetails = new FeedbackConstantSumResponseDetails(); constantSumResponseDetails.setAnswers(new ArrayList<>()); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumResponseDetails.setAnswers(Arrays.asList(1)); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumResponseDetails.setAnswers(Arrays.asList(1, -1, 99)); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumResponseDetails.setAnswers(Arrays.asList(1, 1, 99)); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumQuestionDetails.setForceUnevenDistribution(true); constantSumQuestionDetails.setDistributePointsFor( FeedbackConstantSumDistributePointsType.DISTRIBUTE_SOME_UNEVENLY.getDisplayedOption()); constantSumResponseDetails.setAnswers(Arrays.asList(33, 33, 33)); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); constantSumQuestionDetails.setForceUnevenDistribution(true); constantSumQuestionDetails.setDistributePointsFor( @@ -156,24 +147,8 @@ public void testValidateResponseDetails_amongOptionsInvalidAnswer_shouldReturnNo constantSumQuestionDetails.setPoints(100); constantSumResponseDetails.setAnswers(Arrays.asList(33, 34, 33)); - assertFalse(constantSumResponseDetails - .validateResponseDetails(getConstSumQuestion(constantSumQuestionDetails)).isEmpty()); - } - - private FeedbackQuestionAttributes getConstSumQuestion(FeedbackConstantSumQuestionDetails constantSumQuestionDetails) { - return FeedbackQuestionAttributes.builder() - .withCourseId("testCourse") - .withFeedbackSessionName("testSession") - .withQuestionDescription("testDescription") - .withQuestionDetails(constantSumQuestionDetails) - .withQuestionNumber(1) - .withGiverType(FeedbackParticipantType.STUDENTS) - .withRecipientType(FeedbackParticipantType.STUDENTS) - .withNumberOfEntitiesToGiveFeedbackTo(5) - .withShowGiverNameTo(new ArrayList<>()) - .withShowResponsesTo(new ArrayList<>()) - .withShowRecipientNameTo(new ArrayList<>()) - .build(); + assertFalse(constantSumQuestionDetails + .validateResponsesDetails(Collections.singletonList(constantSumResponseDetails), 0).isEmpty()); } @Test diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackContributionQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetailsTest.java similarity index 76% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackContributionQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetailsTest.java index 5e76cad6aa1..e5473b08eae 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackContributionQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackContributionQuestionDetailsTest.java @@ -1,10 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackContributionQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackContributionQuestionDetails}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackMcqQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetailsTest.java similarity index 94% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackMcqQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetailsTest.java index 35b303f3936..6c3ee84212e 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackMcqQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetailsTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import java.util.Arrays; import java.util.Collections; @@ -6,11 +6,8 @@ import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionType; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackMcqQuestionDetails}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackMsqQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetailsTest.java similarity index 63% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackMsqQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetailsTest.java index d4b4a16f751..0f402ac5583 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackMsqQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetailsTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import java.util.ArrayList; import java.util.Arrays; @@ -8,12 +8,9 @@ import org.testng.annotations.Test; import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.questions.FeedbackMsqQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionType; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackMsqQuestionDetails}. @@ -149,6 +146,70 @@ public void testValidateQuestionDetails_maxSelectableChoicesEqualTotalNumberOfCh assertEquals(0, errors.size()); } + @Test + public void testValidateResponseDetails_otherAnswerNotChosenButOtherFieldIsNotEmpty_shouldTriggerError() { + FeedbackMsqQuestionDetails msqQuestionDetails = new FeedbackMsqQuestionDetails(); + msqQuestionDetails.setMsqChoices(Arrays.asList("choiceA", "choiceB")); + msqQuestionDetails.setOtherEnabled(true); + msqQuestionDetails.setHasAssignedWeights(false); + + FeedbackMsqResponseDetails feedbackMsqResponseDetails = new FeedbackMsqResponseDetails(); + feedbackMsqResponseDetails.setOther(false); + feedbackMsqResponseDetails.setOtherFieldContent("NonEmpty"); + feedbackMsqResponseDetails.setAnswers(Arrays.asList("choiceA")); + + List errors = msqQuestionDetails.validateResponsesDetails( + Collections.singletonList(feedbackMsqResponseDetails), 0); + assertEquals(1, errors.size()); + assertEquals(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION, errors.get(0)); + + // now set other field to empty + feedbackMsqResponseDetails.setOtherFieldContent(""); + errors = msqQuestionDetails.validateResponsesDetails(Collections.singletonList(feedbackMsqResponseDetails), 0); + assertEquals(0, errors.size()); + } + + @Test + public void testValidateResponseDetails_choiceNotInValidChoices_shouldTriggerError() { + FeedbackMsqQuestionDetails msqQuestionDetails = new FeedbackMsqQuestionDetails(); + msqQuestionDetails.setMsqChoices(Arrays.asList("choiceA", "choiceB")); + msqQuestionDetails.setOtherEnabled(true); + msqQuestionDetails.setHasAssignedWeights(false); + + // typical case: answers not in valid choices + FeedbackMsqResponseDetails feedbackMsqResponseDetails = new FeedbackMsqResponseDetails(); + feedbackMsqResponseDetails.setOther(false); + feedbackMsqResponseDetails.setOtherFieldContent(""); + feedbackMsqResponseDetails.setAnswers(Arrays.asList("choiceC")); + List errors = msqQuestionDetails.validateResponsesDetails( + Collections.singletonList(feedbackMsqResponseDetails), 0); + assertEquals(1, errors.size()); + assertEquals(feedbackMsqResponseDetails.getAnswerString() + + " " + Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION, errors.get(0)); + + // now set choice to be within the valid choices + feedbackMsqResponseDetails.setAnswers(Arrays.asList("choiceA")); + errors = msqQuestionDetails.validateResponsesDetails(Collections.singletonList(feedbackMsqResponseDetails), 0); + assertEquals(0, errors.size()); + + // when other field is enabled, the other field content will become a valid choice + feedbackMsqResponseDetails.setOther(true); + feedbackMsqResponseDetails.setOtherFieldContent("Other"); + feedbackMsqResponseDetails.setAnswers(Arrays.asList("Other1")); + errors = msqQuestionDetails.validateResponsesDetails(Collections.singletonList(feedbackMsqResponseDetails), 0); + assertEquals(2, errors.size()); + assertEquals(feedbackMsqResponseDetails.getAnswerString() + + " " + Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION, errors.get(0)); + assertEquals(Const.FeedbackQuestion.MSQ_ERROR_OTHER_CONTENT_NOT_PROVIDED, errors.get(1)); + + // make answer list and other field content consistent + feedbackMsqResponseDetails.setOther(true); + feedbackMsqResponseDetails.setOtherFieldContent("Other"); + feedbackMsqResponseDetails.setAnswers(Arrays.asList("Other")); + errors = msqQuestionDetails.validateResponsesDetails(Collections.singletonList(feedbackMsqResponseDetails), 0); + assertEquals(0, errors.size()); + } + @Test public void testIsInstructorCommentsOnResponsesAllowed_shouldReturnTrue() { FeedbackQuestionDetails feedbackQuestionDetails = new FeedbackMsqQuestionDetails(); diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackNumericalScaleQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleQuestionDetailsTest.java similarity index 76% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackNumericalScaleQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleQuestionDetailsTest.java index ede07c6e390..c0d2ee78780 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackNumericalScaleQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackNumericalScaleQuestionDetailsTest.java @@ -1,10 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackNumericalScaleQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackNumericalScaleQuestionDetails}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackQuestionDetailsTest.java similarity index 82% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackQuestionDetailsTest.java index 1e72cd8ea7f..c65a77af34c 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackQuestionDetailsTest.java @@ -1,11 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackQuestionDetails}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackRankOptionsQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackRankOptionsQuestionDetailsTest.java similarity index 76% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackRankOptionsQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackRankOptionsQuestionDetailsTest.java index 640ac48c33e..82cb5b5ecff 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackRankOptionsQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackRankOptionsQuestionDetailsTest.java @@ -1,10 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackRankOptionsQuestionDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackRankOptionsQuestionDetails}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackRankRecipientsQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsQuestionDetailsTest.java similarity index 76% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackRankRecipientsQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsQuestionDetailsTest.java index 20a247fe221..71a212a6c6e 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackRankRecipientsQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackRankRecipientsQuestionDetailsTest.java @@ -1,10 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackRankRecipientsQuestionDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackRankRecipientsQuestionDetails}. diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackResponseDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackResponseDetailsTest.java similarity index 68% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackResponseDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackResponseDetailsTest.java index 30b338872e9..f62c576908c 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackResponseDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackResponseDetailsTest.java @@ -1,10 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackResponseDetails; -import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackResponseDetails}. diff --git a/src/test/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetailsTest.java new file mode 100644 index 00000000000..faa7a520a2e --- /dev/null +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackRubricQuestionDetailsTest.java @@ -0,0 +1,125 @@ +package teammates.common.datatransfer.questions; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.util.Const; +import teammates.test.BaseTestCase; + +/** + * SUT: {@link FeedbackRubricQuestionDetails}. + */ +public class FeedbackRubricQuestionDetailsTest extends BaseTestCase { + + @Test + public void testConstructor_defaultConstructor_fieldsShouldHaveCorrectDefaultValues() { + FeedbackRubricQuestionDetails rubricDetails = new FeedbackRubricQuestionDetails(); + + assertEquals(FeedbackQuestionType.RUBRIC, rubricDetails.getQuestionType()); + assertFalse(rubricDetails.hasAssignedWeights()); + assertTrue(rubricDetails.getRubricWeights().isEmpty()); + } + + @Test + public void testValidateQuestionDetails_invalidWeightListSize_errorReturned() { + FeedbackRubricQuestionDetails rubricDetails = new FeedbackRubricQuestionDetails(); + rubricDetails.setNumOfRubricChoices(2); + rubricDetails.setNumOfRubricSubQuestions(2); + rubricDetails.setRubricDescriptions(Arrays.asList(Arrays.asList("", ""), Arrays.asList("", ""))); + rubricDetails.setHasAssignedWeights(true); + rubricDetails.setRubricSubQuestions(Arrays.asList("SubQn-1", "SubQn-2")); + rubricDetails.setRubricChoices(Arrays.asList("Choice-1", "Choice-2")); + rubricDetails.setRubricWeightsForEachCell(Arrays.asList(Arrays.asList(1.5, 2.5), Collections.singletonList(1.0))); + + List errors = rubricDetails.validateQuestionDetails(); + assertEquals(1, errors.size()); + assertEquals(Const.FeedbackQuestion.RUBRIC_ERROR_INVALID_WEIGHT, errors.get(0)); + } + + @Test + public void testValidateQuestionDetails_validWeightListSize_errorListShouldBeEmpty() { + FeedbackRubricQuestionDetails rubricDetails = new FeedbackRubricQuestionDetails(); + rubricDetails.setNumOfRubricChoices(2); + rubricDetails.setNumOfRubricSubQuestions(2); + rubricDetails.setRubricDescriptions(Arrays.asList(Arrays.asList("", ""), Arrays.asList("", ""))); + rubricDetails.setHasAssignedWeights(true); + rubricDetails.setRubricSubQuestions(Arrays.asList("SubQn-1", "SubQn-2")); + rubricDetails.setRubricChoices(Arrays.asList("Choice-1", "Choice-2")); + rubricDetails.setRubricWeightsForEachCell(Arrays.asList(Arrays.asList(1.5, 2.5), Arrays.asList(1.0, 2.0))); + + List errors = rubricDetails.validateQuestionDetails(); + assertEquals(0, errors.size()); + } + + @Test + public void testValidateResponseDetails_validAnswer_shouldReturnEmptyErrorList() { + FeedbackRubricQuestionDetails rubricQuestionDetails = new FeedbackRubricQuestionDetails(); + rubricQuestionDetails.setHasAssignedWeights(false); + rubricQuestionDetails.setRubricWeightsForEachCell(new ArrayList<>()); + rubricQuestionDetails.setNumOfRubricChoices(2); + rubricQuestionDetails.setNumOfRubricSubQuestions(2); + rubricQuestionDetails.setRubricChoices(Arrays.asList("a", "b")); + rubricQuestionDetails.setRubricSubQuestions(Arrays.asList("q1", "q2")); + rubricQuestionDetails.setRubricDescriptions(Arrays.asList(Arrays.asList("d1", "d2"), Arrays.asList("d3", "d4"))); + + FeedbackRubricResponseDetails responseDetails = new FeedbackRubricResponseDetails(); + + responseDetails.setAnswer(Arrays.asList(1, Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN)); + assertTrue(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + + responseDetails.setAnswer(Arrays.asList(Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN, 0)); + assertTrue(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + + responseDetails.setAnswer(Arrays.asList(0, 0)); + assertTrue(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + } + + @Test + public void testValidateResponseDetails_invalidAnswer_shouldReturnNonEmptyErrorList() { + FeedbackRubricQuestionDetails rubricQuestionDetails = new FeedbackRubricQuestionDetails(); + rubricQuestionDetails.setHasAssignedWeights(false); + rubricQuestionDetails.setRubricWeightsForEachCell(new ArrayList<>()); + rubricQuestionDetails.setNumOfRubricChoices(2); + rubricQuestionDetails.setNumOfRubricSubQuestions(2); + rubricQuestionDetails.setRubricChoices(Arrays.asList("a", "b")); + rubricQuestionDetails.setRubricSubQuestions(Arrays.asList("q1", "q2")); + rubricQuestionDetails.setRubricDescriptions(Arrays.asList(Arrays.asList("d1", "d2"), Arrays.asList("d3", "d4"))); + + FeedbackRubricResponseDetails responseDetails = new FeedbackRubricResponseDetails(); + + responseDetails.setAnswer(Arrays.asList()); + assertFalse(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + + responseDetails.setAnswer(Arrays.asList(0)); + assertFalse(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + + responseDetails.setAnswer(Arrays.asList( + Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN, Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN)); + assertFalse(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + + responseDetails.setAnswer(Arrays.asList(0, -2)); + assertFalse(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + + responseDetails.setAnswer(Arrays.asList(2, 1)); + assertFalse(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + + responseDetails.setAnswer(Arrays.asList(0, 1, 0)); + assertFalse(rubricQuestionDetails.validateResponsesDetails(Collections.singletonList(responseDetails), 0).isEmpty()); + } + + @Test + public void testIsInstructorCommentsOnResponsesAllowed_shouldReturnTrue() { + FeedbackQuestionDetails feedbackQuestionDetails = new FeedbackRubricQuestionDetails(); + assertTrue(feedbackQuestionDetails.isInstructorCommentsOnResponsesAllowed()); + } + + @Test + public void testIsFeedbackParticipantCommentsOnResponsesAllowed_shouldReturnFalse() { + FeedbackQuestionDetails feedbackQuestionDetails = new FeedbackRubricQuestionDetails(); + assertFalse(feedbackQuestionDetails.isFeedbackParticipantCommentsOnResponsesAllowed()); + } +} diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackTextQuestionDetailsTest.java b/src/test/java/teammates/common/datatransfer/questions/FeedbackTextQuestionDetailsTest.java similarity index 75% rename from src/test/java/teammates/test/cases/datatransfer/FeedbackTextQuestionDetailsTest.java rename to src/test/java/teammates/common/datatransfer/questions/FeedbackTextQuestionDetailsTest.java index c67f01d2c8f..1735928fd53 100644 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackTextQuestionDetailsTest.java +++ b/src/test/java/teammates/common/datatransfer/questions/FeedbackTextQuestionDetailsTest.java @@ -1,10 +1,8 @@ -package teammates.test.cases.datatransfer; +package teammates.common.datatransfer.questions; import org.testng.annotations.Test; -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link FeedbackTextQuestionDetails}. diff --git a/src/test/java/teammates/common/datatransfer/questions/package-info.java b/src/test/java/teammates/common/datatransfer/questions/package-info.java new file mode 100644 index 00000000000..59f147d57c5 --- /dev/null +++ b/src/test/java/teammates/common/datatransfer/questions/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.common.datatransfer.questions} package. + */ +package teammates.common.datatransfer.questions; diff --git a/src/test/java/teammates/common/util/BuildPropertiesTest.java b/src/test/java/teammates/common/util/BuildPropertiesTest.java new file mode 100644 index 00000000000..25dbdc1c58d --- /dev/null +++ b/src/test/java/teammates/common/util/BuildPropertiesTest.java @@ -0,0 +1,17 @@ +package teammates.common.util; + +import org.testng.annotations.Test; + +import teammates.test.BaseTestCaseWithMinimalGaeEnvironment; + +/** + * SUT: {@link Config}. + */ +public class BuildPropertiesTest extends BaseTestCaseWithMinimalGaeEnvironment { + + @Test + public void checkPresence() { + assertNotNull(Config.APP_URL); + } + +} diff --git a/src/test/java/teammates/test/cases/util/FieldValidatorTest.java b/src/test/java/teammates/common/util/FieldValidatorTest.java similarity index 90% rename from src/test/java/teammates/test/cases/util/FieldValidatorTest.java rename to src/test/java/teammates/common/util/FieldValidatorTest.java index a20df808064..24b0c53444a 100644 --- a/src/test/java/teammates/test/cases/util/FieldValidatorTest.java +++ b/src/test/java/teammates/common/util/FieldValidatorTest.java @@ -1,16 +1,10 @@ -package teammates.test.cases.util; +package teammates.common.util; import java.time.Instant; import org.testng.annotations.Test; -import teammates.common.util.Const; -import teammates.common.util.FieldValidator; -import teammates.common.util.SanitizationHelper; -import teammates.common.util.StringHelper; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.StringHelperExtension; -import teammates.test.driver.TimeHelperExtension; +import teammates.test.BaseTestCase; /** * SUT: {@link FieldValidator}. @@ -41,8 +35,7 @@ public void testGetValidityInfoForNonHtmlField_unsanitizedInput_returnErrorStrin String actual = FieldValidator.getValidityInfoForNonHtmlField(testFieldName, unsanitizedInput); assertEquals("Invalid unsanitized input should return error string", "The provided Inconsequential test field name is not acceptable to TEAMMATES as it " - + "cannot contain the following special html characters in brackets: (< > " " - + "/ ' &)", + + "cannot contain the following special html characters in brackets: (< > \" / ' &)", actual); } @@ -114,7 +107,7 @@ public void testGetValidityInfoForAllowedName() { String nameContainInvalidChars = "Dr. Amy-Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;\"<>?)"; assertEquals("invalid: typical length with invalid characters", - "\"Dr. Amy-Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;"<>?)\" is " + "\"Dr. Amy-Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;\"<>?)\" is " + "not acceptable to TEAMMATES as a/an name field because it contains invalid " + "characters. A/An name field must start with an alphanumeric character, and cannot " + "contain any vertical bar (|) or percent sign (%).", @@ -125,7 +118,7 @@ public void testGetValidityInfoForAllowedName() { String nameStartedWithNonAlphaNumChar = "!Amy-Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;\"<>?)"; assertEquals("invalid: typical length with invalid characters", - "\"!Amy-Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;"<>?)\" is not " + "\"!Amy-Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;\"<>?)\" is not " + "acceptable to TEAMMATES as a/an name field because it starts with a " + "non-alphanumeric character. A/An name field must start with an alphanumeric " + "character, and cannot contain any vertical bar (|) or percent sign (%).", @@ -136,7 +129,7 @@ public void testGetValidityInfoForAllowedName() { String nameStartedWithBracesButHasInvalidChar = "{Amy} -Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;\"<>?)"; assertEquals("invalid: typical length with invalid characters", - "\"{Amy} -Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;"<>?)\" is not " + "\"{Amy} -Bén s/o O'&|% 2\t\n (~!@#$^*+_={}[]\\:;\"<>?)\" is not " + "acceptable to TEAMMATES as a/an name field because it contains invalid " + "characters. A/An name field must start with an alphanumeric character, and cannot " + "contain any vertical bar (|) or percent sign (%).", @@ -147,7 +140,7 @@ public void testGetValidityInfoForAllowedName() { String nameStartedWithCurlyBracketButHasNoEnd = "{Amy -Bén s/o O'&|% 2\t\n (~!@#$^*+_={[]\\:;\"<>?)"; assertEquals("invalid: typical length started with non-alphanumeric character", - "\"{Amy -Bén s/o O'&|% 2\t\n (~!@#$^*+_={[]\\:;"<>?)\" is not " + "\"{Amy -Bén s/o O'&|% 2\t\n (~!@#$^*+_={[]\\:;\"<>?)\" is not " + "acceptable to TEAMMATES as a/an name field because it starts with a " + "non-alphanumeric character. A/An name field must start with an alphanumeric " + "character, and cannot contain any vertical bar (|) or percent sign (%).", @@ -230,8 +223,7 @@ public void testGetInvalidityInfoForNationality_invalid_returnSpecificErrorStrin invalidNationality = ""; actual = FieldValidator.getInvalidityInfoForNationality(invalidNationality); assertEquals("Unsanitized, invalid nationality should return sanitized error string", - String.format(FieldValidator.NATIONALITY_ERROR_MESSAGE, SanitizationHelper.sanitizeForHtml( - invalidNationality)), actual); + String.format(FieldValidator.NATIONALITY_ERROR_MESSAGE, invalidNationality), actual); } @Test @@ -286,16 +278,6 @@ public void testGetInvalidityInfoForFeedbackSessionName_invalid_returnSpecificEr actual); } - @Test - public void testGetInvalidityInfoForEmailSubject_invalid_returnSpecificErrorString() { - String invalidEmailSubject = ""; - String actual = FieldValidator.getInvalidityInfoForEmailSubject(invalidEmailSubject); - assertEquals("Invalid email subject (empty) should return error message that is specific to email subject", - "The field 'email subject' is empty. The value of a/an email subject should be no longer than " - + "200 characters. It should not be empty.", - actual); - } - @Test public void testGetInvalidityInfoForRole_null_throwException() { assertThrows(AssertionError.class, () -> FieldValidator.getInvalidityInfoForRole(null)); @@ -319,8 +301,7 @@ public void testGetInvalidityInfoForRole_invalid_returnErrorString() { invalidRole = ""; actual = FieldValidator.getInvalidityInfoForRole(invalidRole); assertEquals("Unsanitized, invalid role should return appropriate error string", - String.format(FieldValidator.ROLE_ERROR_MESSAGE, SanitizationHelper.sanitizeForHtml(invalidRole)), - actual); + String.format(FieldValidator.ROLE_ERROR_MESSAGE, invalidRole), actual); } @Test @@ -347,7 +328,7 @@ public void testGetInvalidityInfoForGoogleId_valid_returnEmptyString() { assertEquals("Valid Google ID (typical email) should return empty string", "", FieldValidator.getInvalidityInfoForGoogleId(emailAsId)); - String shortEmailAsId = "e@y"; + String shortEmailAsId = "e@y.c"; assertEquals("Valid Google ID (short email) should return empty string", "", FieldValidator.getInvalidityInfoForGoogleId(shortEmailAsId)); @@ -397,7 +378,7 @@ public void testGetInvalidityInfoForGoogleId_invalid_returnErrorString() { String idWithInvalidHtmlChar = "invalid google id with HTML/< special characters"; assertEquals("Invalid Google ID (contains HTML characters) should return appropriate error message", - "\"invalid google id with HTML/< special characters\" is not acceptable to " + "\"invalid google id with HTML/< special characters\" is not acceptable to " + "TEAMMATES as a/an Google ID because it is not in the correct format. A Google ID " + "must be a valid id already registered with Google. It cannot be longer than 254 " + "characters, cannot be empty and cannot contain spaces.", @@ -415,7 +396,7 @@ public void testGetInvalidityInfoForEmail_valid_returnEmptyString() { assertEquals("Valid email (typical) should return empty string", "", FieldValidator.getInvalidityInfoForEmail(typicalEmail)); - String shortEmail = "e@y"; + String shortEmail = "e@y.c"; assertEquals("Valid email (short) should return empty string", "", FieldValidator.getInvalidityInfoForEmail(shortEmail)); @@ -429,8 +410,8 @@ public void testGetInvalidityInfoForEmail_invalid_returnErrorString() { String emptyEmail = ""; assertEquals("Invalid email (empty) should return appropriate error string", "The field 'email' is empty. An email address contains some text followed by one " - + "'@' sign followed by some more text. It cannot be longer than 254 " - + "characters, cannot be empty and cannot contain spaces.", + + "'@' sign followed by some more text, and should end with a top level domain address like " + + ".com. It cannot be longer than 254 characters, cannot be empty and cannot contain spaces.", FieldValidator.getInvalidityInfoForEmail(emptyEmail)); String untrimmedEmail = " untrimmed@email.com "; @@ -452,7 +433,8 @@ public void testGetInvalidityInfoForEmail_invalid_returnErrorString() { + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "aaaaaaaa@c.gov\" is not acceptable to TEAMMATES as a/an email because it is too " + "long. An email address contains some text followed by one '@' sign followed by " - + "some more text. It cannot be longer than 254 characters, cannot be empty and " + + "some more text, and should end with a top level domain address like .com. " + + "It cannot be longer than 254 characters, cannot be empty and " + "cannot contain spaces.", FieldValidator.getInvalidityInfoForEmail(tooLongEmail)); @@ -460,7 +442,8 @@ public void testGetInvalidityInfoForEmail_invalid_returnErrorString() { assertEquals("Invalid email (space character after '@') should return appropriate error string", "\"woMAN@com. sg\" is not acceptable to TEAMMATES as a/an email because it is not in " + "the correct format. An email address contains some text followed by one '@' sign " - + "followed by some more text. It cannot be longer than 254 characters, cannot be " + + "followed by some more text, and should end with a top level domain address like .com. " + + "It cannot be longer than 254 characters, cannot be " + "empty and cannot contain spaces.", FieldValidator.getInvalidityInfoForEmail(emailWithSpaceAfterAtSymbol)); @@ -468,7 +451,8 @@ public void testGetInvalidityInfoForEmail_invalid_returnErrorString() { assertEquals("Invalid email (space character before '@') should return appropriate error string", "\"man woman@com.sg\" is not acceptable to TEAMMATES as a/an email because it " + "is not in the correct format. An email address contains some text followed by " - + "one '@' sign followed by some more text. It cannot be longer than 254 " + + "one '@' sign followed by some more text, and should end with a top level domain address " + + "like .com. It cannot be longer than 254 " + "characters, cannot be empty and cannot contain spaces.", FieldValidator.getInvalidityInfoForEmail(emailWithSpaceBeforeAtSymbol)); @@ -476,31 +460,12 @@ public void testGetInvalidityInfoForEmail_invalid_returnErrorString() { assertEquals("Invalid email (multiple '@' characters) should return appropriate error string", "\"man@woman@com.lk\" is not acceptable to TEAMMATES as a/an email because it is not " + "in the correct format. An email address contains some text followed by one '@' " - + "sign followed by some more text. It cannot be longer than 254 characters, " + + "sign followed by some more text, and should end with a top level domain address like .com. " + + "It cannot be longer than 254 characters, " + "cannot be empty and cannot contain spaces.", FieldValidator.getInvalidityInfoForEmail(emailWithMultipleAtSymbol)); } - @Test - public void testGetInvalidityInfoForEmailContent_null_throwException() { - assertThrows(AssertionError.class, () -> FieldValidator.getInvalidityInfoForEmailContent(null)); - } - - @Test - public void testGetInvalidityInfoForEmailContent_invalid_returnEmptyString() { - String emptyEmailContent = ""; - assertEquals("Valid Email Content should return empty string", - FieldValidator.EMAIL_CONTENT_ERROR_MESSAGE, - FieldValidator.getInvalidityInfoForEmailContent(emptyEmailContent)); - } - - @Test - public void testGetInvalidityInfoForEmailContent_valid_returnEmptyString() { - String validEmailContent = "Hello! I'm a Email Content."; - assertEquals("Valid Email Content should return empty string", "", - FieldValidator.getInvalidityInfoForEmailContent(validEmailContent)); - } - @Test public void testGetInvalidityInfoForCourseId_null_throwException() { assertThrows(AssertionError.class, () -> FieldValidator.getInvalidityInfoForCourseId(null)); @@ -647,12 +612,16 @@ public void testRegexEmail() { String email = "john@email.com"; assertTrue(StringHelper.isMatching(email, FieldValidator.REGEX_EMAIL)); - ______TS("success: minimum allowed email format"); + ______TS("failure: no top level domain"); email = "a@e"; + assertFalse(StringHelper.isMatching(email, FieldValidator.REGEX_EMAIL)); + + ______TS("success: minimum allowed email format"); + email = "a@e.c"; assertTrue(StringHelper.isMatching(email, FieldValidator.REGEX_EMAIL)); ______TS("success: all allowed special characters"); - email = "a!#$%&'*/=?^_`{}~@e"; + email = "a!#$%&'*/=?^_`{}~@e.c"; assertTrue(StringHelper.isMatching(email, FieldValidator.REGEX_EMAIL)); ______TS("failure: invalid starting character"); @@ -687,17 +656,6 @@ public void testRegexCourseId() { assertFalse(StringHelper.isMatching(courseId, FieldValidator.REGEX_COURSE_ID)); } - @Test - public void testRegexSampleCourseId() { - ______TS("success: typical sample course ID"); - String courseId = "CS101-demo3"; - assertTrue(StringHelper.isMatching(courseId, FieldValidator.REGEX_SAMPLE_COURSE_ID)); - - ______TS("failure: non-demo course ID"); - courseId = "CS101"; - assertFalse(StringHelper.isMatching(courseId, FieldValidator.REGEX_SAMPLE_COURSE_ID)); - } - @Test public void testRegexGoogleIdNonEmail() { ______TS("success: typical google id"); diff --git a/src/test/java/teammates/common/util/JsonUtilsTest.java b/src/test/java/teammates/common/util/JsonUtilsTest.java new file mode 100644 index 00000000000..eb4cb51b643 --- /dev/null +++ b/src/test/java/teammates/common/util/JsonUtilsTest.java @@ -0,0 +1,106 @@ +package teammates.common.util; + +import java.util.ArrayList; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.FeedbackParticipantType; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; +import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; +import teammates.test.BaseTestCase; + +/** + * SUT: {@link JsonUtils}. + */ +public class JsonUtilsTest extends BaseTestCase { + + @Test + public void testFeedbackQuestionDetailsAdaptor_withComposedQuestionDetails_shouldSerializeToConcreteClass() { + FeedbackTextQuestionDetails questionDetails = new FeedbackTextQuestionDetails("Question text."); + + ArrayList participants = new ArrayList<>(); + participants.add(FeedbackParticipantType.OWN_TEAM_MEMBERS); + participants.add(FeedbackParticipantType.RECEIVER); + + FeedbackQuestionAttributes fqa = FeedbackQuestionAttributes.builder() + .withCourseId("testingCourse") + .withFeedbackSessionName("testFeedbackSession") + .withGiverType(FeedbackParticipantType.INSTRUCTORS) + .withRecipientType(FeedbackParticipantType.SELF) + .withNumberOfEntitiesToGiveFeedbackTo(Const.MAX_POSSIBLE_RECIPIENTS) + .withQuestionNumber(1) + .withQuestionDetails(questionDetails) + .withShowGiverNameTo(participants) + .withShowRecipientNameTo(participants) + .withShowResponsesTo(participants) + .build(); + + assertEquals("{\n" + + " \"feedbackSessionName\": \"testFeedbackSession\",\n" + + " \"courseId\": \"testingCourse\",\n" + + " \"questionDetails\": {\n" + + " \"questionType\": \"TEXT\",\n" + + " \"questionText\": \"Question text.\"\n" + + " },\n" + + " \"questionNumber\": 1,\n" + + " \"giverType\": \"INSTRUCTORS\",\n" + + " \"recipientType\": \"SELF\",\n" + + " \"numberOfEntitiesToGiveFeedbackTo\": -100,\n" + + " \"showResponsesTo\": [\n" + + " \"RECEIVER\"\n" + + " ],\n" + + " \"showGiverNameTo\": [\n" + + " \"RECEIVER\"\n" + + " ],\n" + + " \"showRecipientNameTo\": [\n" + + " \"RECEIVER\"\n" + + " ]\n" + + "}", JsonUtils.toJson(fqa)); + + assertEquals("{\"feedbackSessionName\":\"testFeedbackSession\"," + + "\"courseId\":\"testingCourse\",\"questionDetails\":{\"questionType\":\"TEXT\"," + + "\"questionText\":\"Question text.\"},\"questionNumber\":1," + + "\"giverType\":\"INSTRUCTORS\",\"recipientType\":\"SELF\",\"numberOfEntitiesToGiveFeedbackTo\":-100," + + "\"showResponsesTo\":[\"RECEIVER\"],\"showGiverNameTo\":[\"RECEIVER\"]," + + "\"showRecipientNameTo\":[\"RECEIVER\"]}", + JsonUtils.toCompactJson(fqa)); + } + + @Test + public void testFeedbackResponseDetailsAdaptor_withComposedResponseDetails_shouldSerializeToConcreteClass() { + FeedbackResponseAttributes fra = + FeedbackResponseAttributes.builder( + "questionId", "giver@email.com", "recipient@email.com") + .withFeedbackSessionName("Session1") + .withCourseId("CS3281") + .withGiverSection("giverSection") + .withRecipientSection("recipientSection") + .withResponseDetails(new FeedbackTextResponseDetails("My answer")) + .build(); + + assertEquals("{\n" + + " \"feedbackQuestionId\": \"questionId\",\n" + + " \"giver\": \"giver@email.com\",\n" + + " \"recipient\": \"recipient@email.com\",\n" + + " \"feedbackSessionName\": \"Session1\",\n" + + " \"courseId\": \"CS3281\",\n" + + " \"responseDetails\": {\n" + + " \"answer\": \"My answer\",\n" + + " \"questionType\": \"TEXT\"\n" + + " },\n" + + " \"giverSection\": \"giverSection\",\n" + + " \"recipientSection\": \"recipientSection\",\n" + + " \"feedbackResponseId\": \"questionId%giver@email.com%recipient@email.com\"\n" + + "}", JsonUtils.toJson(fra)); + + assertEquals("{\"feedbackQuestionId\":\"questionId\",\"giver\":\"giver@email.com\"," + + "\"recipient\":\"recipient@email.com\",\"feedbackSessionName\":\"Session1\"," + + "\"courseId\":\"CS3281\",\"responseDetails\":{\"answer\":\"My answer\"," + + "\"questionType\":\"TEXT\"},\"giverSection\":\"giverSection\"," + + "\"recipientSection\":\"recipientSection\"," + + "\"feedbackResponseId\":\"questionId%giver@email.com%recipient@email.com\"}", + JsonUtils.toCompactJson(fra)); + } +} diff --git a/src/test/java/teammates/test/cases/util/RecaptchaVerifierTest.java b/src/test/java/teammates/common/util/RecaptchaVerifierTest.java similarity index 97% rename from src/test/java/teammates/test/cases/util/RecaptchaVerifierTest.java rename to src/test/java/teammates/common/util/RecaptchaVerifierTest.java index 91b7d0ec641..3bc7aa06f10 100644 --- a/src/test/java/teammates/test/cases/util/RecaptchaVerifierTest.java +++ b/src/test/java/teammates/common/util/RecaptchaVerifierTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.util; +package teammates.common.util; import java.io.IOException; import java.net.URISyntaxException; @@ -8,8 +8,7 @@ import org.apache.http.conn.ConnectTimeoutException; import org.testng.annotations.Test; -import teammates.common.util.RecaptchaVerifier; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link RecaptchaVerifier}. diff --git a/src/test/java/teammates/test/cases/util/SanitizationHelperTest.java b/src/test/java/teammates/common/util/SanitizationHelperTest.java similarity index 61% rename from src/test/java/teammates/test/cases/util/SanitizationHelperTest.java rename to src/test/java/teammates/common/util/SanitizationHelperTest.java index 64fd78f8df2..e97d24eeff6 100644 --- a/src/test/java/teammates/test/cases/util/SanitizationHelperTest.java +++ b/src/test/java/teammates/common/util/SanitizationHelperTest.java @@ -1,15 +1,8 @@ -package teammates.test.cases.util; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +package teammates.common.util; import org.testng.annotations.Test; -import teammates.common.util.SanitizationHelper; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link SanitizationHelper}. @@ -53,23 +46,6 @@ public void testSanitizeTextField() { // tested as email } - @Test - public void testSanitizeForJs() { - sanitizeJs_receivesNull_returnsNull(); - sanitizeJs_receivesUnsanitized_returnsSanitized(); - } - - private void sanitizeJs_receivesNull_returnsNull() { - assertNull(SanitizationHelper.sanitizeForJs(null)); - } - - private void sanitizeJs_receivesUnsanitized_returnsSanitized() { - String unsanitized = "\\ \" ' #"; // i.e., [\ " ' #] - String expected = "\\\\ \\" \\' \\#"; // i.e., [\\ \" \' \#] - String sanitized = SanitizationHelper.sanitizeForJs(unsanitized); - assertEquals(expected, sanitized); - } - @Test public void testSanitizeForHtml() { sanitizeHtml_receivesNull_returnsNull(); @@ -96,21 +72,6 @@ private void sanitizeHtml_receivesSanitized_returnsUnchanged() { assertEquals(sanitized, SanitizationHelper.sanitizeForHtml(sanitized)); } - @Test - public void testSanitizeForHtmlList() { - List unsanitizedHtml = new ArrayList<>(Arrays.asList( - "apple <", "banana ' dogs ", "rollercoasters & tycoons", "", null) - ); - - List sanitizedHtml = new ArrayList<>(Arrays.asList( - "apple <", "banana ' dogs ", "rollercoasters & tycoons", "", null) - ); - - assertEquals(sanitizedHtml, SanitizationHelper.sanitizeForHtml(unsanitizedHtml)); - assertEquals(new ArrayList<>(), SanitizationHelper.sanitizeForHtml(new ArrayList<>())); - assertNull(SanitizationHelper.sanitizeForHtml((List) null)); - } - @Test public void testDesanitizeFromHtml() { desanitizeFromHtml_receivesNull_returnsNull(); @@ -133,37 +94,6 @@ private void desanitizeFromHtml_receivesSanitized_returnsDesanitized() { assertEquals(text, SanitizationHelper.desanitizeFromHtml(sanitizedText)); } - @Test - public void testDesanitizeFromHtmlSet() { - Set sanitizedHtml = new HashSet<>(Arrays.asList( - "apple <", "banana ' dogs ", "rollercoasters & tycoons", "", null) - ); - Set desanitizedHtml = new HashSet<>(Arrays.asList( - "apple <", "banana ' dogs ", "rollercoasters & tycoons", "", null) - ); - - assertEquals(desanitizedHtml, SanitizationHelper.desanitizeFromHtml(sanitizedHtml)); - assertEquals(new HashSet<>(), SanitizationHelper.desanitizeFromHtml(new HashSet<>())); - assertNull(SanitizationHelper.desanitizeFromHtml((Set) null)); - } - - @Test - public void testSanitizeForHtmlTag() { - sanitizeHtmlTag_receivesNull_returnsNull(); - sanitizeHtmlTag_receivesHtml_returnsSanitized(); - } - - private void sanitizeHtmlTag_receivesHtml_returnsSanitized() { - String unsanitized = "

    <
    "; - String expected = "<div><td><</td></div>"; - String sanitized = SanitizationHelper.sanitizeForHtmlTag(unsanitized); - assertEquals(expected, sanitized); - } - - private void sanitizeHtmlTag_receivesNull_returnsNull() { - assertNull(SanitizationHelper.sanitizeForHtmlTag(null)); - } - @Test public void testSanitizeForRichText() { assertNull(SanitizationHelper.sanitizeForRichText((String) null)); @@ -215,69 +145,6 @@ public void testSanitizeForRichText() { assertEquals(expectedRichText, sanitized); } - @Test - public void testSanitizeForNextUrl() { - sanitizeForNextUrl_receivesNull_returnsNull(); - sanitizeForNextUrl_receivesUrl_returnsSanitizedUrl(); - } - - private void sanitizeForNextUrl_receivesNull_returnsNull() { - assertNull(SanitizationHelper.sanitizeForNextUrl(null)); - } - - private void sanitizeForNextUrl_receivesUrl_returnsSanitizedUrl() { - String url = "/page/studentCourseJoinAuthenticated?key=FF6266" - + "&next=/page/studentHomePage%23/encodedHashHere%2B/encodedPlusHere"; - String expected = "/page/studentCourseJoinAuthenticated?key=FF6266$" - + "{amp}next=/page/studentHomePage${hash}/encodedHashHere${plus}/encodedPlusHere"; - assertEquals(expected, SanitizationHelper.sanitizeForNextUrl(url)); - } - - @Test - public void testDesanitizeFromNextUrl() { - desanitizeFromNextUrl_receivesNull_returnsNull(); - desanitizeFromNextUrl_receivesSanitized_returnsDesanitized(); - } - - private void desanitizeFromNextUrl_receivesNull_returnsNull() { - assertNull(SanitizationHelper.desanitizeFromNextUrl(null)); - } - - private void desanitizeFromNextUrl_receivesSanitized_returnsDesanitized() { - String expected = "/page/studentCourseJoinAuthenticated?key=FF6266" - + "&next=/page/studentHomePage%23/encodedHashHere%2B/encodedPlusHere"; - String sanitizedUrl = SanitizationHelper.sanitizeForNextUrl(expected); - assertEquals(expected, SanitizationHelper.desanitizeFromNextUrl(sanitizedUrl)); - - sanitizedUrl = "/page/studentCourseDetailsPage?user=USERNAME" - + "${amp}courseid=CS2103-Aug2016${hash}/encodedHashHere${plus}/encodedPlusHere" - + " /plusHere"; - expected = "/page/studentCourseDetailsPage?user=USERNAME" - + "&courseid=CS2103-Aug2016%23/encodedHashHere%2B/encodedPlusHere" - + "+/plusHere"; - assertEquals(expected, SanitizationHelper.desanitizeFromNextUrl(sanitizedUrl)); - } - - @Test - public void testSanitizeStringForXPath() { - String text = ""; - String expected = "''"; - assertEquals(expected, SanitizationHelper.sanitizeStringForXPath(text)); - - text = "Will o' The Wisp"; - expected = "concat('Will o',\"'\",' The Wisp','')"; - assertEquals(expected, SanitizationHelper.sanitizeStringForXPath(text)); - - text = "'''''Will o''''' The''''' Wisp"; - expected = "concat(\"'''''\",'Will o',\"'''''\",' The',\"'''''\",' Wisp','')"; - assertEquals(expected, SanitizationHelper.sanitizeStringForXPath(text)); - - text = "Team 1'\""; - expected = "concat('Team 1',\"'\",'\"','')"; - assertEquals(expected, SanitizationHelper.sanitizeStringForXPath(text)); - - } - @Test public void testIsSanitizedHtml() { assertFalse("should return false if string is null", diff --git a/src/test/java/teammates/test/driver/StringHelperExtension.java b/src/test/java/teammates/common/util/StringHelperExtension.java similarity index 86% rename from src/test/java/teammates/test/driver/StringHelperExtension.java rename to src/test/java/teammates/common/util/StringHelperExtension.java index cc4c1e7a052..6cfac3f468c 100644 --- a/src/test/java/teammates/test/driver/StringHelperExtension.java +++ b/src/test/java/teammates/common/util/StringHelperExtension.java @@ -1,6 +1,4 @@ -package teammates.test.driver; - -import teammates.common.util.StringHelper; +package teammates.common.util; /** * Holds additional methods for {@link StringHelper} used only in tests. diff --git a/src/test/java/teammates/test/cases/util/StringHelperTest.java b/src/test/java/teammates/common/util/StringHelperTest.java similarity index 70% rename from src/test/java/teammates/test/cases/util/StringHelperTest.java rename to src/test/java/teammates/common/util/StringHelperTest.java index 8d3517f4501..23dae46ac9a 100644 --- a/src/test/java/teammates/test/cases/util/StringHelperTest.java +++ b/src/test/java/teammates/common/util/StringHelperTest.java @@ -1,8 +1,6 @@ -package teammates.test.cases.util; +package teammates.common.util; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; import java.util.List; import javax.crypto.Cipher; @@ -12,9 +10,7 @@ import org.testng.annotations.Test; import teammates.common.exception.InvalidParametersException; -import teammates.common.util.Config; -import teammates.common.util.StringHelper; -import teammates.test.cases.BaseTestCase; +import teammates.test.BaseTestCase; /** * SUT: {@link StringHelper}. @@ -36,21 +32,6 @@ public void testGenerateStringOfLength() { assertEquals("", StringHelper.generateStringOfLength(0, 's')); } - @Test - public void testIsWhiteSpace() { - - assertTrue(StringHelper.isWhiteSpace("")); - assertTrue(StringHelper.isWhiteSpace(" ")); - assertTrue(StringHelper.isWhiteSpace("\t\n\t")); - assertTrue(StringHelper.isWhiteSpace(System.lineSeparator())); - assertTrue(StringHelper.isWhiteSpace(System.lineSeparator() + " ")); - } - - @Test - public void testIsWhiteSpaceNull() { - assertThrows(NullPointerException.class, () -> StringHelper.isWhiteSpace(null)); - } - @Test public void testIsMatching() { assertTrue(StringHelper.isMatching("\u00E0", "à")); @@ -239,19 +220,6 @@ public void testReplaceIllegalChars() { assertEquals("illegal..Chars.1", StringHelper.replaceIllegalChars(str, regex, '.')); } - @Test - public void testCountEmptyStrings() { - String empty = ""; - String whitespace = " "; - String nul = null; - String nonEmpty = "non-empty"; - assertEquals(1, StringHelper.countEmptyStrings(empty)); - assertEquals(0, StringHelper.countEmptyStrings(whitespace)); - assertEquals(1, StringHelper.countEmptyStrings(nul)); - assertEquals(0, StringHelper.countEmptyStrings(nonEmpty)); - assertEquals(2, StringHelper.countEmptyStrings(empty, whitespace, nul, nonEmpty)); - } - @Test public void testConvertToEmptyStringIfNull() { String empty = ""; @@ -263,13 +231,6 @@ public void testConvertToEmptyStringIfNull() { assertEquals(" ", StringHelper.convertToEmptyStringIfNull(whitespace)); } - @Test - public void testTruncate() { - assertEquals("1234567...", StringHelper.truncate("1234567890xxxx", 10)); - assertEquals("1234567890", StringHelper.truncate("1234567890", 10)); - assertEquals("123456789", StringHelper.truncate("123456789", 10)); - } - @Test public void testTruncateHead() { assertEquals("1234567890", StringHelper.truncateHead("xxxx1234567890", 10)); @@ -278,77 +239,6 @@ public void testTruncateHead() { assertEquals("567890", StringHelper.truncateHead("1234567890", 6)); } - @Test - public void testRemoveEnclosingSquareBrackets() { - // typical case - assertEquals("test1, test2", StringHelper.removeEnclosingSquareBrackets("[test1, test2]")); - - // input multiple square brackets, expected outermost brackets removed - assertEquals("[ \"test\" ]", StringHelper.removeEnclosingSquareBrackets("[[ \"test\" ]]")); - - // input nested square brackets, expected outermost brackets removed - assertEquals("test1, [], ] test2", - StringHelper.removeEnclosingSquareBrackets("[test1, [], ] test2]")); - - // input no square brackets, expected same input string - assertEquals("test", StringHelper.removeEnclosingSquareBrackets("test")); - assertEquals(" test ", StringHelper.removeEnclosingSquareBrackets(" test ")); - - // input unmatched brackets, expected same input string - assertEquals("[test", StringHelper.removeEnclosingSquareBrackets("[test")); - assertEquals("(test]", StringHelper.removeEnclosingSquareBrackets("(test]")); - - // input empty string, expected empty string - assertEquals("", StringHelper.removeEnclosingSquareBrackets("")); - - // input null, expected null - assertNull(StringHelper.removeEnclosingSquareBrackets(null)); - } - - @Test - public void testTrim() { - String[] input = {" apple tea", "banana ", " carrot cake ", "magnesium & hydroxide -"}; - String[] expected = {"apple tea", "banana", "carrot cake", "magnesium & hydroxide -"}; - assertArrayEquals(expected, StringHelper.trim(input)); - } - - @Test - public void testTrimWithNullString() { - String[] input = {" apple tea", "banana ", " carrot cake ", null}; - assertThrows(NullPointerException.class, () -> StringHelper.trim(input)); - } - - @Test - public void testToLowerCase() { - String[] input = {"thisIsInCamelCase", "anotherInCamelCase", "googleId", "", "alreadylowercase", "ALLUPPERCASE"}; - String[] expected = {"thisisincamelcase", "anotherincamelcase", "googleid", "", "alreadylowercase", "alluppercase"}; - assertArrayEquals(expected, StringHelper.toLowerCase(input)); - } - - @Test - public void testRemoveNonAscii() { - assertEquals("Hello world!", StringHelper.removeNonAscii("Hello world!")); - - assertEquals("", StringHelper.removeNonAscii("©¡¢â")); - - assertEquals("Coevaluacin Prctica (Part 1)", - StringHelper.removeNonAscii("Coevaluación Práctica (Part 1)")); - } - - @Test - public void testJoinWithListOfIntegers() { - assertEquals("", StringHelper.join(",", new ArrayList<>())); - assertEquals("5", StringHelper.join(",", Collections.singletonList(5))); - assertEquals("5,14", StringHelper.join(",", Arrays.asList(5, 14))); - assertEquals("5||14", StringHelper.join("||", Arrays.asList(5, 14))); - assertEquals("5||14||null", StringHelper.join("||", Arrays.asList(5, 14, null))); - } - - @Test - public void testJoinWithNullElements() { - assertThrows(IllegalArgumentException.class, () -> StringHelper.join(",", (List) null)); - } - @Test public void testIsTextContainingAny() { assertFalse("null text should return false", StringHelper.isTextContainingAny(null)); diff --git a/src/test/java/teammates/common/util/TimeHelperExtension.java b/src/test/java/teammates/common/util/TimeHelperExtension.java new file mode 100644 index 00000000000..2e74772d43b --- /dev/null +++ b/src/test/java/teammates/common/util/TimeHelperExtension.java @@ -0,0 +1,42 @@ +package teammates.common.util; + +import java.time.Duration; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; + +/** + * Holds additional methods for {@link teammates.common.util.TimeHelper} used only in tests. + */ +public final class TimeHelperExtension { + + private TimeHelperExtension() { + // utility class + } + + /** + * Returns an java.time.Instant object that is offset by a number of minutes from now. + * @param offsetInMinutes number of minutes offset by (integer). + * @return java.time.Instant offset by offsetInMinutes minutes from now. + */ + public static Instant getInstantMinutesOffsetFromNow(long offsetInMinutes) { + return Instant.now().plus(Duration.ofMinutes(offsetInMinutes)); + } + + /** + * Returns an java.time.Instant object that is offset by a number of hours from now. + * @param offsetInHours number of hours offset by (integer). + * @return java.time.Instant offset by offsetInHours hours from now. + */ + public static Instant getInstantHoursOffsetFromNow(long offsetInHours) { + return Instant.now().plus(Duration.ofHours(offsetInHours)); + } + + /** + * Converts the {@code Instant} at the specified {@code timeZone} to {@code localDateTime}. + */ + public static LocalDateTime convertInstantToLocalDateTime(Instant instant, ZoneId timeZoneId) { + return instant == null ? null : instant.atZone(timeZoneId).toLocalDateTime(); + } + +} diff --git a/src/test/java/teammates/common/util/TimeHelperTest.java b/src/test/java/teammates/common/util/TimeHelperTest.java new file mode 100644 index 00000000000..41d937754fb --- /dev/null +++ b/src/test/java/teammates/common/util/TimeHelperTest.java @@ -0,0 +1,40 @@ +package teammates.common.util; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.Month; +import java.time.ZoneId; + +import org.testng.annotations.Test; + +import teammates.test.BaseTestCase; + +/** + * SUT: {@link TimeHelper}. + */ +public class TimeHelperTest extends BaseTestCase { + + private static final String DATETIME_DISPLAY_FORMAT = "EEE, dd MMM yyyy, hh:mm a z"; + + @Test + public void testEndOfYearDates() { + LocalDateTime date = LocalDateTime.of(2015, Month.DECEMBER, 30, 12, 0); + assertEquals("Wed, 30 Dec 2015, 12:00 NOON UTC", TimeHelper.formatInstant( + date.atZone(ZoneId.of("UTC")).toInstant(), ZoneId.of("UTC"), DATETIME_DISPLAY_FORMAT)); + } + + @Test + public void testFormatDateTimeForDisplay() { + ZoneId zoneId = ZoneId.of("UTC"); + Instant instant = LocalDateTime.of(2015, Month.NOVEMBER, 30, 12, 0).atZone(zoneId).toInstant(); + assertEquals("Mon, 30 Nov 2015, 12:00 NOON UTC", TimeHelper.formatInstant(instant, zoneId, DATETIME_DISPLAY_FORMAT)); + + zoneId = ZoneId.of("Asia/Singapore"); + instant = LocalDateTime.of(2015, Month.NOVEMBER, 30, 16, 0).atZone(zoneId).toInstant(); + assertEquals("Mon, 30 Nov 2015, 04:00 PM SGT", TimeHelper.formatInstant(instant, zoneId, DATETIME_DISPLAY_FORMAT)); + + instant = LocalDateTime.of(2015, Month.NOVEMBER, 30, 4, 0).atZone(zoneId).toInstant(); + assertEquals("Mon, 30 Nov 2015, 04:00 AM SGT", TimeHelper.formatInstant(instant, zoneId, DATETIME_DISPLAY_FORMAT)); + } + +} diff --git a/src/test/java/teammates/test/driver/UrlExtension.java b/src/test/java/teammates/common/util/UrlExtension.java similarity index 74% rename from src/test/java/teammates/test/driver/UrlExtension.java rename to src/test/java/teammates/common/util/UrlExtension.java index a24d9ed4f88..5a83b4b8117 100644 --- a/src/test/java/teammates/test/driver/UrlExtension.java +++ b/src/test/java/teammates/common/util/UrlExtension.java @@ -1,10 +1,8 @@ -package teammates.test.driver; +package teammates.common.util; import java.net.MalformedURLException; import java.net.URL; -import teammates.common.util.Url; - /** * Holds additional methods for {@link Url} used only in tests. */ @@ -23,4 +21,11 @@ public static String getRelativePath(String url) throws MalformedURLException { return new Url(url).toString(); } + /** + * Trims trailing slash from a URL. + */ + public static String trimTrailingSlash(String url) { + return url.trim().replaceAll("/(?=$)", ""); + } + } diff --git a/src/test/java/teammates/test/cases/util/UrlTest.java b/src/test/java/teammates/common/util/UrlTest.java similarity index 89% rename from src/test/java/teammates/test/cases/util/UrlTest.java rename to src/test/java/teammates/common/util/UrlTest.java index a6ade335c88..c5d90ed356a 100644 --- a/src/test/java/teammates/test/cases/util/UrlTest.java +++ b/src/test/java/teammates/common/util/UrlTest.java @@ -1,24 +1,20 @@ -package teammates.test.cases.util; +package teammates.common.util; import org.testng.annotations.Test; -import teammates.common.util.AppUrl; -import teammates.common.util.SanitizationHelper; -import teammates.common.util.Url; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.UrlExtension; +import teammates.test.BaseTestCase; /** - * SUT: {@link Url}, + * SUT: {@link Url}, {@link UrlExtension}, * {@link AppUrl}. */ public class UrlTest extends BaseTestCase { @Test public void testTrimTrailingSlash() { - assertEquals("abc.com", Url.trimTrailingSlash("abc.com/")); - assertEquals("abc.com", Url.trimTrailingSlash("abc.com/ ")); - assertEquals("abc.com", Url.trimTrailingSlash("abc.com")); + assertEquals("abc.com", UrlExtension.trimTrailingSlash("abc.com/")); + assertEquals("abc.com", UrlExtension.trimTrailingSlash("abc.com/ ")); + assertEquals("abc.com", UrlExtension.trimTrailingSlash("abc.com")); } @Test diff --git a/src/test/java/teammates/common/util/package-info.java b/src/test/java/teammates/common/util/package-info.java new file mode 100644 index 00000000000..f2a0b485c25 --- /dev/null +++ b/src/test/java/teammates/common/util/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.common.util} package. + */ +package teammates.common.util; diff --git a/src/test/java/teammates/test/cases/logic/BaseLogicTest.java b/src/test/java/teammates/logic/api/BaseLogicTest.java similarity index 84% rename from src/test/java/teammates/test/cases/logic/BaseLogicTest.java rename to src/test/java/teammates/logic/api/BaseLogicTest.java index f15ee9f5971..c6031261176 100644 --- a/src/test/java/teammates/test/cases/logic/BaseLogicTest.java +++ b/src/test/java/teammates/logic/api/BaseLogicTest.java @@ -1,9 +1,9 @@ -package teammates.test.cases.logic; +package teammates.logic.api; import org.testng.annotations.BeforeClass; import teammates.common.datatransfer.DataBundle; -import teammates.test.cases.BaseComponentTestCase; +import teammates.test.BaseComponentTestCase; /** * Base class for all *Logic tests. diff --git a/src/test/java/teammates/test/cases/logic/EmailGeneratorTest.java b/src/test/java/teammates/logic/api/EmailGeneratorTest.java similarity index 95% rename from src/test/java/teammates/test/cases/logic/EmailGeneratorTest.java rename to src/test/java/teammates/logic/api/EmailGeneratorTest.java index 1b2d76bd004..a8f67b15250 100644 --- a/src/test/java/teammates/test/cases/logic/EmailGeneratorTest.java +++ b/src/test/java/teammates/logic/api/EmailGeneratorTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.api; import java.io.IOException; import java.time.Instant; @@ -25,12 +25,12 @@ import teammates.common.util.StringHelper; import teammates.common.util.Templates; import teammates.common.util.TimeHelper; -import teammates.logic.api.EmailGenerator; +import teammates.common.util.TimeHelperExtension; import teammates.logic.core.CoursesLogic; import teammates.logic.core.FeedbackSessionsLogic; import teammates.logic.core.InstructorsLogic; import teammates.logic.core.StudentsLogic; -import teammates.test.driver.EmailChecker; +import teammates.test.EmailChecker; /** * SUT: {@link EmailGenerator}. @@ -57,7 +57,7 @@ public void prepareTestData() { // closed and unpublished session2InCourse3.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-19)); session2InCourse3.setEndTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); - session2InCourse3.resetDeletedTime(); + session2InCourse3.setDeletedTime(null); dataBundle.feedbackSessions.put("session2InCourse3", session2InCourse3); // opened and published. @@ -169,7 +169,7 @@ public void testGenerateFeedbackSessionEmails() throws IOException { "/sessionReminderEmailCopyToInstructor.html", lineInEmailCopyToInstructor); // Verify the instructor reminder email String lineInEmailToInstructor = - "/web/instructor/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session"; + "/web/instructor/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session"; verifyEmailReceivedCorrectly(emails, instructor1.email, subject, "/sessionReminderEmailForInstructor.html", lineInEmailToInstructor); @@ -614,16 +614,23 @@ public void testGenerateCompiledLogsEmail() throws IOException { verifyEmail(email, Config.SUPPORT_EMAIL, subject, "/severeLogsCompilationEmail.html"); } + private static Instant convertLocalDateTimeToInstant(LocalDateTime localDateTime, ZoneId timeZone) { + return localDateTime == null ? null : localDateTime.atZone(timeZone).toInstant(); + } + private void setTimeZoneButMaintainLocalDate(FeedbackSessionAttributes session, ZoneId newTimeZone) { - LocalDateTime localStart = session.getStartTimeLocal(); - LocalDateTime localEnd = session.getEndTimeLocal(); - LocalDateTime localSessionVisibleFrom = session.getSessionVisibleFromTimeLocal(); - LocalDateTime localResultsVisibleFrom = session.getResultsVisibleFromTimeLocal(); + ZoneId oldTimeZone = session.getTimeZone(); + LocalDateTime localStart = TimeHelperExtension.convertInstantToLocalDateTime(session.getStartTime(), oldTimeZone); + LocalDateTime localEnd = TimeHelperExtension.convertInstantToLocalDateTime(session.getEndTime(), oldTimeZone); + LocalDateTime localSessionVisibleFrom = + TimeHelperExtension.convertInstantToLocalDateTime(session.getSessionVisibleFromTime(), oldTimeZone); + LocalDateTime localResultsVisibleFrom = TimeHelperExtension.convertInstantToLocalDateTime( + session.getResultsVisibleFromTime(), oldTimeZone); session.setTimeZone(newTimeZone); - session.setStartTime(TimeHelper.convertLocalDateTimeToInstant(localStart, newTimeZone)); - session.setEndTime(TimeHelper.convertLocalDateTimeToInstant(localEnd, newTimeZone)); - session.setSessionVisibleFromTime(TimeHelper.convertLocalDateTimeToInstant(localSessionVisibleFrom, newTimeZone)); - session.setResultsVisibleFromTime(TimeHelper.convertLocalDateTimeToInstant(localResultsVisibleFrom, newTimeZone)); + session.setStartTime(convertLocalDateTimeToInstant(localStart, newTimeZone)); + session.setEndTime(convertLocalDateTimeToInstant(localEnd, newTimeZone)); + session.setSessionVisibleFromTime(convertLocalDateTimeToInstant(localSessionVisibleFrom, newTimeZone)); + session.setResultsVisibleFromTime(convertLocalDateTimeToInstant(localResultsVisibleFrom, newTimeZone)); } private void verifyEmail(EmailWrapper email, String recipient, String subject, String emailContentFilePath) diff --git a/src/test/java/teammates/test/cases/logic/EmailSenderTest.java b/src/test/java/teammates/logic/api/EmailSenderTest.java similarity index 99% rename from src/test/java/teammates/test/cases/logic/EmailSenderTest.java rename to src/test/java/teammates/logic/api/EmailSenderTest.java index 3196a7bfc35..53c0d50d68a 100644 --- a/src/test/java/teammates/test/cases/logic/EmailSenderTest.java +++ b/src/test/java/teammates/logic/api/EmailSenderTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.api; import javax.mail.Message; import javax.mail.internet.InternetAddress; diff --git a/src/test/java/teammates/test/cases/logic/GateKeeperTest.java b/src/test/java/teammates/logic/api/GateKeeperTest.java similarity index 92% rename from src/test/java/teammates/test/cases/logic/GateKeeperTest.java rename to src/test/java/teammates/logic/api/GateKeeperTest.java index b409223cc6d..fecff954feb 100644 --- a/src/test/java/teammates/test/cases/logic/GateKeeperTest.java +++ b/src/test/java/teammates/logic/api/GateKeeperTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.api; import org.testng.annotations.Test; @@ -6,8 +6,6 @@ import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.logic.api.GateKeeper; -import teammates.logic.core.StudentsLogic; /** * SUT: {@link GateKeeper}. @@ -47,7 +45,7 @@ public void testGetCurrentUser() throws Exception { .withComment("") .build(); instructorAsStudent.googleId = instructor.googleId; - StudentsLogic.inst().createStudent(instructorAsStudent); + logic.createStudent(instructorAsStudent); UserInfo user = gateKeeper.getCurrentUser(); assertEquals(instructor.googleId, user.id); diff --git a/src/test/java/teammates/logic/api/LogicExtension.java b/src/test/java/teammates/logic/api/LogicExtension.java new file mode 100644 index 00000000000..fd10b8fc57a --- /dev/null +++ b/src/test/java/teammates/logic/api/LogicExtension.java @@ -0,0 +1,43 @@ +package teammates.logic.api; + +import java.time.Instant; +import java.util.List; + +import teammates.common.datatransfer.AttributesDeletionQuery; +import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; +import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; + +/** + * Holds additional methods for {@link Logic} used only in tests. + */ +public class LogicExtension extends Logic { + + public FeedbackQuestionAttributes getFeedbackQuestion( + String feedbackSessionName, String courseId, int questionNumber) { + return feedbackQuestionsLogic.getFeedbackQuestion(feedbackSessionName, courseId, questionNumber); + } + + public FeedbackResponseAttributes getFeedbackResponse( + String feedbackQuestionId, String giverEmail, String recipient) { + return feedbackResponsesLogic.getFeedbackResponse(feedbackQuestionId, giverEmail, recipient); + } + + public FeedbackResponseCommentAttributes getFeedbackResponseComment( + String responseId, String giverEmail, Instant creationDate) { + return feedbackResponseCommentsLogic.getFeedbackResponseComment(responseId, giverEmail, creationDate); + } + + public List getFeedbackResponseCommentForResponse(String responseId) { + return feedbackResponseCommentsLogic.getFeedbackResponseCommentForResponse(responseId); + } + + public void deleteFeedbackResponseComments(AttributesDeletionQuery query) { + feedbackResponseCommentsLogic.deleteFeedbackResponseComments(query); + } + + public List getFeedbackResponsesForQuestion(String feedbackQuestionId) { + return feedbackResponsesLogic.getFeedbackResponsesForQuestion(feedbackQuestionId); + } + +} diff --git a/src/test/java/teammates/logic/api/package-info.java b/src/test/java/teammates/logic/api/package-info.java new file mode 100644 index 00000000000..a18d31dc77b --- /dev/null +++ b/src/test/java/teammates/logic/api/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.logic.api} package. + */ +package teammates.logic.api; diff --git a/src/test/java/teammates/test/cases/logic/AccountsLogicTest.java b/src/test/java/teammates/logic/core/AccountsLogicTest.java similarity index 88% rename from src/test/java/teammates/test/cases/logic/AccountsLogicTest.java rename to src/test/java/teammates/logic/core/AccountsLogicTest.java index b9764b6d4b5..0bba1093142 100644 --- a/src/test/java/teammates/test/cases/logic/AccountsLogicTest.java +++ b/src/test/java/teammates/logic/core/AccountsLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -12,12 +12,8 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.FieldValidator; import teammates.common.util.StringHelper; -import teammates.logic.core.AccountsLogic; -import teammates.logic.core.InstructorsLogic; -import teammates.logic.core.ProfilesLogic; -import teammates.logic.core.StudentsLogic; import teammates.storage.api.AccountsDb; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; /** * SUT: {@link AccountsLogic}. @@ -25,6 +21,8 @@ public class AccountsLogicTest extends BaseLogicTest { private static final AccountsLogic accountsLogic = AccountsLogic.inst(); + private static final AccountsDb accountsDb = new AccountsDb(); + private static final CoursesLogic coursesLogic = CoursesLogic.inst(); private static final ProfilesLogic profilesLogic = ProfilesLogic.inst(); private static final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); private static final StudentsLogic studentsLogic = StudentsLogic.inst(); @@ -40,6 +38,12 @@ public void refreshTestData() { removeAndRestoreTypicalDataBundle(); } + private String getEncryptedKeyForInstructor(String courseId, String email) + throws EntityDoesNotExistException { + InstructorAttributes instructor = instructorsLogic.getInstructorForEmail(courseId, email); + return StringHelper.encrypt(instructor.key); + } + @Test public void testCreateAccount() throws Exception { @@ -73,13 +77,6 @@ public void testCreateAccount() throws Exception { @Test public void testAccountFunctions() throws Exception { - ______TS("test isAccountPresent"); - - assertTrue(accountsLogic.isAccountPresent("idOfInstructor1OfCourse1")); - assertTrue(accountsLogic.isAccountPresent("student1InCourse1")); - - assertFalse(accountsLogic.isAccountPresent("id-does-not-exist")); - ______TS("test isAccountAnInstructor"); assertTrue(accountsLogic.isAccountAnInstructor("idOfInstructor1OfCourse1")); @@ -126,7 +123,7 @@ public void testJoinCourseForStudent() throws Exception { .withComment("") .build(); studentsLogic.createStudent(studentData); - studentData = StudentsLogic.inst().getStudentForEmail(courseId, + studentData = studentsLogic.getStudentForEmail(courseId, originalEmail); StudentAttributes finalStudent = studentData; @@ -178,7 +175,7 @@ public void testJoinCourseForStudent() throws Exception { verifyPresentInDatastore(studentData); assertEquals( correctStudentId, - logic.getStudentForEmail(studentData.course, studentData.email).googleId); + studentsLogic.getStudentForEmail(studentData.course, studentData.email).googleId); ______TS("failure: already joined"); @@ -205,7 +202,7 @@ public void testJoinCourseForStudent() throws Exception { .withComment("") .build(); studentsLogic.createStudent(studentData); - studentData = StudentsLogic.inst().getStudentForEmail(courseId, + studentData = studentsLogic.getStudentForEmail(courseId, originalEmail); String encryptedKey = StringHelper.encrypt(studentData.key); @@ -213,7 +210,7 @@ public void testJoinCourseForStudent() throws Exception { studentData.googleId = correctStudentId; verifyPresentInDatastore(studentData); assertEquals(correctStudentId, - logic.getStudentForEmail(studentData.course, studentData.email).googleId); + studentsLogic.getStudentForEmail(studentData.course, studentData.email).googleId); // check that we have the corresponding new account created. accountData.googleId = correctStudentId; @@ -235,28 +232,27 @@ public void testJoinCourseForStudent() throws Exception { .build() ); assertEquals("", - logic.getStudentForEmail(studentData.course, studentData.email).googleId); + studentsLogic.getStudentForEmail(studentData.course, studentData.email).googleId); // rejoin - logic.joinCourseForStudent(encryptedKey, correctStudentId); + accountsLogic.joinCourseForStudent(encryptedKey, correctStudentId); assertEquals(correctStudentId, - logic.getStudentForEmail(studentData.course, studentData.email).googleId); + studentsLogic.getStudentForEmail(studentData.course, studentData.email).googleId); // check if still instructor - assertTrue(logic.isInstructor(correctStudentId)); + assertTrue(accountsLogic.isAccountAnInstructor(correctStudentId)); accountsLogic.deleteAccountCascade(correctStudentId); accountsLogic.deleteAccountCascade(existingId); } - @SuppressWarnings("deprecation") @Test public void testJoinCourseForInstructor() throws Exception { InstructorAttributes instructor = dataBundle.instructors.get("instructorNotYetJoinCourse"); String loggedInGoogleId = "AccLogicT.instr.id"; String[] encryptedKey = new String[] { - instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), + getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("failure: googleID belongs to an existing instructor in the course"); @@ -280,7 +276,6 @@ public void testJoinCourseForInstructor() throws Exception { ______TS("success: instructor joined but Account object creation goes wrong"); //Delete account to simulate Account object creation goes wrong - AccountsDb accountsDb = new AccountsDb(); accountsDb.deleteAccount(loggedInGoogleId); //Try to join course again, Account object should be recreated @@ -303,7 +298,7 @@ public void testJoinCourseForInstructor() throws Exception { .build(); instructorsLogic.createInstructor(newIns); - encryptedKey[0] = instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, nonInstrAccount.email); + encryptedKey[0] = getEncryptedKeyForInstructor(instructor.courseId, nonInstrAccount.email); assertFalse(accountsLogic.getAccount(nonInstrAccount.googleId).isInstructor); accountsLogic.joinCourseForInstructor(encryptedKey[0], nonInstrAccount.googleId, null, null); @@ -311,7 +306,7 @@ public void testJoinCourseForInstructor() throws Exception { joinedInstructor = instructorsLogic.getInstructorForEmail(instructor.courseId, nonInstrAccount.email); assertEquals(nonInstrAccount.googleId, joinedInstructor.googleId); assertTrue(accountsLogic.getAccount(nonInstrAccount.googleId).isInstructor); - instructorsLogic.verifyInstructorExists(nonInstrAccount.googleId); + assertTrue(accountsLogic.isAccountAnInstructor(nonInstrAccount.googleId)); ______TS("success: instructor join and assigned institute when some instructors have not joined course"); @@ -332,13 +327,13 @@ public void testJoinCourseForInstructor() throws Exception { .build(); instructorsLogic.createInstructor(newIns); - encryptedKey[0] = instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, nonInstrAccount.email); + encryptedKey[0] = getEncryptedKeyForInstructor(instructor.courseId, nonInstrAccount.email); accountsLogic.joinCourseForInstructor(encryptedKey[0], nonInstrAccount.googleId, null, null); joinedInstructor = instructorsLogic.getInstructorForEmail(instructor.courseId, nonInstrAccount.email); assertEquals(nonInstrAccount.googleId, joinedInstructor.googleId); - instructorsLogic.verifyInstructorExists(nonInstrAccount.googleId); + assertTrue(accountsLogic.isAccountAnInstructor(nonInstrAccount.googleId)); AccountAttributes instructorAccount = accountsLogic.getAccount(nonInstrAccount.googleId); assertEquals("TEAMMATES Test Institute 1", instructorAccount.institute); @@ -350,7 +345,7 @@ public void testJoinCourseForInstructor() throws Exception { nonInstrAccount = dataBundle.accounts.get("student1InCourse1"); instructor = dataBundle.instructors.get("instructorNotYetJoinCourse"); - encryptedKey[0] = instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, nonInstrAccount.email); + encryptedKey[0] = getEncryptedKeyForInstructor(instructor.courseId, nonInstrAccount.email); joinedInstructor = instructorsLogic.getInstructorForEmail(instructor.courseId, nonInstrAccount.email); InstructorAttributes[] finalInstructor = new InstructorAttributes[] { joinedInstructor }; eaee = assertThrows(EntityAlreadyExistsException.class, @@ -379,7 +374,7 @@ public void testJoinCourseForInstructor_validInstitute_shouldPass() String loggedInGoogleId = "AccLogicT.instr.id"; String institute = "National University of Singapore"; String[] encryptedKey = new String[] { - instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), + getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("success: instructor with institute joined and new account created"); @@ -401,7 +396,7 @@ public void testJoinCourseForInstructor_invalidInstituteMac_shouldFail() throws String loggedInGoogleId = "AccLogicT.instr.id"; String institute = "National University of Singapore"; String[] encryptedKey = new String[] { - instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), + getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("failure: institute signature does not match institute provided"); @@ -421,7 +416,7 @@ public void testJoinCourseForInstructor_missingInstituteMac_shouldFail() throws String loggedInGoogleId = "AccLogicT.instr.id"; String institute = "National University of Singapore"; String[] encryptedKey = new String[] { - instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email), + getEncryptedKeyForInstructor(instructor.courseId, instructor.email), }; ______TS("failure: institute signature missing"); @@ -453,7 +448,7 @@ public void testDeleteAccountCascade_lastInstructorInCourse_shouldDeleteOrphanCo // Make instructor account id a student too. StudentAttributes student = StudentAttributes - .builder(instructor.courseId, "email@com") + .builder(instructor.courseId, "email@test.com") .withName(instructor.name) .withSectionName("section") .withTeamName("team") @@ -473,7 +468,7 @@ public void testDeleteAccountCascade_lastInstructorInCourse_shouldDeleteOrphanCo verifyAbsentInDatastore(instructor); verifyAbsentInDatastore(student); // course is deleted because it is the last instructor of the course - assertNull(logic.getCourse(instructor.getCourseId())); + assertNull(coursesLogic.getCourse(instructor.getCourseId())); } @Test @@ -487,7 +482,7 @@ public void testDeleteAccountCascade_notLastInstructorInCourse_shouldNotDeleteCo accountsLogic.deleteAccountCascade(instructor1OfCourse1.getGoogleId()); // course is not deleted - assertNotNull(logic.getCourse(instructor1OfCourse1.getCourseId())); + assertNotNull(coursesLogic.getCourse(instructor1OfCourse1.getCourseId())); } @Test @@ -495,20 +490,20 @@ public void testDeleteAccountCascade_instructorArchivedAsLastInstructor_shouldDe InstructorAttributes instructor5 = dataBundle.instructors.get("instructor5"); assertNotNull(instructor5.getGoogleId()); - logic.setArchiveStatusOfInstructor(instructor5.getGoogleId(), instructor5.getCourseId(), true); + instructorsLogic.setArchiveStatusOfInstructor(instructor5.getGoogleId(), instructor5.getCourseId(), true); // verify the instructor is the last instructor of a course assertEquals(1, instructorsLogic.getInstructorsForCourse(instructor5.getCourseId()).size()); assertTrue( - logic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail()).isArchived); + instructorsLogic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail()).isArchived); accountsLogic.deleteAccountCascade(instructor5.getGoogleId()); // the archived instructor is also deleted - assertNull(logic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail())); + assertNull(instructorsLogic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail())); // the course is also deleted - assertNull(logic.getCourse(instructor5.getCourseId())); + assertNull(coursesLogic.getCourse(instructor5.getCourseId())); } @Test @@ -518,6 +513,7 @@ public void testDeleteAccountCascade_nonExistentAccount_shouldPass() { accountsLogic.deleteAccountCascade("not_exist"); // other irrelevant instructors remain - assertNotNull(logic.getInstructorForEmail(instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail())); + assertNotNull(instructorsLogic.getInstructorForEmail( + instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail())); } } diff --git a/src/test/java/teammates/logic/core/BaseLogicTest.java b/src/test/java/teammates/logic/core/BaseLogicTest.java new file mode 100644 index 00000000000..619ae859c93 --- /dev/null +++ b/src/test/java/teammates/logic/core/BaseLogicTest.java @@ -0,0 +1,25 @@ +package teammates.logic.core; + +import org.testng.annotations.BeforeClass; + +import teammates.common.datatransfer.DataBundle; +import teammates.test.BaseComponentTestCase; + +/** + * Base class for all *Logic tests. + */ +public abstract class BaseLogicTest extends BaseComponentTestCase { + + protected DataBundle dataBundle; + + @BeforeClass + public void baseClassSetup() { + prepareTestData(); + } + + protected void prepareTestData() { + dataBundle = getTypicalDataBundle(); + removeAndRestoreTypicalDataBundle(); + } + +} diff --git a/src/test/java/teammates/test/cases/logic/CoursesLogicTest.java b/src/test/java/teammates/logic/core/CoursesLogicTest.java similarity index 57% rename from src/test/java/teammates/test/cases/logic/CoursesLogicTest.java rename to src/test/java/teammates/logic/core/CoursesLogicTest.java index 334afd8ecfb..05c0dfd945e 100644 --- a/src/test/java/teammates/test/cases/logic/CoursesLogicTest.java +++ b/src/test/java/teammates/logic/core/CoursesLogicTest.java @@ -1,17 +1,13 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.time.Instant; import java.time.ZoneId; import java.util.ArrayList; import java.util.List; -import java.util.Map; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import teammates.common.datatransfer.CourseDetailsBundle; -import teammates.common.datatransfer.CourseSummaryBundle; -import teammates.common.datatransfer.TeamDetailsBundle; import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; @@ -24,27 +20,23 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.FieldValidator; -import teammates.logic.core.AccountsLogic; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.FeedbackQuestionsLogic; -import teammates.logic.core.FeedbackResponseCommentsLogic; -import teammates.logic.core.FeedbackResponsesLogic; -import teammates.logic.core.InstructorsLogic; -import teammates.logic.core.StudentsLogic; -import teammates.storage.api.AccountsDb; import teammates.storage.api.CoursesDb; -import teammates.storage.api.InstructorsDb; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; /** * SUT: {@link CoursesLogic}. */ public class CoursesLogicTest extends BaseLogicTest { + private static final AccountsLogic accountsLogic = AccountsLogic.inst(); private static final CoursesLogic coursesLogic = CoursesLogic.inst(); private static final CoursesDb coursesDb = new CoursesDb(); - private static final AccountsDb accountsDb = new AccountsDb(); - private static final InstructorsDb instructorsDb = new InstructorsDb(); + private static final FeedbackQuestionsLogic fqLogic = FeedbackQuestionsLogic.inst(); + private static final FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); + private static final FeedbackResponseCommentsLogic frcLogic = FeedbackResponseCommentsLogic.inst(); + private static final FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); + private static final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); + private static final StudentsLogic studentsLogic = StudentsLogic.inst(); @Override protected void prepareTestData() { @@ -67,7 +59,7 @@ public void testUpdateCourseCascade_shouldCascadeUpdateTimezoneOfFeedbackSession .withTimezone(ZoneId.of("UTC")) .build()); - List sessionsOfCourse = logic.getFeedbackSessionsForCourse(typicalCourse1.getId()); + List sessionsOfCourse = fsLogic.getFeedbackSessionsForCourse(typicalCourse1.getId()); assertFalse(sessionsOfCourse.isEmpty()); assertTrue(sessionsOfCourse.stream().allMatch(s -> s.getTimeZone().equals(ZoneId.of("UTC")))); } @@ -75,26 +67,16 @@ public void testUpdateCourseCascade_shouldCascadeUpdateTimezoneOfFeedbackSession @Test public void testAll() throws Exception { testGetCourse(); - testGetCoursesForInstructor(); testGetSoftDeletedCoursesForInstructors(); - testGetSoftDeletedCourseForInstructor(); - testIsSampleCourse(); testIsCoursePresent(); testVerifyCourseIsPresent(); testGetSectionsNameForCourse(); - testGetCourseSummary(); - testGetCourseSummaryWithoutStats(); - testGetCourseDetails(); testGetTeamsForCourse(); testGetCoursesForStudentAccount(); - testGetCourseSummariesForInstructor(); - testGetCoursesSummaryWithoutStatsForInstructor(); - testHasIndicatedSections(); testCreateCourse(); testCreateCourseAndInstructor(); testMoveCourseToRecycleBin(); testRestoreCourseFromRecycleBin(); - testRestoreAllCoursesFromRecycleBin(); testUpdateCourseCascade(); } @@ -123,41 +105,6 @@ private void testGetCourse() throws Exception { assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); } - private void testGetCoursesForInstructor() throws Exception { - - ______TS("success: instructor with present courses"); - - String instructorId = dataBundle.accounts.get("instructor3").googleId; - - List courses = coursesLogic.getCoursesForInstructor(instructorId); - - assertEquals(2, courses.size()); - - ______TS("omit archived courses"); - - InstructorsLogic.inst().setArchiveStatusOfInstructor(instructorId, courses.get(0).getId(), true); - courses = coursesLogic.getCoursesForInstructor(instructorId, true); - assertEquals(1, courses.size()); - InstructorsLogic.inst().setArchiveStatusOfInstructor(instructorId, courses.get(0).getId(), false); - - ______TS("boundary: instructor without any courses"); - - instructorId = dataBundle.accounts.get("instructorWithoutCourses").googleId; - - courses = coursesLogic.getCoursesForInstructor(instructorId); - - assertEquals(0, courses.size()); - - ______TS("Null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.getCoursesForInstructor((String) null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - - ae = assertThrows(AssertionError.class, - () -> coursesLogic.getCoursesForInstructor((List) null)); - assertEquals("Supplied parameter was null", ae.getMessage()); - } - private void testGetSoftDeletedCoursesForInstructors() { ______TS("success: instructors with deleted courses"); @@ -187,66 +134,6 @@ private void testGetSoftDeletedCoursesForInstructors() { assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); } - private void testGetSoftDeletedCourseForInstructor() { - - ______TS("success: instructor with deleted course"); - - InstructorAttributes instructor = dataBundle.instructors.get("instructor1OfCourse3"); - - CourseAttributes course = coursesLogic.getSoftDeletedCourseForInstructor(instructor); - - assertNotNull(course); - - ______TS("boundary: instructor without any deleted courses"); - - instructor = dataBundle.instructors.get("instructor5"); - - course = coursesLogic.getSoftDeletedCourseForInstructor(instructor); - - assertNull(course); - - ______TS("Null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.getSoftDeletedCourseForInstructor(null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - } - - private void testIsSampleCourse() { - - ______TS("typical case: not a sample course"); - - CourseAttributes notSampleCourse = CourseAttributes - .builder("course.id") - .withName("not sample course") - .withTimezone(ZoneId.of("UTC")) - .build(); - - assertFalse(coursesLogic.isSampleCourse(notSampleCourse.getId())); - - ______TS("typical case: is a sample course"); - - CourseAttributes sampleCourse = CourseAttributes - .builder("course.id-demo3") - .withName("sample course") - .withTimezone(ZoneId.of("UTC")) - .build(); - assertTrue(coursesLogic.isSampleCourse(sampleCourse.getId())); - - ______TS("typical case: is a sample course with '-demo' in the middle of its id"); - - CourseAttributes sampleCourse2 = CourseAttributes - .builder("course.id-demo3-demo33") - .withName("sample course with additional -demo") - .withTimezone(ZoneId.of("UTC")) - .build(); - assertTrue(coursesLogic.isSampleCourse(sampleCourse2.getId())); - - ______TS("Null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.isSampleCourse(null)); - assertEquals("Course ID is null", ae.getMessage()); - } - private void testIsCoursePresent() { ______TS("typical case: not an existent course"); @@ -330,181 +217,20 @@ private void testGetSectionsNameForCourse() throws Exception { assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); } - private void testGetCourseSummary() throws Exception { - - ______TS("typical case"); - - CourseAttributes course = dataBundle.courses.get("typicalCourse1"); - CourseDetailsBundle courseSummary = coursesLogic.getCourseSummary(course.getId()); - assertEquals(course.getId(), courseSummary.course.getId()); - assertEquals(course.getName(), courseSummary.course.getName()); - - assertEquals(2, courseSummary.stats.teamsTotal); - assertEquals(5, courseSummary.stats.studentsTotal); - assertEquals(0, courseSummary.stats.unregisteredTotal); - - assertEquals(1, courseSummary.sections.get(0).teams.size()); - assertEquals("Team 1.1'\"", courseSummary.sections.get(0).teams.get(0).name); - - ______TS("course without students"); - - AccountsLogic.inst().createAccount(AccountAttributes.builder("instructor1") - .withName("Instructor 1") - .withEmail("instructor@email.tmt") - .withInstitute("TEAMMATES Test Institute 1") - .withIsInstructor(true) - .build()); - coursesLogic.createCourseAndInstructor("instructor1", - CourseAttributes.builder("course1") - .withName("course 1") - .withTimezone(ZoneId.of("Asia/Singapore")) - .build()); - courseSummary = coursesLogic.getCourseSummary("course1"); - assertEquals("course1", courseSummary.course.getId()); - assertEquals("course 1", courseSummary.course.getName()); - assertEquals("Asia/Singapore", courseSummary.course.getTimeZone().getId()); - - assertEquals(0, courseSummary.stats.teamsTotal); - assertEquals(0, courseSummary.stats.studentsTotal); - assertEquals(0, courseSummary.stats.unregisteredTotal); - - assertEquals(0, courseSummary.sections.size()); - - coursesLogic.deleteCourseCascade("course1"); - accountsDb.deleteAccount("instructor1"); - - ______TS("non-existent"); - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> coursesLogic.getCourseSummary("non-existent-course")); - AssertHelper.assertContains("The course does not exist:", ednee.getMessage()); - - ______TS("null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.getCourseSummary((String) null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - - ae = assertThrows(AssertionError.class, () -> coursesLogic.getCourseSummary((CourseAttributes) null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - } - - private void testGetCourseSummaryWithoutStats() throws Exception { - - ______TS("typical case"); - - CourseAttributes course = dataBundle.courses.get("typicalCourse1"); - CourseSummaryBundle courseSummary = coursesLogic.getCourseSummaryWithoutStats(course.getId()); - assertEquals(course.getId(), courseSummary.course.getId()); - assertEquals(course.getName(), courseSummary.course.getName()); - - ______TS("course without students"); - - AccountsLogic.inst().createAccount(AccountAttributes.builder("instructor1") - .withName("Instructor 1") - .withEmail("instructor@email.tmt") - .withInstitute("TEAMMATES Test Institute 1") - .withIsInstructor(true) - .build()); - coursesLogic.createCourseAndInstructor("instructor1", - CourseAttributes.builder("course1") - .withName("course 1") - .withTimezone(ZoneId.of("America/Los_Angeles")) - .build()); - courseSummary = coursesLogic.getCourseSummaryWithoutStats("course1"); - assertEquals("course1", courseSummary.course.getId()); - assertEquals("course 1", courseSummary.course.getName()); - assertEquals("America/Los_Angeles", courseSummary.course.getTimeZone().getId()); - - coursesLogic.deleteCourseCascade("course1"); - accountsDb.deleteAccount("instructor1"); - - ______TS("non-existent"); - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> coursesLogic.getCourseSummaryWithoutStats("non-existent-course")); - AssertHelper.assertContains("The course does not exist:", ednee.getMessage()); - - ______TS("null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> coursesLogic.getCourseSummaryWithoutStats((CourseAttributes) null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - - ae = assertThrows(AssertionError.class, () -> coursesLogic.getCourseSummaryWithoutStats((String) null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - } - - private void testGetCourseDetails() throws Exception { - - ______TS("typical case"); - - CourseAttributes course = dataBundle.courses.get("typicalCourse1"); - CourseDetailsBundle courseDetails = coursesLogic.getCourseSummary(course.getId()); - - assertEquals(course.getId(), courseDetails.course.getId()); - assertEquals(course.getName(), courseDetails.course.getName()); - assertEquals(course.getTimeZone(), courseDetails.course.getTimeZone()); - - assertEquals(2, courseDetails.stats.teamsTotal); - assertEquals(5, courseDetails.stats.studentsTotal); - assertEquals(0, courseDetails.stats.unregisteredTotal); - - assertEquals(1, courseDetails.sections.get(0).teams.size()); - assertEquals("Team 1.1'\"", courseDetails.sections.get(0).teams.get(0).name); - - ______TS("course without students"); - - AccountsLogic.inst().createAccount(AccountAttributes.builder("instructor1") - .withName("Instructor 1") - .withEmail("instructor@email.tmt") - .withInstitute("TEAMMATES Test Institute 1") - .withIsInstructor(true) - .build()); - coursesLogic.createCourseAndInstructor("instructor1", - CourseAttributes.builder("course1") - .withName("course 1") - .withTimezone(ZoneId.of("Australia/Adelaide")) - .build()); - courseDetails = coursesLogic.getCourseSummary("course1"); - assertEquals("course1", courseDetails.course.getId()); - assertEquals("course 1", courseDetails.course.getName()); - assertEquals("Australia/Adelaide", courseDetails.course.getTimeZone().getId()); - - assertEquals(0, courseDetails.stats.teamsTotal); - assertEquals(0, courseDetails.stats.studentsTotal); - assertEquals(0, courseDetails.stats.unregisteredTotal); - - assertEquals(0, courseDetails.sections.size()); - - coursesLogic.deleteCourseCascade("course1"); - accountsDb.deleteAccount("instructor1"); - - ______TS("non-existent"); - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> coursesLogic.getCourseSummary("non-existent-course")); - AssertHelper.assertContains("The course does not exist:", ednee.getMessage()); - - ______TS("null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.getCourseSummary((String) null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - } - private void testGetTeamsForCourse() throws Exception { ______TS("typical case"); CourseAttributes course = dataBundle.courses.get("typicalCourse1"); - List teams = coursesLogic.getTeamsForCourse(course.getId()); + List teams = coursesLogic.getTeamsForCourse(course.getId()); assertEquals(2, teams.size()); - assertEquals("Team 1.1'\"", teams.get(0).name); - assertEquals("Team 1.2", teams.get(1).name); + assertEquals("Team 1.1'\"", teams.get(0)); + assertEquals("Team 1.2", teams.get(1)); ______TS("course without students"); - AccountsLogic.inst().createAccount(AccountAttributes.builder("instructor1") + accountsLogic.createAccount(AccountAttributes.builder("instructor1") .withName("Instructor 1") .withEmail("instructor@email.tmt") .withInstitute("TEAMMATES Test Institute 1") @@ -520,7 +246,7 @@ private void testGetTeamsForCourse() throws Exception { assertEquals(0, teams.size()); coursesLogic.deleteCourseCascade("course1"); - accountsDb.deleteAccount("instructor1"); + accountsLogic.deleteAccountCascade("instructor1"); ______TS("non-existent"); @@ -583,97 +309,6 @@ private void testGetCoursesForStudentAccount() throws Exception { assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); } - private void testGetCourseSummariesForInstructor() throws Exception { - - ______TS("Instructor with 2 courses"); - - InstructorAttributes instructor = dataBundle.instructors.get("instructor3OfCourse1"); - Map courseList = - coursesLogic.getCourseSummariesForInstructor(instructor.googleId, false); - assertEquals(2, courseList.size()); - for (CourseDetailsBundle cdd : courseList.values()) { - // check if course belongs to this instructor - assertTrue(InstructorsLogic.inst().isGoogleIdOfInstructorOfCourse(instructor.googleId, cdd.course.getId())); - } - - ______TS("Instructor with 1 archived, 1 unarchived course"); - - InstructorsLogic.inst().setArchiveStatusOfInstructor(instructor.googleId, "idOfTypicalCourse1", true); - courseList = coursesLogic.getCourseSummariesForInstructor(instructor.googleId, true); - assertEquals(1, courseList.size()); - InstructorsLogic.inst().setArchiveStatusOfInstructor(instructor.googleId, "idOfTypicalCourse1", false); - - ______TS("Instructor with 0 courses"); - courseList = coursesLogic.getCourseSummariesForInstructor("instructorWithoutCourses", false); - assertEquals(0, courseList.size()); - - ______TS("Non-existent instructor"); - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> coursesLogic.getCourseSummariesForInstructor("non-existent-instructor", false)); - AssertHelper.assertContains("does not exist", ednee.getMessage()); - - ______TS("Null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> coursesLogic.getCourseSummariesForInstructor(null, false)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - - } - - private void testGetCoursesSummaryWithoutStatsForInstructor() throws Exception { - - ______TS("Typical case"); - - Map courseListForInstructor = coursesLogic - .getCoursesSummaryWithoutStatsForInstructor("idOfInstructor3", false); - assertEquals(2, courseListForInstructor.size()); - - ______TS("Instructor has an archived course"); - - InstructorsLogic.inst().setArchiveStatusOfInstructor("idOfInstructor4", "idOfCourseNoEvals", true); - courseListForInstructor = coursesLogic - .getCoursesSummaryWithoutStatsForInstructor("idOfInstructor4", true); - assertEquals(0, courseListForInstructor.size()); - InstructorsLogic.inst().setArchiveStatusOfInstructor("idOfInstructor4", "idOfCourseNoEvals", true); - - ______TS("Instructor with 0 courses"); - - courseListForInstructor = coursesLogic.getCoursesSummaryWithoutStatsForInstructor("instructorWithoutCourses", false); - assertEquals(0, courseListForInstructor.size()); - - ______TS("Null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> coursesLogic.getCoursesSummaryWithoutStatsForInstructor(null, false)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - } - - private void testHasIndicatedSections() throws Exception { - - ______TS("Typical case: course with sections"); - - CourseAttributes typicalCourse1 = dataBundle.courses.get("typicalCourse1"); - assertTrue(coursesLogic.hasIndicatedSections(typicalCourse1.getId())); - - ______TS("Typical case: course without sections"); - - CourseAttributes typicalCourse2 = dataBundle.courses.get("typicalCourse2"); - assertFalse(coursesLogic.hasIndicatedSections(typicalCourse2.getId())); - - ______TS("Failure case: course does not exists"); - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> coursesLogic.hasIndicatedSections("non-existent-course")); - AssertHelper.assertContains("does not exist", ednee.getMessage()); - - ______TS("Failure case: null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> coursesLogic.hasIndicatedSections(null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - - } - private void testCreateCourse() throws Exception { ______TS("typical case"); @@ -742,7 +377,7 @@ private void testCreateCourseAndInstructor() throws Exception { .withInstitute("TEAMMATES Test Institute 5") .build(); - accountsDb.createEntity(a); + accountsLogic.createAccount(a); ae = assertThrows(AssertionError.class, () -> coursesLogic.createCourseAndInstructor(i.googleId, CourseAttributes.builder(c.getId()) @@ -755,11 +390,7 @@ private void testCreateCourseAndInstructor() throws Exception { ______TS("fails: error during course creation"); - accountsDb.updateAccount( - AccountAttributes.updateOptionsBuilder(a.googleId) - .withIsInstructor(true) - .build() - ); + accountsLogic.makeAccountInstructor(a.googleId); CourseAttributes invalidCourse = CourseAttributes .builder("invalid id") @@ -790,7 +421,7 @@ private void testCreateCourseAndInstructor() throws Exception { .withName("Fresh course for tccai") .withTimezone(ZoneId.of("UTC")) .build(); - instructorsDb.createEntity(i); //create a duplicate instructor + instructorsLogic.createInstructor(i); //create a duplicate instructor ae = assertThrows(AssertionError.class, () -> coursesLogic.createCourseAndInstructor(i.googleId, @@ -823,7 +454,7 @@ private void testCreateCourseAndInstructor() throws Exception { i.email = "ins.for.iccai@gmail.tmt"; //remove the duplicate instructor object from the datastore. - instructorsDb.deleteInstructor(i.courseId, i.email); + instructorsLogic.deleteInstructorCascade(i.courseId, i.email); coursesLogic.createCourseAndInstructor(i.googleId, CourseAttributes.builder(courseWithDuplicateInstructor.getId()) @@ -894,7 +525,7 @@ private void testRestoreCourseFromRecycleBin() throws InvalidParametersException assertTrue(course3OfInstructor.isCourseDeleted()); coursesLogic.restoreCourseFromRecycleBin(course3OfInstructor.getId()); - course3OfInstructor.resetDeletedAt(); + course3OfInstructor.deletedAt = null; // Ensure the course and related entities still exist in datastore verifyPresentInDatastore(course3OfInstructor); @@ -913,47 +544,6 @@ private void testRestoreCourseFromRecycleBin() throws InvalidParametersException assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); } - private void testRestoreAllCoursesFromRecycleBin() throws InvalidParametersException, EntityDoesNotExistException { - - ______TS("typical case"); - - InstructorAttributes instructor1OfCourse3 = dataBundle.instructors.get("instructor1OfCourse3"); - CourseAttributes course3OfInstructor = coursesLogic.getSoftDeletedCourseForInstructor(instructor1OfCourse3); - - List instructors = new ArrayList<>(); - instructors.add(instructor1OfCourse3); - - // Ensure there are entities in the datastore under this course - verifyPresentInDatastore(course3OfInstructor); - verifyPresentInDatastore(dataBundle.instructors.get("instructor1OfCourse3")); - verifyPresentInDatastore(dataBundle.students.get("student1InCourse3")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session1InCourse3")); - - // Ensure the course is currently in Recycle Bin - assertTrue(course3OfInstructor.isCourseDeleted()); - - coursesLogic.restoreAllCoursesFromRecycleBin(instructors); - course3OfInstructor.resetDeletedAt(); - - // Ensure the course and related entities still exist in datastore - verifyPresentInDatastore(course3OfInstructor); - verifyPresentInDatastore(dataBundle.instructors.get("instructor1OfCourse3")); - verifyPresentInDatastore(dataBundle.students.get("student1InCourse3")); - verifyPresentInDatastore(dataBundle.feedbackSessions.get("session1InCourse3")); - - // Ensure the courses are restored from Recycle Bin - assertFalse(course3OfInstructor.isCourseDeleted()); - - // Move the course back to Recycle Bin for further testing - coursesLogic.moveCourseToRecycleBin(course3OfInstructor.getId()); - - ______TS("null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> coursesLogic.restoreAllCoursesFromRecycleBin(null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - } - @Test public void testDeleteCourseCascade() { @@ -967,7 +557,7 @@ public void testDeleteCourseCascade() { StudentAttributes studentInCourse = dataBundle.students.get("student1InCourse1"); // Ensure there are entities in the datastore under this course - assertFalse(StudentsLogic.inst().getStudentsForCourse(course1OfInstructor.getId()).isEmpty()); + assertFalse(studentsLogic.getStudentsForCourse(course1OfInstructor.getId()).isEmpty()); verifyPresentInDatastore(course1OfInstructor); verifyPresentInDatastore(studentInCourse); @@ -980,15 +570,14 @@ public void testDeleteCourseCascade() { verifyPresentInDatastore(dataBundle.feedbackQuestions.get("qn1InSession1InCourse1")); FeedbackResponseAttributes typicalResponse = dataBundle.feedbackResponses.get("response1ForQ1S1C1"); FeedbackQuestionAttributes typicalQuestion = - FeedbackQuestionsLogic.inst() - .getFeedbackQuestion(typicalResponse.feedbackSessionName, typicalResponse.courseId, - Integer.parseInt(typicalResponse.feedbackQuestionId)); - typicalResponse = FeedbackResponsesLogic.inst() + fqLogic.getFeedbackQuestion(typicalResponse.feedbackSessionName, typicalResponse.courseId, + Integer.parseInt(typicalResponse.feedbackQuestionId)); + typicalResponse = frLogic .getFeedbackResponse(typicalQuestion.getId(), typicalResponse.giver, typicalResponse.recipient); verifyPresentInDatastore(typicalResponse); FeedbackResponseCommentAttributes typicalComment = dataBundle.feedbackResponseComments.get("comment1FromT1C1ToR1Q1S1C1"); - typicalComment = FeedbackResponseCommentsLogic.inst() + typicalComment = frcLogic .getFeedbackResponseComment(typicalResponse.getId(), typicalComment.commentGiver, typicalComment.createdAt); verifyPresentInDatastore(typicalComment); diff --git a/src/test/java/teammates/test/cases/logic/DataBundleLogicTest.java b/src/test/java/teammates/logic/core/DataBundleLogicTest.java similarity index 97% rename from src/test/java/teammates/test/cases/logic/DataBundleLogicTest.java rename to src/test/java/teammates/logic/core/DataBundleLogicTest.java index 758591b7963..983e28cf3da 100644 --- a/src/test/java/teammates/test/cases/logic/DataBundleLogicTest.java +++ b/src/test/java/teammates/logic/core/DataBundleLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.time.ZoneId; import java.util.Map; @@ -10,7 +10,6 @@ import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.exception.InvalidParametersException; import teammates.common.util.FieldValidator; -import teammates.logic.core.DataBundleLogic; /** * SUT: {@link DataBundleLogic}. diff --git a/src/test/java/teammates/test/cases/logic/FeedbackQuestionsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java similarity index 97% rename from src/test/java/teammates/test/cases/logic/FeedbackQuestionsLogicTest.java rename to src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java index fed9d7cf4c5..0903830fe4c 100644 --- a/src/test/java/teammates/test/cases/logic/FeedbackQuestionsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackQuestionsLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.util.ArrayList; import java.util.Arrays; @@ -26,19 +26,13 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.FieldValidator; -import teammates.logic.core.AccountsLogic; -import teammates.logic.core.FeedbackQuestionsLogic; -import teammates.logic.core.FeedbackResponseCommentsLogic; -import teammates.logic.core.FeedbackResponsesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.logic.core.InstructorsLogic; -import teammates.logic.core.StudentsLogic; /** * SUT: {@link FeedbackQuestionsLogic}. */ public class FeedbackQuestionsLogicTest extends BaseLogicTest { + private static AccountsLogic accountsLogic = AccountsLogic.inst(); private static FeedbackQuestionsLogic fqLogic = FeedbackQuestionsLogic.inst(); private static FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); private static FeedbackResponseCommentsLogic frcLogic = FeedbackResponseCommentsLogic.inst(); @@ -133,7 +127,7 @@ private void testGetRecipientsForQuestion() throws Exception { ______TS("special case: response to other team, instructor is also student"); question = getQuestionFromDatastore("team.feedback"); email = dataBundle.students.get("student1InCourse1").email; - AccountsLogic.inst().makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); + accountsLogic.makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); recipients = fqLogic.getRecipientsForQuestion(question, email); @@ -142,7 +136,7 @@ private void testGetRecipientsForQuestion() throws Exception { ______TS("to nobody (general feedback)"); question = getQuestionFromDatastore("qn3InSession1InCourse1"); email = dataBundle.students.get("student1InCourse1").email; - AccountsLogic.inst().makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); + accountsLogic.makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); recipients = fqLogic.getRecipientsForQuestion(question, email); assertEquals(recipients.get(Const.GENERAL_QUESTION), Const.GENERAL_QUESTION); @@ -151,7 +145,7 @@ private void testGetRecipientsForQuestion() throws Exception { ______TS("to self"); question = getQuestionFromDatastore("qn1InSession1InCourse1"); email = dataBundle.students.get("student1InCourse1").email; - AccountsLogic.inst().makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); + accountsLogic.makeAccountInstructor(dataBundle.students.get("student1InCourse1").googleId); recipients = fqLogic.getRecipientsForQuestion(question, email); assertEquals(recipients.get(email), Const.USER_NAME_FOR_SELF); @@ -233,10 +227,22 @@ public void testGetRecipientsOfQuestion() throws Exception { assertTrue(recipients.containsKey(studentGiver.getTeam())); assertEquals(recipients.get(studentGiver.getTeam()), studentGiver.getTeam()); + ______TS("response to other teams from instructor"); + question = getQuestionFromDatastore("team.instructor.feedback"); + instructorGiver = dataBundle.instructors.get("instructor1OfCourse1"); + courseRoster = new CourseRoster( + studentsLogic.getStudentsForCourse(studentGiver.getCourse()), + instructorsLogic.getInstructorsForCourse(studentGiver.getCourse())); + + recipients = fqLogic.getRecipientsOfQuestion(question, instructorGiver, null, null); + assertEquals(recipients.size(), 2); + recipients = fqLogic.getRecipientsOfQuestion(question, instructorGiver, null, courseRoster); + assertEquals(recipients.size(), 2); + ______TS("special case: response to other team, instructor is also student"); question = getQuestionFromDatastore("team.feedback"); studentGiver = dataBundle.students.get("student1InCourse1"); - AccountsLogic.inst().makeAccountInstructor(studentGiver.getGoogleId()); + accountsLogic.makeAccountInstructor(studentGiver.getGoogleId()); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(studentGiver.getCourse()), instructorsLogic.getInstructorsForCourse(studentGiver.getCourse())); @@ -249,7 +255,7 @@ public void testGetRecipientsOfQuestion() throws Exception { ______TS("to nobody (general feedback)"); question = getQuestionFromDatastore("qn3InSession1InCourse1"); studentGiver = dataBundle.students.get("student1InCourse1"); - AccountsLogic.inst().makeAccountInstructor(studentGiver.getGoogleId()); + accountsLogic.makeAccountInstructor(studentGiver.getGoogleId()); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(studentGiver.getCourse()), instructorsLogic.getInstructorsForCourse(studentGiver.getCourse())); @@ -264,7 +270,7 @@ public void testGetRecipientsOfQuestion() throws Exception { ______TS("to self"); question = getQuestionFromDatastore("qn1InSession1InCourse1"); studentGiver = dataBundle.students.get("student1InCourse1"); - AccountsLogic.inst().makeAccountInstructor(studentGiver.getGoogleId()); + accountsLogic.makeAccountInstructor(studentGiver.getGoogleId()); courseRoster = new CourseRoster( studentsLogic.getStudentsForCourse(studentGiver.getCourse()), instructorsLogic.getInstructorsForCourse(studentGiver.getCourse())); @@ -564,23 +570,23 @@ public void testDeleteFeedbackQuestionCascade_existentQuestion_shouldDoCascadeDe // the question has some responses and comments assertFalse(frLogic.getFeedbackResponsesForQuestion(typicalQuestion.getId()).isEmpty()); assertFalse( - frcLogic.getFeedbackResponseCommentForSession( - typicalQuestion.getCourseId(), typicalQuestion.getFeedbackSessionName()).stream() + frcLogic.getFeedbackResponseCommentForSessionInSection( + typicalQuestion.getCourseId(), typicalQuestion.getFeedbackSessionName(), null).stream() .noneMatch(comment -> comment.feedbackQuestionId.equals(typicalQuestion.getId()))); fqLogic.deleteFeedbackQuestionCascade(typicalQuestion.getId()); - assertNull(logic.getFeedbackQuestion(typicalQuestion.getId())); + assertNull(fqLogic.getFeedbackQuestion(typicalQuestion.getId())); // the responses and comments should gone assertTrue(frLogic.getFeedbackResponsesForQuestion(typicalQuestion.getId()).isEmpty()); assertTrue( - frcLogic.getFeedbackResponseCommentForSession( - typicalQuestion.getCourseId(), typicalQuestion.getFeedbackSessionName()).stream() + frcLogic.getFeedbackResponseCommentForSessionInSection( + typicalQuestion.getCourseId(), typicalQuestion.getFeedbackSessionName(), null).stream() .noneMatch(comment -> comment.feedbackQuestionId.equals(typicalQuestion.getId()))); // verify that questions are shifted List questionsOfSessions = - logic.getFeedbackQuestionsForSession( + fqLogic.getFeedbackQuestionsForSession( typicalQuestion.getFeedbackSessionName(), typicalQuestion.getCourseId()); for (int i = 1; i <= questionsOfSessions.size(); i++) { assertEquals(i, questionsOfSessions.get(i - 1).getQuestionNumber()); diff --git a/src/test/java/teammates/test/cases/logic/FeedbackResponseCommentsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackResponseCommentsLogicTest.java similarity index 95% rename from src/test/java/teammates/test/cases/logic/FeedbackResponseCommentsLogicTest.java rename to src/test/java/teammates/logic/core/FeedbackResponseCommentsLogicTest.java index d5a2f4433a9..d3112d16502 100644 --- a/src/test/java/teammates/test/cases/logic/FeedbackResponseCommentsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackResponseCommentsLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.util.ArrayList; import java.util.List; @@ -13,9 +13,6 @@ import teammates.common.datatransfer.attributes.FeedbackResponseCommentAttributes; import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; -import teammates.logic.core.FeedbackQuestionsLogic; -import teammates.logic.core.FeedbackResponseCommentsLogic; -import teammates.logic.core.FeedbackResponsesLogic; /** * SUT: {@link FeedbackResponseCommentsLogic}. @@ -135,8 +132,8 @@ public void testGetFeedbackResponseComments() { ______TS("Typical successful case"); List actualFrComments = - frcLogic.getFeedbackResponseCommentForSession( - frComment.courseId, frComment.feedbackSessionName); + frcLogic.getFeedbackResponseCommentForSessionInSection( + frComment.courseId, frComment.feedbackSessionName, null); FeedbackResponseCommentAttributes actualFrComment = actualFrComments.get(0); assertEquals(frComment.courseId, actualFrComment.courseId); @@ -206,7 +203,8 @@ public void testUpdateFeedbackResponseComment() throws Exception { assertEquals(frComment.commentText, updatedComment.commentText); verifyPresentInDatastore(frComment); List actualFrComments = - frcLogic.getFeedbackResponseCommentForSession(frComment.courseId, frComment.feedbackSessionName); + frcLogic.getFeedbackResponseCommentForSessionInSection( + frComment.courseId, frComment.feedbackSessionName, null); FeedbackResponseCommentAttributes actualFrComment = null; for (FeedbackResponseCommentAttributes comment : actualFrComments) { @@ -239,8 +237,8 @@ public void testUpdateFeedbackResponseComment() throws Exception { public void testDeleteFeedbackResponseComment() throws Exception { FeedbackResponseCommentAttributes frComment = restoreFrCommentFromDataBundle("comment1FromT1C1ToR1Q1S1C1"); FeedbackResponseCommentAttributes actualFrComment = - frcLogic.getFeedbackResponseCommentForSession( - frComment.courseId, frComment.feedbackSessionName).get(1); + frcLogic.getFeedbackResponseCommentForSessionInSection( + frComment.courseId, frComment.feedbackSessionName, null).get(1); ______TS("silent fail nothing to delete"); @@ -275,7 +273,7 @@ public void testDeleteFeedbackResponseComments_deleteByCourseId() { String courseId = "idOfTypicalCourse1"; List frcList = - frcLogic.getFeedbackResponseCommentForSession(courseId, "First feedback session"); + frcLogic.getFeedbackResponseCommentForSessionInSection(courseId, "First feedback session", null); assertFalse(frcList.isEmpty()); frcLogic.deleteFeedbackResponseComments( @@ -283,7 +281,7 @@ public void testDeleteFeedbackResponseComments_deleteByCourseId() { .withCourseId(courseId) .build()); - frcList = frcLogic.getFeedbackResponseCommentForSession(courseId, "First feedback session"); + frcList = frcLogic.getFeedbackResponseCommentForSessionInSection(courseId, "First feedback session", null); assertEquals(0, frcList.size()); } @@ -350,7 +348,8 @@ public void testGetFeedbackResponseCommentsForQuestionInSection_withSectionName_ private void verifyNullFromGetFrCommentForSession(FeedbackResponseCommentAttributes frComment) { List frCommentsGot = - frcLogic.getFeedbackResponseCommentForSession(frComment.courseId, frComment.feedbackSessionName); + frcLogic.getFeedbackResponseCommentForSessionInSection( + frComment.courseId, frComment.feedbackSessionName, null); assertEquals(0, frCommentsGot.size()); } @@ -388,9 +387,9 @@ private void restoreFrCommentIdFromExistingOne( FeedbackResponseCommentAttributes existingFrComment) { List existingFrComments = - frcLogic.getFeedbackResponseCommentForSession( + frcLogic.getFeedbackResponseCommentForSessionInSection( existingFrComment.courseId, - existingFrComment.feedbackSessionName); + existingFrComment.feedbackSessionName, null); FeedbackResponseCommentAttributes existingFrCommentWithId = null; for (FeedbackResponseCommentAttributes c : existingFrComments) { diff --git a/src/test/java/teammates/test/cases/logic/FeedbackResponsesLogicTest.java b/src/test/java/teammates/logic/core/FeedbackResponsesLogicTest.java similarity index 96% rename from src/test/java/teammates/test/cases/logic/FeedbackResponsesLogicTest.java rename to src/test/java/teammates/logic/core/FeedbackResponsesLogicTest.java index b509a57e369..30e93fd5ee2 100644 --- a/src/test/java/teammates/test/cases/logic/FeedbackResponsesLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackResponsesLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.util.ArrayList; import java.util.HashSet; @@ -24,14 +24,7 @@ import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; import teammates.common.exception.EntityAlreadyExistsException; import teammates.common.exception.EntityDoesNotExistException; -import teammates.logic.core.FeedbackQuestionsLogic; -import teammates.logic.core.FeedbackResponseCommentsLogic; -import teammates.logic.core.FeedbackResponsesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.storage.api.FeedbackResponsesDb; -import teammates.storage.api.InstructorsDb; -import teammates.storage.api.StudentsDb; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; /** * SUT: {@link FeedbackResponsesLogic}. @@ -42,6 +35,8 @@ public class FeedbackResponsesLogicTest extends BaseLogicTest { private static FeedbackQuestionsLogic fqLogic = FeedbackQuestionsLogic.inst(); private static FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); private static FeedbackResponseCommentsLogic frcLogic = FeedbackResponseCommentsLogic.inst(); + private static InstructorsLogic instructorsLogic = InstructorsLogic.inst(); + private static StudentsLogic studentsLogic = StudentsLogic.inst(); private DataBundle questionTypeBundle; @@ -187,14 +182,11 @@ public void testUpdateFeedbackResponseCascade() throws Exception { ______TS("failure: no such response"); - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, + assertThrows(EntityDoesNotExistException.class, () -> frLogic.updateFeedbackResponseCascade( FeedbackResponseAttributes.updateOptionsBuilder("non-existent") .withGiver("random") .build())); - AssertHelper.assertContains( - FeedbackResponsesDb.ERROR_UPDATE_NON_EXISTENT, - ednee.getMessage()); } @Test @@ -412,8 +404,8 @@ public void testIsNameVisibleTo() { FeedbackResponseAttributes fr = getResponseFromDatastore("response1ForQ3S1C1"); CourseRoster roster = new CourseRoster( - new StudentsDb().getStudentsForCourse(fq.courseId), - new InstructorsDb().getInstructorsForCourse(fq.courseId)); + studentsLogic.getStudentsForCourse(fq.courseId), + instructorsLogic.getInstructorsForCourse(fq.courseId)); assertTrue(frLogic.isNameVisibleToUser(fq, fr, instructor.email, UserRole.INSTRUCTOR, true, roster)); assertTrue(frLogic.isNameVisibleToUser(fq, fr, instructor.email, UserRole.INSTRUCTOR, false, roster)); @@ -451,6 +443,26 @@ public void testIsNameVisibleTo() { assertTrue(frLogic.isNameVisibleToUser(fq, fr, student3.email, UserRole.STUDENT, false, roster)); assertFalse(frLogic.isNameVisibleToUser(fq, fr, student5.email, UserRole.STUDENT, false, roster)); + ______TS("test if visible to receiver/giver team members for team questions"); + + fq.recipientType = FeedbackParticipantType.TEAMS; + fq.showRecipientNameTo.clear(); + fq.showRecipientNameTo.add(FeedbackParticipantType.RECEIVER_TEAM_MEMBERS); + fq.giverType = FeedbackParticipantType.TEAMS; + fq.showGiverNameTo.clear(); + fq.showGiverNameTo.add(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF); + + fr.recipient = student5.team; + fr.giver = student.team; + assertTrue(frLogic.isNameVisibleToUser(fq, fr, student.email, UserRole.STUDENT, false, roster)); + assertTrue(frLogic.isNameVisibleToUser(fq, fr, student3.email, UserRole.STUDENT, false, roster)); + assertTrue(frLogic.isNameVisibleToUser(fq, fr, student5.email, UserRole.STUDENT, false, roster)); + + fr.giver = student.email; + assertTrue(frLogic.isNameVisibleToUser(fq, fr, student.email, UserRole.STUDENT, false, roster)); + assertTrue(frLogic.isNameVisibleToUser(fq, fr, student3.email, UserRole.STUDENT, false, roster)); + assertTrue(frLogic.isNameVisibleToUser(fq, fr, student5.email, UserRole.STUDENT, false, roster)); + ______TS("test anonymous team recipients"); // Only members of the recipient team should be able to see the recipient name fq.recipientType = FeedbackParticipantType.TEAMS; diff --git a/src/test/java/teammates/test/cases/logic/FeedbackSessionsLogicTest.java b/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java similarity index 97% rename from src/test/java/teammates/test/cases/logic/FeedbackSessionsLogicTest.java rename to src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java index fdf6a66b3f4..0a4cb3aac60 100644 --- a/src/test/java/teammates/test/cases/logic/FeedbackSessionsLogicTest.java +++ b/src/test/java/teammates/logic/core/FeedbackSessionsLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.time.Duration; import java.time.Instant; @@ -30,15 +30,11 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.JsonUtils; +import teammates.common.util.ThreadHelper; import teammates.common.util.TimeHelper; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.FeedbackQuestionsLogic; -import teammates.logic.core.FeedbackResponseCommentsLogic; -import teammates.logic.core.FeedbackResponsesLogic; -import teammates.logic.core.FeedbackSessionsLogic; +import teammates.common.util.TimeHelperExtension; import teammates.storage.api.FeedbackSessionsDb; -import teammates.test.driver.AssertHelper; -import teammates.test.driver.TimeHelperExtension; +import teammates.test.AssertHelper; /** * SUT: {@link FeedbackSessionsLogic}. @@ -46,6 +42,7 @@ public class FeedbackSessionsLogicTest extends BaseLogicTest { private static CoursesLogic coursesLogic = CoursesLogic.inst(); private static FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); + private static FeedbackSessionsDb fsDb = new FeedbackSessionsDb(); private static FeedbackQuestionsLogic fqLogic = FeedbackQuestionsLogic.inst(); private static FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); private static FeedbackResponseCommentsLogic frcLogic = FeedbackResponseCommentsLogic.inst(); @@ -72,7 +69,8 @@ public void testDeleteFeedbackSessionCascade_deleteSessionNotInRecycleBin_should assertFalse( frLogic.getFeedbackResponsesForSession(fsa.getFeedbackSessionName(), fsa.getCourseId()).isEmpty()); assertFalse( - frcLogic.getFeedbackResponseCommentForSession(fsa.getCourseId(), fsa.getFeedbackSessionName()).isEmpty()); + frcLogic.getFeedbackResponseCommentForSessionInSection(fsa.getCourseId(), fsa.getFeedbackSessionName(), null) + .isEmpty()); // delete existing feedback session directly fsLogic.deleteFeedbackSessionCascade(fsa.getFeedbackSessionName(), fsa.getCourseId()); @@ -84,7 +82,8 @@ public void testDeleteFeedbackSessionCascade_deleteSessionNotInRecycleBin_should assertTrue( frLogic.getFeedbackResponsesForSession(fsa.getFeedbackSessionName(), fsa.getCourseId()).isEmpty()); assertTrue( - frcLogic.getFeedbackResponseCommentForSession(fsa.getCourseId(), fsa.getFeedbackSessionName()).isEmpty()); + frcLogic.getFeedbackResponseCommentForSessionInSection(fsa.getCourseId(), fsa.getFeedbackSessionName(), null) + .isEmpty()); } @Test @@ -96,7 +95,8 @@ public void testDeleteFeedbackSessionCascade_deleteSessionInRecycleBin_shouldDoC assertFalse( frLogic.getFeedbackResponsesForSession(fsa.getFeedbackSessionName(), fsa.getCourseId()).isEmpty()); assertFalse( - frcLogic.getFeedbackResponseCommentForSession(fsa.getCourseId(), fsa.getFeedbackSessionName()).isEmpty()); + frcLogic.getFeedbackResponseCommentForSessionInSection(fsa.getCourseId(), fsa.getFeedbackSessionName(), null) + .isEmpty()); fsLogic.moveFeedbackSessionToRecycleBin(fsa.getFeedbackSessionName(), fsa.getCourseId()); assertNull(fsLogic.getFeedbackSession(fsa.getFeedbackSessionName(), fsa.getCourseId())); assertNotNull(fsLogic.getFeedbackSessionFromRecycleBin(fsa.getFeedbackSessionName(), fsa.getCourseId())); @@ -111,7 +111,8 @@ public void testDeleteFeedbackSessionCascade_deleteSessionInRecycleBin_shouldDoC assertTrue( frLogic.getFeedbackResponsesForSession(fsa.getFeedbackSessionName(), fsa.getCourseId()).isEmpty()); assertTrue( - frcLogic.getFeedbackResponseCommentForSession(fsa.getCourseId(), fsa.getFeedbackSessionName()).isEmpty()); + frcLogic.getFeedbackResponseCommentForSessionInSection(fsa.getCourseId(), fsa.getFeedbackSessionName(), null) + .isEmpty()); } @Test @@ -342,6 +343,9 @@ private void testGetFeedbackSessionsClosingWithinTimeLimit() throws Exception { .withTimezone(ZoneId.of("UTC")) .build()); + // wait for very briefly so that the above session will be within the time limit + ThreadHelper.waitFor(5); + sessionList = fsLogic.getFeedbackSessionsClosingWithinTimeLimit(); assertEquals(1, sessionList.size()); @@ -557,7 +561,7 @@ private void testCreateAndDeleteFeedbackSession() throws InvalidParametersExcept assertEquals( "The provided feedback session name is not acceptable to TEAMMATES " + "as it cannot contain the following special html characters in brackets: " - + "(< > " / ' &)", + + "(< > \" / ' &)", e.getMessage()); fs.setFeedbackSessionName("test %| test"); @@ -638,7 +642,6 @@ private void testUpdateFeedbackSession() throws Exception { @Test public void testUpdateFeedbackSession_shouldAdjustEmailSendingStatusAccordingly() throws Exception { - FeedbackSessionsDb fsDb = new FeedbackSessionsDb(); FeedbackSessionAttributes typicalSession = dataBundle.feedbackSessions.get("session1InCourse1"); ______TS("open email sent, whether the updated session is open determines the open email sending status"); @@ -953,12 +956,27 @@ private void testRestoreFeedbackSessionFromRecycleBin() throws InvalidParameters assertTrue(feedbackSession.isSessionDeleted()); fsLogic.restoreFeedbackSessionFromRecycleBin(feedbackSessionName, courseId); - feedbackSession.resetDeletedTime(); + feedbackSession.setDeletedTime(null); verifyPresentInDatastore(feedbackSession); assertFalse(feedbackSession.isSessionDeleted()); } + @Test + public void testGetSessionResultsForUser_studentSpecificQuestionAndSection_shouldThrowOperationNotSupported() { + // extra test data used on top of typical data bundle + removeAndRestoreDataBundle(loadDataBundle("/SpecialCharacterTest.json")); + + FeedbackQuestionAttributes question = fqLogic.getFeedbackQuestion( + "First Session", "FQLogicPCT.CS2104", 1); + + assertThrows(UnsupportedOperationException.class, () -> { + fsLogic.getSessionResultsForUser( + "First Session", "FQLogicPCT.CS2104", "FQLogicPCT.alice.b@gmail.tmt", + UserRole.STUDENT, question.getId(), Const.DEFAULT_SECTION); + }); + } + @Test public void testGetSessionResultsForUser_studentSpecificQuestionNoSection_shouldHaveCorrectResponsesFiltered() { // extra test data used on top of typical data bundle diff --git a/src/test/java/teammates/test/cases/logic/InstructorsLogicTest.java b/src/test/java/teammates/logic/core/InstructorsLogicTest.java similarity index 77% rename from src/test/java/teammates/test/cases/logic/InstructorsLogicTest.java rename to src/test/java/teammates/logic/core/InstructorsLogicTest.java index 6f93c038534..29a4bed383d 100644 --- a/src/test/java/teammates/test/cases/logic/InstructorsLogicTest.java +++ b/src/test/java/teammates/logic/core/InstructorsLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.time.ZoneId; import java.util.ArrayList; @@ -20,13 +20,8 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.FeedbackResponseCommentsLogic; -import teammates.logic.core.FeedbackResponsesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.logic.core.InstructorsLogic; import teammates.storage.api.InstructorsDb; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; /** * SUT: {@link InstructorsLogic}. @@ -36,6 +31,9 @@ public class InstructorsLogicTest extends BaseLogicTest { private static InstructorsLogic instructorsLogic = InstructorsLogic.inst(); private static InstructorsDb instructorsDb = new InstructorsDb(); private static CoursesLogic coursesLogic = CoursesLogic.inst(); + private static FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); + private static FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); + private static FeedbackResponseCommentsLogic frcLogic = FeedbackResponseCommentsLogic.inst(); @Override protected void prepareTestData() { @@ -56,13 +54,7 @@ public void testAll() throws Exception { testGetInstructorsForGoogleId(); testGetInstructorForRegistrationKey(); testGetInstructorsForCourse(); - testGetKeyForInstructor(); - testIsGoogleIdOfInstructorOfCourse(); - testIsEmailOfInstructorOfCourse(); - testVerifyInstructorExists(); - testVerifyIsEmailOfInstructorOfCourse(); testVerifyAtLeastOneInstructorIsDisplayed(); - testIsNewInstructor(); testAddInstructor(); testGetCoOwnersForCourse(); testUpdateInstructorByGoogleIdCascade(); @@ -105,7 +97,8 @@ private void testAddInstructor() throws Exception { String expectedError = "\"" + instr.email + "\" is not acceptable to TEAMMATES as a/an email " + "because it is not in the correct format. An email address contains " - + "some text followed by one '@' sign followed by some more text. " + + "some text followed by one '@' sign followed by some more text, " + + "and should end with a top level domain address like .com. " + "It cannot be longer than 254 characters, cannot be empty and " + "cannot contain spaces."; InvalidParametersException ipe = assertThrows(InvalidParametersException.class, @@ -269,137 +262,6 @@ private void testGetInstructorsForGoogleId() { AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); } - private void testGetKeyForInstructor() throws Exception { - - ______TS("success: get encrypted key for instructor"); - - String courseId = "idOfSampleCourse-demo"; - String email = "instructorNotYetJoined@email.tmt"; - - InstructorAttributes instructor = instructorsDb.getInstructorForEmail(courseId, email); - - String key = instructorsLogic.getEncryptedKeyForInstructor(instructor.courseId, instructor.email); - String expected = StringHelper.encrypt(instructor.key); - assertEquals(expected, key); - - ______TS("failure: non-existent instructor"); - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> instructorsLogic.getEncryptedKeyForInstructor(courseId, "non-existent@email.tmt")); - assertEquals("Instructor non-existent@email.tmt does not belong to course " + courseId, - ednee.getMessage()); - - ______TS("failure: null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> instructorsLogic.getEncryptedKeyForInstructor(courseId, null)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - - ae = assertThrows(AssertionError.class, () -> instructorsLogic.getEncryptedKeyForInstructor(null, email)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - - } - - private void testIsGoogleIdOfInstructorOfCourse() { - - ______TS("success: is an instructor of a given course"); - - String instructorId = "idOfInstructor1OfCourse1"; - - boolean result = instructorsLogic.isGoogleIdOfInstructorOfCourse(instructorId, "idOfTypicalCourse1"); - - assertTrue(result); - - ______TS("failure: not an instructor of a given course"); - - String courseId = "idOfTypicalCourse2"; - - result = instructorsLogic.isGoogleIdOfInstructorOfCourse(instructorId, courseId); - - assertFalse(result); - - ______TS("failure: null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> instructorsLogic.isGoogleIdOfInstructorOfCourse(null, courseId)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - - ae = assertThrows(AssertionError.class, () -> instructorsLogic.isGoogleIdOfInstructorOfCourse(instructorId, null)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - } - - private void testIsEmailOfInstructorOfCourse() { - - ______TS("success: is an instructor of a given course"); - - String instructorEmail = "instructor1@course1.tmt"; - - boolean result = instructorsLogic.isEmailOfInstructorOfCourse(instructorEmail, "idOfTypicalCourse1"); - - assertTrue(result); - - ______TS("failure: not an instructor of a given course"); - - String courseId = "idOfTypicalCourse2"; - - result = instructorsLogic.isEmailOfInstructorOfCourse(instructorEmail, courseId); - - assertFalse(result); - - ______TS("failure: null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> instructorsLogic.isEmailOfInstructorOfCourse(instructorEmail, null)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - - ae = assertThrows(AssertionError.class, () -> instructorsLogic.isEmailOfInstructorOfCourse(null, courseId)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - - } - - private void testVerifyInstructorExists() throws Exception { - - ______TS("success: instructor does exist"); - - instructorsLogic.verifyInstructorExists("idOfInstructor1OfCourse1"); - - ______TS("failure: instructor doesn't exist"); - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> instructorsLogic.verifyInstructorExists("nonExistingInstructor")); - AssertHelper.assertContains("Instructor does not exist", ednee.getMessage()); - - ______TS("failure: null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> instructorsLogic.verifyInstructorExists(null)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - } - - private void testVerifyIsEmailOfInstructorOfCourse() throws Exception { - - ______TS("success: instructor belongs to course"); - - String courseId = "idOfTypicalCourse1"; - instructorsLogic.verifyIsEmailOfInstructorOfCourse("instructor1@course1.tmt", courseId); - - ______TS("failure: instructor doesn't belong to course"); - String instructorEmail = "nonExistingInstructor@email.tmt"; - - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> instructorsLogic.verifyIsEmailOfInstructorOfCourse(instructorEmail, courseId)); - assertEquals("Instructor " + instructorEmail + " does not belong to course " + courseId, - ednee.getMessage()); - ______TS("failure: null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> instructorsLogic.verifyIsEmailOfInstructorOfCourse(null, courseId)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - - ae = assertThrows(AssertionError.class, - () -> instructorsLogic.verifyIsEmailOfInstructorOfCourse(instructorEmail, null)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - } - private void testVerifyAtLeastOneInstructorIsDisplayed() throws Exception { ______TS("success: at least one instructor is displayed to students"); @@ -431,40 +293,8 @@ private void testVerifyAtLeastOneInstructorIsDisplayed() throws Exception { AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); } - private void testIsNewInstructor() { - - ______TS("success: instructor with only 1 sample course"); - - String instructorId = "idOfInstructorWithOnlyOneSampleCourse"; - assertTrue(instructorsLogic.isNewInstructor(instructorId)); - - ______TS("success: instructor without any course"); - - instructorId = "instructorWithoutCourses"; - assertTrue(instructorsLogic.isNewInstructor(instructorId)); - - ______TS("failure: instructor with only 1 course, but not a sample course"); - - instructorId = "idOfInstructor4"; - assertFalse(instructorsLogic.isNewInstructor(instructorId)); - - ______TS("failure: instructor is not new user"); - - instructorId = "idOfInstructor1OfCourse1"; - assertFalse(instructorsLogic.isNewInstructor(instructorId)); - - ______TS("failure: null parameter"); - - AssertionError ae = assertThrows(AssertionError.class, () -> instructorsLogic.isNewInstructor(null)); - AssertHelper.assertContains("Supplied parameter was null", ae.getMessage()); - - } - @Test public void testUpdateInstructorByGoogleIdCascade_shouldDoCascadeUpdateToCommentsAndResponses() throws Exception { - FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); - FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); - FeedbackResponseCommentsLogic frcLogic = FeedbackResponseCommentsLogic.inst(); InstructorAttributes instructorToBeUpdated = dataBundle.instructors.get("instructor1OfCourse1"); instructorsLogic.updateInstructorByGoogleIdCascade( @@ -674,15 +504,15 @@ public void testDeleteInstructorCascade() throws Exception { InstructorAttributes instructorDeleted = instructorsLogic.getInstructorForEmail(courseId, email); assertNotNull(instructorDeleted); // the instructors has some responses in course - assertFalse(FeedbackResponsesLogic.inst().getFeedbackResponsesFromGiverForCourse(courseId, email).isEmpty()); - assertFalse(FeedbackResponsesLogic.inst().getFeedbackResponsesForReceiverForCourse(courseId, email).isEmpty()); + assertFalse(frLogic.getFeedbackResponsesFromGiverForCourse(courseId, email).isEmpty()); + assertFalse(frLogic.getFeedbackResponsesForReceiverForCourse(courseId, email).isEmpty()); instructorsLogic.deleteInstructorCascade(courseId, email); verifyAbsentInDatastore(instructorDeleted); // there should be no response of the instructor - assertTrue(FeedbackResponsesLogic.inst().getFeedbackResponsesFromGiverForCourse(courseId, email).isEmpty()); - assertTrue(FeedbackResponsesLogic.inst().getFeedbackResponsesForReceiverForCourse(courseId, email).isEmpty()); + assertTrue(frLogic.getFeedbackResponsesFromGiverForCourse(courseId, email).isEmpty()); + assertTrue(frLogic.getFeedbackResponsesForReceiverForCourse(courseId, email).isEmpty()); ______TS("failure: null parameter"); @@ -732,11 +562,11 @@ public void testDeleteInstructorsForGoogleIdCascade_archivedInstructor_shouldDel InstructorAttributes instructor5 = dataBundle.instructors.get("instructor5"); assertNotNull(instructor5.getGoogleId()); - logic.setArchiveStatusOfInstructor(instructor5.getGoogleId(), instructor5.getCourseId(), true); + instructorsLogic.setArchiveStatusOfInstructor(instructor5.getGoogleId(), instructor5.getCourseId(), true); // this is an archived instructor assertTrue( - logic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail()).isArchived); + instructorsLogic.getInstructorForEmail(instructor5.getCourseId(), instructor5.getEmail()).isArchived); instructorsLogic.deleteInstructorsForGoogleIdCascade(instructor5.getGoogleId()); @@ -756,7 +586,7 @@ public void testDeleteInstructorsForGoogleIdCascade() throws Exception { InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); InstructorAttributes instructor1OfCourse2 = dataBundle.instructors.get("instructor1OfCourse2"); // make instructor1OfCourse1 to have the same googleId with instructor1OfCourse2 - logic.updateInstructor( + instructorsLogic.updateInstructorByEmail( InstructorAttributes .updateOptionsWithEmailBuilder(instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail()) .withGoogleId(instructor1OfCourse2.getGoogleId()) @@ -768,11 +598,11 @@ public void testDeleteInstructorsForGoogleIdCascade() throws Exception { // instructor1OfCourse1 has some responses in course assertFalse( - FeedbackResponsesLogic.inst().getFeedbackResponsesFromGiverForCourse( + frLogic.getFeedbackResponsesFromGiverForCourse( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail()) .isEmpty()); assertFalse( - FeedbackResponsesLogic.inst().getFeedbackResponsesForReceiverForCourse( + frLogic.getFeedbackResponsesForReceiverForCourse( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail()) .isEmpty()); @@ -792,11 +622,11 @@ public void testDeleteInstructorsForGoogleIdCascade() throws Exception { instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail())); // instructor1OfCourse1's responses should be deleted also assertTrue( - FeedbackResponsesLogic.inst().getFeedbackResponsesFromGiverForCourse( + frLogic.getFeedbackResponsesFromGiverForCourse( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail()) .isEmpty()); assertTrue( - FeedbackResponsesLogic.inst().getFeedbackResponsesForReceiverForCourse( + frLogic.getFeedbackResponsesForReceiverForCourse( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getEmail()) .isEmpty()); assertNull(instructorsLogic.getInstructorForEmail( diff --git a/src/test/java/teammates/test/cases/logic/ProfilesLogicTest.java b/src/test/java/teammates/logic/core/ProfilesLogicTest.java similarity index 98% rename from src/test/java/teammates/test/cases/logic/ProfilesLogicTest.java rename to src/test/java/teammates/logic/core/ProfilesLogicTest.java index fba9ddd49fe..0b1ceae049d 100644 --- a/src/test/java/teammates/test/cases/logic/ProfilesLogicTest.java +++ b/src/test/java/teammates/logic/core/ProfilesLogicTest.java @@ -1,9 +1,8 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.StudentProfileAttributes; -import teammates.logic.core.ProfilesLogic; /** * SUT: {@link ProfilesLogic}. diff --git a/src/test/java/teammates/test/cases/logic/StudentsLogicTest.java b/src/test/java/teammates/logic/core/StudentsLogicTest.java similarity index 84% rename from src/test/java/teammates/test/cases/logic/StudentsLogicTest.java rename to src/test/java/teammates/logic/core/StudentsLogicTest.java index 841c198813f..1cc6b8c4a8b 100644 --- a/src/test/java/teammates/test/cases/logic/StudentsLogicTest.java +++ b/src/test/java/teammates/logic/core/StudentsLogicTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.logic; +package teammates.logic.core; import java.util.ArrayList; import java.util.Comparator; @@ -9,7 +9,6 @@ import org.testng.annotations.Test; import teammates.common.datatransfer.AttributesDeletionQuery; -import teammates.common.datatransfer.TeamDetailsBundle; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; @@ -20,20 +19,16 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.StringHelper; -import teammates.logic.core.AccountsLogic; -import teammates.logic.core.FeedbackQuestionsLogic; -import teammates.logic.core.FeedbackResponsesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.logic.core.StudentsLogic; -import teammates.storage.api.StudentsDb; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; /** * SUT: {@link StudentsLogic}. */ public class StudentsLogicTest extends BaseLogicTest { + private static AccountsLogic accountsLogic = AccountsLogic.inst(); private static StudentsLogic studentsLogic = StudentsLogic.inst(); + private static CoursesLogic coursesLogic = CoursesLogic.inst(); private static FeedbackResponsesLogic frLogic = FeedbackResponsesLogic.inst(); private static FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); private static FeedbackQuestionsLogic fqLogic = FeedbackQuestionsLogic.inst(); @@ -58,40 +53,13 @@ public void testAll() throws Exception { testGetStudentsForGoogleId(); testGetStudentForCourseIdAndGoogleId(); testGetStudentsForCourse(); - testGetEncryptedKeyForStudent(); testIsStudentInAnyCourse(); - testIsStudentInCourse(); testIsStudentInTeam(); testIsStudentsInSameTeam(); - - testGetTeamForStudent(); - testValidateSections(); testUpdateStudentCascade(); } - private void testGetTeamForStudent() { - ______TS("Typical case: get team of existing student"); - - String courseId = "idOfTypicalCourse1"; - String googleId = "student1InCourse1"; - StudentAttributes student = StudentsLogic.inst().getStudentForCourseIdAndGoogleId(courseId, googleId); - TeamDetailsBundle team = StudentsLogic.inst().getTeamDetailsForStudent(student); - - assertEquals("Team 1.1'\"", team.name); - assertNotNull(team.students); - assertEquals(4, team.students.size()); - - ______TS("Typical case: get team of non-existing student"); - courseId = "idOfTypicalCourse1"; - googleId = "idOfNonExistingStudent"; - student = StudentsLogic.inst().getStudentForCourseIdAndGoogleId(courseId, googleId); - team = StudentsLogic.inst().getTeamDetailsForStudent(student); - - assertNull(team); - - } - private void testValidateSections() throws Exception { CourseAttributes typicalCourse1 = dataBundle.courses.get("typicalCourse1"); @@ -239,11 +207,8 @@ public void testUpdateStudentCascade() throws Exception { StudentAttributes.updateOptionsBuilder(finalStudent4InCourse1.course, "non-existent@email") .withName("test") .build(); - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, + assertThrows(EntityDoesNotExistException.class, () -> studentsLogic.updateStudentCascade(updateOptions)); - assertEquals( - StudentsDb.ERROR_UPDATE_NON_EXISTENT + updateOptions, - ednee.getMessage()); ______TS("check for InvalidParameters"); @@ -263,11 +228,11 @@ public void testUpdateStudentCascade_teamChanged_shouldDeleteOldResponsesWithinT FeedbackResponseAttributes responseToBeDeleted = dataBundle.feedbackResponses.get("response2ForQ2S2C1"); FeedbackQuestionAttributes feedbackQuestionInDb = - logic.getFeedbackQuestion(responseToBeDeleted.feedbackSessionName, + fqLogic.getFeedbackQuestion(responseToBeDeleted.feedbackSessionName, responseToBeDeleted.courseId, Integer.parseInt(responseToBeDeleted.feedbackQuestionId)); responseToBeDeleted = - logic.getFeedbackResponse(feedbackQuestionInDb.getId(), + frLogic.getFeedbackResponse(feedbackQuestionInDb.getId(), responseToBeDeleted.giver, responseToBeDeleted.recipient); // response exist @@ -279,7 +244,7 @@ public void testUpdateStudentCascade_teamChanged_shouldDeleteOldResponsesWithinT .build()); responseToBeDeleted = - logic.getFeedbackResponse(feedbackQuestionInDb.getId(), + frLogic.getFeedbackResponse(feedbackQuestionInDb.getId(), responseToBeDeleted.giver, responseToBeDeleted.recipient); // response should not exist @@ -301,7 +266,7 @@ public void testRegenerateStudentRegistrationKey() throws Exception { ______TS("non-existent student"); String nonExistentEmail = "non-existent@email"; - assertNull(logic.getStudentForEmail(student1InCourse1.course, nonExistentEmail)); + assertNull(studentsLogic.getStudentForEmail(student1InCourse1.course, nonExistentEmail)); EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, () -> studentsLogic.regenerateStudentRegistrationKey(student1InCourse1.course, nonExistentEmail)); @@ -478,34 +443,6 @@ private void testGetStudentsForCourse() { } - private void testGetEncryptedKeyForStudent() throws Exception { - - ______TS("null parameters"); - - AssertionError ae = assertThrows(AssertionError.class, - () -> studentsLogic.getEncryptedKeyForStudent("valid.course.id", null)); - assertEquals(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getMessage()); - - ______TS("non-existent student"); - - StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - String nonExistStudentEmail = "non@existent"; - EntityDoesNotExistException ednee = assertThrows(EntityDoesNotExistException.class, - () -> studentsLogic.getEncryptedKeyForStudent(student1InCourse1.course, nonExistStudentEmail)); - assertEquals("Student does not exist: [" + student1InCourse1.course + "/" + nonExistStudentEmail + "]", - ednee.getMessage()); - - // the typical case below seems unnecessary though--it is not useful for now - // as the method itself is too simple - ______TS("typical case"); - - String course1Id = dataBundle.courses.get("typicalCourse1").getId(); - String actualKey = studentsLogic.getEncryptedKeyForStudent(course1Id, student1InCourse1.email); - String expectedKey = StringHelper.encrypt( - studentsLogic.getStudentForCourseIdAndGoogleId(course1Id, student1InCourse1.googleId).key); - assertEquals(expectedKey, actualKey); - } - private void testIsStudentInAnyCourse() { ______TS("non-existent student"); @@ -519,20 +456,6 @@ private void testIsStudentInAnyCourse() { assertTrue(studentsLogic.isStudentInAnyCourse(student1InCourse1.googleId)); } - private void testIsStudentInCourse() { - - ______TS("non-existent student"); - - String nonExistStudentEmail = "nonExist@google.tmt"; - CourseAttributes course1 = dataBundle.courses.get("typicalCourse1"); - assertFalse(studentsLogic.isStudentInCourse(course1.getId(), nonExistStudentEmail)); - - ______TS("typical case"); - - StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - assertTrue(studentsLogic.isStudentInCourse(course1.getId(), student1InCourse1.email)); - } - private void testIsStudentInTeam() { ______TS("non-existent student"); @@ -584,7 +507,7 @@ public void testDeleteStudentCascade_lastPersonInTeam_shouldDeleteTeamResponses( studentsLogic.deleteStudentCascade(student1InCourse2.getCourse(), student1InCourse2.getEmail()); // there is only one student in the team assertEquals(1, - StudentsLogic.inst().getStudentsForTeam(student2InCourse2.getTeam(), student2InCourse2.getCourse()).size()); + studentsLogic.getStudentsForTeam(student2InCourse2.getTeam(), student2InCourse2.getCourse()).size()); // get the response from DB FeedbackResponseAttributes fra = dataBundle.feedbackResponses.get("response1ForQ1S1C2"); @@ -663,7 +586,7 @@ public void testDeleteStudentCascade() { public void testDeleteStudentsForGoogleIdCascade_typicalCase_shouldDoCascadeDeletion() { StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - assertNotNull(logic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); + assertNotNull(studentsLogic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); assertNotNull(student1InCourse1.googleId); // the student has response @@ -677,7 +600,7 @@ public void testDeleteStudentsForGoogleIdCascade_typicalCase_shouldDoCascadeDele studentsLogic.deleteStudentsForGoogleIdCascade(student1InCourse1.googleId); // verify that the student is deleted - assertNull(logic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); + assertNull(studentsLogic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); // his responses should also be deleted assertTrue( @@ -695,7 +618,7 @@ public void testDeleteStudentsForGoogleIdCascade_nonExistentGoogleId_shouldPass( // other students are not affected StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - assertNotNull(logic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); + assertNotNull(studentsLogic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); } @Test @@ -703,7 +626,7 @@ public void testDeleteStudentsInCourseCascade_typicalCase_shouldDoCascadeDeletio StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); // there are students in the course - assertFalse(logic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); + assertFalse(studentsLogic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); // some have give responses assertFalse( frLogic.getFeedbackResponsesFromGiverForCourse( @@ -715,9 +638,9 @@ public void testDeleteStudentsInCourseCascade_typicalCase_shouldDoCascadeDeletio studentsLogic.deleteStudentsInCourseCascade(student1InCourse1.getCourse()); // students are deleted - assertTrue(logic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); + assertTrue(studentsLogic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); // but course exist - assertNotNull(logic.getCourse(student1InCourse1.getCourse())); + assertNotNull(coursesLogic.getCourse(student1InCourse1.getCourse())); // their responses are gone assertTrue( frLogic.getFeedbackResponsesFromGiverForCourse( @@ -734,9 +657,10 @@ public void testDeleteStudents_byCourseId_shouldDeleteAllStudents() { // the two are in different course assertNotEquals(student1InCourse1.getCourse(), student1InArchivedCourse.getCourse()); - assertNotNull(logic.getStudentForEmail(student1InArchivedCourse.getCourse(), student1InArchivedCourse.getEmail())); + assertNotNull(studentsLogic.getStudentForEmail(student1InArchivedCourse.getCourse(), + student1InArchivedCourse.getEmail())); // there are students in the course - assertFalse(logic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); + assertFalse(studentsLogic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); studentsLogic.deleteStudents( AttributesDeletionQuery.builder() @@ -744,9 +668,10 @@ public void testDeleteStudents_byCourseId_shouldDeleteAllStudents() { .build()); // students are deleted - assertTrue(logic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); + assertTrue(studentsLogic.getStudentsForCourse(student1InCourse1.getCourse()).isEmpty()); // students in other courses are not affected - assertNotNull(logic.getStudentForEmail(student1InArchivedCourse.getCourse(), student1InArchivedCourse.getEmail())); + assertNotNull(studentsLogic.getStudentForEmail(student1InArchivedCourse.getCourse(), + student1InArchivedCourse.getEmail())); } @Test @@ -755,11 +680,11 @@ public void testDeleteStudentsInCourseCascade_nonExistCourse_shouldPass() { // other students are not affected StudentAttributes student1InCourse1 = dataBundle.students.get("student1InCourse1"); - assertNotNull(logic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); + assertNotNull(studentsLogic.getStudentForEmail(student1InCourse1.getCourse(), student1InCourse1.getEmail())); } @AfterClass public void classTearDown() { - AccountsLogic.inst().deleteAccountCascade(dataBundle.students.get("student4InCourse1").googleId); + accountsLogic.deleteAccountCascade(dataBundle.students.get("student4InCourse1").googleId); } } diff --git a/src/test/java/teammates/logic/core/package-info.java b/src/test/java/teammates/logic/core/package-info.java new file mode 100644 index 00000000000..24cc0857687 --- /dev/null +++ b/src/test/java/teammates/logic/core/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.logic.core} package. + */ +package teammates.logic.core; diff --git a/src/test/java/teammates/test/cases/storage/AccountsDbTest.java b/src/test/java/teammates/storage/api/AccountsDbTest.java similarity index 97% rename from src/test/java/teammates/test/cases/storage/AccountsDbTest.java rename to src/test/java/teammates/storage/api/AccountsDbTest.java index ca340f1c6a8..697bed4c8ae 100644 --- a/src/test/java/teammates/test/cases/storage/AccountsDbTest.java +++ b/src/test/java/teammates/storage/api/AccountsDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import org.testng.annotations.Test; @@ -9,9 +9,8 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; -import teammates.storage.api.AccountsDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link AccountsDb}. diff --git a/src/test/java/teammates/test/cases/storage/CoursesDbTest.java b/src/test/java/teammates/storage/api/CoursesDbTest.java similarity index 97% rename from src/test/java/teammates/test/cases/storage/CoursesDbTest.java rename to src/test/java/teammates/storage/api/CoursesDbTest.java index 969d93e399d..1772c476b52 100644 --- a/src/test/java/teammates/test/cases/storage/CoursesDbTest.java +++ b/src/test/java/teammates/storage/api/CoursesDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import java.time.ZoneId; import java.util.ArrayList; @@ -13,10 +13,9 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; -import teammates.storage.api.CoursesDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; -import teammates.test.driver.StringHelperExtension; +import teammates.common.util.StringHelperExtension; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link CoursesDb}. diff --git a/src/test/java/teammates/test/cases/storage/EntitiesDbTest.java b/src/test/java/teammates/storage/api/EntitiesDbTest.java similarity index 89% rename from src/test/java/teammates/test/cases/storage/EntitiesDbTest.java rename to src/test/java/teammates/storage/api/EntitiesDbTest.java index 415d768b849..ec03d0605b6 100644 --- a/src/test/java/teammates/test/cases/storage/EntitiesDbTest.java +++ b/src/test/java/teammates/storage/api/EntitiesDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import static teammates.common.util.FieldValidator.COURSE_ID_ERROR_MESSAGE; import static teammates.common.util.FieldValidator.REASON_INCORRECT_FORMAT; @@ -12,21 +12,19 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.FieldValidator; -import teammates.storage.api.CoursesDb; -import teammates.storage.api.EntitiesDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link teammates.storage.api.EntitiesDb}. */ public class EntitiesDbTest extends BaseComponentTestCase { + // We are using CoursesDb to test EntitiesDb here. + private CoursesDb coursesDb = new CoursesDb(); + @Test public void testCreateEntity() throws Exception { - //We are using CoursesDb to test EntitiesDb here. - CoursesDb coursesDb = new CoursesDb(); - /*Explanation: * The SUT (i.e. EntitiesDb::createEntity) has 4 paths. Therefore, we * have 4 test cases here, one for each path. diff --git a/src/test/java/teammates/test/cases/storage/FeedbackQuestionsDbTest.java b/src/test/java/teammates/storage/api/FeedbackQuestionsDbTest.java similarity index 99% rename from src/test/java/teammates/test/cases/storage/FeedbackQuestionsDbTest.java rename to src/test/java/teammates/storage/api/FeedbackQuestionsDbTest.java index c46dbe263d2..a85c1e7dc95 100644 --- a/src/test/java/teammates/test/cases/storage/FeedbackQuestionsDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackQuestionsDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import static teammates.common.util.FieldValidator.PARTICIPANT_TYPE_TEAM_ERROR_MESSAGE; @@ -19,9 +19,9 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; -import teammates.storage.api.FeedbackQuestionsDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; +import teammates.common.util.ThreadHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link FeedbackQuestionsDb}. @@ -55,6 +55,9 @@ public void testTimestamp() throws Exception { ______TS("success : update lastUpdated"); + // wait for very briefly so that the update timestamp is guaranteed to change + ThreadHelper.waitFor(5); + feedbackQuestion.questionNumber++; fqDb.updateFeedbackQuestion( FeedbackQuestionAttributes.updateOptionsBuilder(feedbackQuestion.getId()) diff --git a/src/test/java/teammates/test/cases/storage/FeedbackResponseCommentsDbTest.java b/src/test/java/teammates/storage/api/FeedbackResponseCommentsDbTest.java similarity index 99% rename from src/test/java/teammates/test/cases/storage/FeedbackResponseCommentsDbTest.java rename to src/test/java/teammates/storage/api/FeedbackResponseCommentsDbTest.java index b4cc9859710..b3c68305d32 100644 --- a/src/test/java/teammates/test/cases/storage/FeedbackResponseCommentsDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackResponseCommentsDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import java.time.Instant; import java.util.ArrayList; @@ -18,10 +18,8 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.storage.api.EntitiesDb; -import teammates.storage.api.FeedbackResponseCommentsDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link FeedbackResponseCommentsDb}. diff --git a/src/test/java/teammates/test/cases/storage/FeedbackResponsesDbTest.java b/src/test/java/teammates/storage/api/FeedbackResponsesDbTest.java similarity index 94% rename from src/test/java/teammates/test/cases/storage/FeedbackResponsesDbTest.java rename to src/test/java/teammates/storage/api/FeedbackResponsesDbTest.java index ffc9f87ab2c..d0b6f7c7366 100644 --- a/src/test/java/teammates/test/cases/storage/FeedbackResponsesDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackResponsesDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import java.util.List; import java.util.Map; @@ -23,10 +23,9 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; -import teammates.storage.api.FeedbackQuestionsDb; -import teammates.storage.api.FeedbackResponsesDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; +import teammates.common.util.ThreadHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link FeedbackResponsesDb}. @@ -62,7 +61,7 @@ private void addQuestionsAndResponsesToDb() throws InvalidParametersException, E FeedbackResponseAttributes fra = dataBundle.feedbackResponses.get(i); // Update feedbackQuestionId for response - FeedbackQuestionAttributes fqa = logic.getFeedbackQuestion(fra.feedbackSessionName, + FeedbackQuestionAttributes fqa = fqDb.getFeedbackQuestion(fra.feedbackSessionName, fra.courseId, Integer.parseInt(fra.feedbackQuestionId)); fra.feedbackQuestionId = fqa.getId(); frDb.createEntity(fra); @@ -112,6 +111,9 @@ public void testTimestamp() ______TS("success : update lastUpdated"); + // wait for very briefly so that the update timestamp is guaranteed to change + ThreadHelper.waitFor(5); + String newRecipientEmail = "new-email@tmt.com"; feedbackResponse.recipient = newRecipientEmail; frDb.updateFeedbackResponse( @@ -512,6 +514,40 @@ public void testGetFeedbackResponsesFromGiverForQuestion() { questionId, "non-existentStudentInCourse1@gmail.tmt").isEmpty()); } + @Test + public void testGetFeedbackResponsesForReceiverForQuestion() { + + ______TS("standard success case"); + + String questionId = fras.get("response1ForQ1S1C1").feedbackQuestionId; + + List responses = + frDb.getFeedbackResponsesForReceiverForQuestion(questionId, + "student1InCourse1@gmail.tmt"); + + assertEquals(1, responses.size()); + + ______TS("null params"); + + AssertionError ae = assertThrows(AssertionError.class, + () -> frDb.getFeedbackResponsesForReceiverForQuestion(null, "student1InCourse1@gmail.tmt")); + AssertHelper.assertContains(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getLocalizedMessage()); + + ae = assertThrows(AssertionError.class, + () -> frDb.getFeedbackResponsesForReceiverForQuestion(questionId, null)); + AssertHelper.assertContains(Const.StatusCodes.DBLEVEL_NULL_INPUT, ae.getLocalizedMessage()); + + ______TS("non-existent feedback question"); + + assertTrue(frDb.getFeedbackResponsesForReceiverForQuestion( + "non-existent fq id", "student1InCourse1@gmail.tmt").isEmpty()); + + ______TS("non-existent receiver"); + + assertTrue(frDb.getFeedbackResponsesForReceiverForQuestion( + questionId, "non-existentStudentInCourse1@gmail.tmt").isEmpty()); + } + @Test public void testGetFeedbackResponsesFromGiverForCourse() { diff --git a/src/test/java/teammates/test/cases/storage/FeedbackSessionsDbTest.java b/src/test/java/teammates/storage/api/FeedbackSessionsDbTest.java similarity index 99% rename from src/test/java/teammates/test/cases/storage/FeedbackSessionsDbTest.java rename to src/test/java/teammates/storage/api/FeedbackSessionsDbTest.java index e1cef2751b1..84fa2424637 100644 --- a/src/test/java/teammates/test/cases/storage/FeedbackSessionsDbTest.java +++ b/src/test/java/teammates/storage/api/FeedbackSessionsDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import static teammates.common.util.FieldValidator.SESSION_END_TIME_FIELD_NAME; import static teammates.common.util.FieldValidator.SESSION_START_TIME_FIELD_NAME; @@ -24,10 +24,10 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.storage.api.FeedbackSessionsDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; -import teammates.test.driver.TimeHelperExtension; +import teammates.common.util.ThreadHelper; +import teammates.common.util.TimeHelperExtension; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link FeedbackSessionsDb}. @@ -164,6 +164,9 @@ public void testCreateDeleteFeedbackSession() ______TS("invalid params"); + // wait for very briefly so that the start timestamp is guaranteed to change + ThreadHelper.waitFor(5); + fsa.setStartTime(Instant.now()); InvalidParametersException ipe = assertThrows(InvalidParametersException.class, () -> fsDb.createEntity(fsa)); AssertHelper.assertContains("start time", ipe.getLocalizedMessage()); diff --git a/src/test/java/teammates/test/cases/storage/InstructorsDbTest.java b/src/test/java/teammates/storage/api/InstructorsDbTest.java similarity index 96% rename from src/test/java/teammates/test/cases/storage/InstructorsDbTest.java rename to src/test/java/teammates/storage/api/InstructorsDbTest.java index 4008872fe98..5bcee63baa7 100644 --- a/src/test/java/teammates/test/cases/storage/InstructorsDbTest.java +++ b/src/test/java/teammates/storage/api/InstructorsDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import java.util.ArrayList; import java.util.List; @@ -17,11 +17,8 @@ import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; import teammates.common.util.StringHelper; -import teammates.logic.core.InstructorsLogic; -import teammates.storage.api.EntitiesDb; -import teammates.storage.api.InstructorsDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link InstructorsDb}. @@ -39,6 +36,15 @@ public void addInstructorsToDb() throws Exception { } } + private void setArchiveStatusOfInstructor(String googleId, String courseId, boolean archiveStatus) + throws InvalidParametersException, EntityDoesNotExistException { + instructorsDb.updateInstructorByGoogleId( + InstructorAttributes.updateOptionsWithGoogleIdBuilder(courseId, googleId) + .withIsArchived(archiveStatus) + .build() + ); + } + @Test public void testCreateInstructor() throws Exception { @@ -152,7 +158,7 @@ public void testGetInstructorForGoogleId() { public void testGetInstructorForRegistrationKey() { InstructorAttributes i = dataBundle.instructors.get("instructorNotYetJoinCourse"); - i = logic.getInstructorById(i.getCourseId(), i.getEmail()); + i = instructorsDb.getInstructorById(i.getCourseId(), i.getEmail()); ______TS("Success: get an instructor"); @@ -195,10 +201,10 @@ public void testGetInstructorsForGoogleId() throws Exception { ______TS("Success: get instructors with specific googleId, with 1 archived course."); - InstructorsLogic.inst().setArchiveStatusOfInstructor(googleId, instructor1.courseId, true); + setArchiveStatusOfInstructor(googleId, instructor1.courseId, true); retrieved = instructorsDb.getInstructorsForGoogleId(googleId, true); assertEquals(1, retrieved.size()); - InstructorsLogic.inst().setArchiveStatusOfInstructor(googleId, instructor1.courseId, false); + setArchiveStatusOfInstructor(googleId, instructor1.courseId, false); ______TS("Failure: instructor does not exist"); @@ -317,11 +323,11 @@ public void testUpdateInstructorByGoogleId() throws Exception { assertFalse(updatedInstructor.isDisplayedToStudents); assertEquals("New Displayed Name", actualInstructor.displayedName); assertEquals("New Displayed Name", updatedInstructor.displayedName); - assertTrue(actualInstructor.hasObserverPrivileges()); - assertTrue(updatedInstructor.hasObserverPrivileges()); + assertTrue(actualInstructor.getPrivileges().hasObserverPrivileges()); + assertTrue(updatedInstructor.getPrivileges().hasObserverPrivileges()); // Verifying less privileged 'Observer' role did not return false positive in case old 'Manager' role is unchanged. - assertFalse(actualInstructor.hasManagerPrivileges()); - assertFalse(updatedInstructor.hasManagerPrivileges()); + assertFalse(actualInstructor.getPrivileges().hasManagerPrivileges()); + assertFalse(updatedInstructor.getPrivileges().hasManagerPrivileges()); ______TS("Failure: invalid parameters"); @@ -652,8 +658,8 @@ public void testUpdateInstructorByEmail() throws Exception { assertFalse(updatedInstructor.isDisplayedToStudents); assertEquals("New Displayed Name", actualInstructor.displayedName); assertEquals("New Displayed Name", updatedInstructor.displayedName); - assertTrue(actualInstructor.hasObserverPrivileges()); - assertTrue(updatedInstructor.hasObserverPrivileges()); + assertTrue(actualInstructor.getPrivileges().hasObserverPrivileges()); + assertTrue(updatedInstructor.getPrivileges().hasObserverPrivileges()); // Verifying less privileged 'Observer' role did not return false positive in case old 'CoOwner' role is unchanged. assertFalse(actualInstructor.hasCoownerPrivileges()); assertFalse(updatedInstructor.hasCoownerPrivileges()); diff --git a/src/test/java/teammates/test/cases/storage/ProfilesDbTest.java b/src/test/java/teammates/storage/api/ProfilesDbTest.java similarity index 99% rename from src/test/java/teammates/test/cases/storage/ProfilesDbTest.java rename to src/test/java/teammates/storage/api/ProfilesDbTest.java index c73093f3536..d16bda368dd 100644 --- a/src/test/java/teammates/test/cases/storage/ProfilesDbTest.java +++ b/src/test/java/teammates/storage/api/ProfilesDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import java.io.IOException; @@ -10,8 +10,7 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.FieldValidator; -import teammates.storage.api.ProfilesDb; -import teammates.test.cases.BaseComponentTestCase; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link ProfilesDb}. diff --git a/src/test/java/teammates/test/cases/storage/StudentsDbTest.java b/src/test/java/teammates/storage/api/StudentsDbTest.java similarity index 93% rename from src/test/java/teammates/test/cases/storage/StudentsDbTest.java rename to src/test/java/teammates/storage/api/StudentsDbTest.java index 5aefee9e8bd..19c988f9738 100644 --- a/src/test/java/teammates/test/cases/storage/StudentsDbTest.java +++ b/src/test/java/teammates/storage/api/StudentsDbTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.storage; +package teammates.storage.api; import static teammates.common.util.FieldValidator.COURSE_ID_ERROR_MESSAGE; import static teammates.common.util.FieldValidator.REASON_INCORRECT_FORMAT; @@ -14,9 +14,9 @@ import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; import teammates.common.util.StringHelper; -import teammates.storage.api.StudentsDb; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.AssertHelper; +import teammates.common.util.ThreadHelper; +import teammates.test.AssertHelper; +import teammates.test.BaseComponentTestCase; /** * SUT: {@link StudentsDb}. @@ -40,6 +40,9 @@ public void testTimestamp() throws Exception { ______TS("success : update lastUpdated"); + // wait for very briefly so that the update timestamp is guaranteed to change + ThreadHelper.waitFor(5); + s.name = "new-name"; studentsDb.updateStudent( StudentAttributes.updateOptionsBuilder(s.course, s.email) @@ -85,7 +88,7 @@ public void testCreateStudent() throws Exception { studentsDb.createEntity(s); verifyPresentInDatastore(s); StudentAttributes retrievedStudent = studentsDb.getStudentForGoogleId(s.course, s.googleId); - assertTrue(retrievedStudent.isEnrollInfoSameAs(s)); + assertTrue(isEnrollInfoSameAs(retrievedStudent, s)); assertNull(studentsDb.getStudentForGoogleId(s.course + "not existing", s.googleId)); assertNull(studentsDb.getStudentForGoogleId(s.course, s.googleId + "not existing")); assertNull(studentsDb.getStudentForGoogleId(s.course + "not existing", s.googleId + "not existing")); @@ -139,12 +142,12 @@ public void testGetStudent() throws Exception { assertNull(studentsDb.getStudentForGoogleId(s2.course, s2.googleId)); s2 = createNewStudent("one.new@gmail.com"); - assertTrue(studentsDb.getUnregisteredStudentsForCourse(s2.course).get(0).isEnrollInfoSameAs(s2)); + assertTrue(isEnrollInfoSameAs(studentsDb.getUnregisteredStudentsForCourse(s2.course).get(0), s2)); - assertTrue(s.isEnrollInfoSameAs(studentsDb.getStudentsForGoogleId(s.googleId).get(0))); - assertTrue(studentsDb.getStudentsForCourse(s.course).get(0).isEnrollInfoSameAs(s) - || studentsDb.getStudentsForCourse(s.course).get(0).isEnrollInfoSameAs(s2)); - assertTrue(studentsDb.getStudentsForTeam(s.team, s.course).get(0).isEnrollInfoSameAs(s)); + assertTrue(isEnrollInfoSameAs(s, studentsDb.getStudentsForGoogleId(s.googleId).get(0))); + assertTrue(isEnrollInfoSameAs(studentsDb.getStudentsForCourse(s.course).get(0), s) + || isEnrollInfoSameAs(studentsDb.getStudentsForCourse(s.course).get(0), s2)); + assertTrue(isEnrollInfoSameAs(studentsDb.getStudentsForTeam(s.team, s.course).get(0), s)); ______TS("null params case"); AssertionError ae = assertThrows(AssertionError.class, () -> studentsDb.getStudentForEmail(null, "valid@email.com")); @@ -255,7 +258,7 @@ public void testUpdateStudent() throws Exception { .build()); StudentAttributes actualStudent = studentsDb.getStudentForEmail(s.course, s.email); - assertTrue(actualStudent.isEnrollInfoSameAs(s)); + assertTrue(isEnrollInfoSameAs(actualStudent, s)); // the original student is deleted assertNull(studentsDb.getStudentForEmail(s.course, originalEmail)); assertEquals("new-email-2@email.com", updatedStudent.getEmail()); @@ -427,4 +430,14 @@ private StudentAttributes createNewStudent(String email) throws Exception { studentsDb.deleteStudent(s.getCourse(), s.getEmail()); return studentsDb.createEntity(s); } + + private boolean isEnrollInfoSameAs(StudentAttributes student, StudentAttributes otherStudent) { + return otherStudent != null && otherStudent.email.equals(student.email) + && otherStudent.course.equals(student.course) + && otherStudent.name.equals(student.name) + && otherStudent.comments.equals(student.comments) + && otherStudent.team.equals(student.team) + && otherStudent.section.equals(student.section); + } + } diff --git a/src/test/java/teammates/storage/api/package-info.java b/src/test/java/teammates/storage/api/package-info.java new file mode 100644 index 00000000000..609e1c86941 --- /dev/null +++ b/src/test/java/teammates/storage/api/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.storage.api} package. + */ +package teammates.storage.api; diff --git a/src/test/java/teammates/test/cases/search/BaseSearchTest.java b/src/test/java/teammates/storage/search/BaseSearchTest.java similarity index 85% rename from src/test/java/teammates/test/cases/search/BaseSearchTest.java rename to src/test/java/teammates/storage/search/BaseSearchTest.java index 39f9350b686..8d85140fa48 100644 --- a/src/test/java/teammates/test/cases/search/BaseSearchTest.java +++ b/src/test/java/teammates/storage/search/BaseSearchTest.java @@ -1,9 +1,9 @@ -package teammates.test.cases.search; +package teammates.storage.search; import org.testng.annotations.BeforeMethod; import teammates.common.datatransfer.DataBundle; -import teammates.test.cases.BaseComponentTestCase; +import teammates.test.BaseComponentTestCase; /** * Base class for all search tests. diff --git a/src/test/java/teammates/test/cases/search/FeedbackResponseCommentSearchTest.java b/src/test/java/teammates/storage/search/FeedbackResponseCommentSearchTest.java similarity index 87% rename from src/test/java/teammates/test/cases/search/FeedbackResponseCommentSearchTest.java rename to src/test/java/teammates/storage/search/FeedbackResponseCommentSearchTest.java index faa46adf112..0fc762ba1e6 100644 --- a/src/test/java/teammates/test/cases/search/FeedbackResponseCommentSearchTest.java +++ b/src/test/java/teammates/storage/search/FeedbackResponseCommentSearchTest.java @@ -1,10 +1,9 @@ -package teammates.test.cases.search; +package teammates.storage.search; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import teammates.common.datatransfer.AttributesDeletionQuery; @@ -17,8 +16,10 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.retry.RetryableTask; -import teammates.logic.core.FeedbackSessionsLogic; +import teammates.storage.api.FeedbackQuestionsDb; import teammates.storage.api.FeedbackResponseCommentsDb; +import teammates.storage.api.FeedbackResponsesDb; +import teammates.storage.api.FeedbackSessionsDb; /** * SUT: {@link FeedbackResponseCommentsDb}, @@ -27,14 +28,10 @@ */ public class FeedbackResponseCommentSearchTest extends BaseSearchTest { - private FeedbackSessionsLogic feedbackSessionsLogic; - private FeedbackResponseCommentsDb commentsDb; - - @BeforeClass - public void classSetup() { - feedbackSessionsLogic = FeedbackSessionsLogic.inst(); - commentsDb = new FeedbackResponseCommentsDb(); - } + private FeedbackQuestionsDb fqDb = new FeedbackQuestionsDb(); + private FeedbackResponsesDb frDb = new FeedbackResponsesDb(); + private FeedbackResponseCommentsDb commentsDb = new FeedbackResponseCommentsDb(); + private FeedbackSessionsDb fsDb = new FeedbackSessionsDb(); @Test public void allTests() throws Exception { @@ -124,9 +121,9 @@ public void testSearchComment_feedbackSessionDeleted_commentShouldNotBeSearchabl verifySearchResults(bundle, frc1I3Q1S2C2); // session soft-deleted - feedbackSessionsLogic.moveFeedbackSessionToRecycleBin(frc1I3Q1S2C2.feedbackSessionName, frc1I3Q1S2C2.courseId); - assertNotNull(feedbackSessionsLogic - .getFeedbackSessionFromRecycleBin(frc1I3Q1S2C2.feedbackSessionName, frc1I3Q1S2C2.courseId)); + fsDb.softDeleteFeedbackSession(frc1I3Q1S2C2.feedbackSessionName, frc1I3Q1S2C2.courseId); + assertNotNull(fsDb + .getSoftDeletedFeedbackSession(frc1I3Q1S2C2.courseId, frc1I3Q1S2C2.feedbackSessionName)); bundle = commentsDb.search("\"Instructor 3 comment to instr1C2 response to student1C2\"", instructors); assertEquals(0, bundle.comments.size()); assertEquals(0, bundle.responses.size()); @@ -134,9 +131,9 @@ public void testSearchComment_feedbackSessionDeleted_commentShouldNotBeSearchabl assertEquals(0, bundle.sessions.size()); // session deleted completely - feedbackSessionsLogic.deleteFeedbackSessionCascade(frc1I3Q1S2C2.feedbackSessionName, frc1I3Q1S2C2.courseId); - assertNull(feedbackSessionsLogic - .getFeedbackSessionFromRecycleBin(frc1I3Q1S2C2.feedbackSessionName, frc1I3Q1S2C2.courseId)); + fsDb.deleteFeedbackSession(frc1I3Q1S2C2.feedbackSessionName, frc1I3Q1S2C2.courseId); + assertNull(fsDb + .getSoftDeletedFeedbackSession(frc1I3Q1S2C2.courseId, frc1I3Q1S2C2.feedbackSessionName)); bundle = commentsDb.search("\"Instructor 3 comment to instr1C2 response to student1C2\"", instructors); assertEquals(0, bundle.comments.size()); assertEquals(0, bundle.responses.size()); @@ -146,25 +143,23 @@ public void testSearchComment_feedbackSessionDeleted_commentShouldNotBeSearchabl @Test public void testSearchComment_createNewComment_commentShouldBeSearchable() throws Exception { - - FeedbackResponseCommentsDb feedbackResponseCommentsDb = new FeedbackResponseCommentsDb(); InstructorAttributes instructor3OfCourse1 = dataBundle.instructors.get("instructor3OfCourse1"); FeedbackResponseAttributes response1ForQ1S1C1 = dataBundle.feedbackResponses.get("response1ForQ1S1C1"); // get response1ForQ1S1C1 from the datastore FeedbackQuestionAttributes correspondingQuestion = - logic.getFeedbackQuestion(response1ForQ1S1C1.getFeedbackSessionName(), + fqDb.getFeedbackQuestion(response1ForQ1S1C1.getFeedbackSessionName(), response1ForQ1S1C1.getCourseId(), Integer.parseInt(response1ForQ1S1C1.getFeedbackQuestionId())); - response1ForQ1S1C1 = logic.getFeedbackResponse(correspondingQuestion.getId(), + response1ForQ1S1C1 = frDb.getFeedbackResponse(correspondingQuestion.getId(), response1ForQ1S1C1.getGiver(), response1ForQ1S1C1.getRecipient()); assertNotNull(response1ForQ1S1C1); FeedbackResponseCommentSearchResultBundle bundle = - feedbackResponseCommentsDb.search("commentABCDE", Arrays.asList(instructor3OfCourse1)); + commentsDb.search("commentABCDE", Arrays.asList(instructor3OfCourse1)); assertEquals(0, bundle.numberOfResults); // create a new comment - feedbackResponseCommentsDb.createEntity( + commentsDb.createEntity( FeedbackResponseCommentAttributes.builder() .withCourseId(response1ForQ1S1C1.getCourseId()) .withFeedbackSessionName(response1ForQ1S1C1.getFeedbackSessionName()) @@ -182,7 +177,7 @@ public void testSearchComment_createNewComment_commentShouldBeSearchable() throw .build()); // the newly created comment is searchable - bundle = feedbackResponseCommentsDb.search("commentABCDE", Arrays.asList(instructor3OfCourse1)); + bundle = commentsDb.search("commentABCDE", Arrays.asList(instructor3OfCourse1)); assertEquals(1, bundle.numberOfResults); assertEquals("commentABCDE", bundle.comments.get(response1ForQ1S1C1.getId()).get(0).getCommentText()); diff --git a/src/test/java/teammates/test/cases/search/InstructorSearchTest.java b/src/test/java/teammates/storage/search/InstructorSearchTest.java similarity index 97% rename from src/test/java/teammates/test/cases/search/InstructorSearchTest.java rename to src/test/java/teammates/storage/search/InstructorSearchTest.java index 4b30bc16cf4..0b33a3dbb0c 100644 --- a/src/test/java/teammates/test/cases/search/InstructorSearchTest.java +++ b/src/test/java/teammates/storage/search/InstructorSearchTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.search; +package teammates.storage.search; import java.util.Arrays; @@ -10,7 +10,7 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; import teammates.storage.api.InstructorsDb; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; /** * SUT: {@link InstructorsDb}, @@ -18,10 +18,11 @@ * {@link teammates.storage.search.InstructorSearchQuery}. */ public class InstructorSearchTest extends BaseSearchTest { + + private InstructorsDb instructorsDb = new InstructorsDb(); + @Test public void allTests() throws Exception { - InstructorsDb instructorsDb = new InstructorsDb(); - InstructorAttributes ins1InCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); InstructorAttributes ins2InCourse1 = dataBundle.instructors.get("instructor2OfCourse1"); InstructorAttributes helperInCourse1 = dataBundle.instructors.get("helperOfCourse1"); @@ -135,8 +136,6 @@ public void allTests() throws Exception { @Test public void testSearchInstructor_createNewInstructor_instructorShouldBeSearchable() throws Exception { - - InstructorsDb instructorsDb = new InstructorsDb(); CourseAttributes courseAttributes = dataBundle.courses.get("typicalCourse1"); InstructorSearchResultBundle bundle = @@ -160,8 +159,6 @@ public void testSearchInstructor_createNewInstructor_instructorShouldBeSearchabl @Test public void testSearchInstructor_deleteAfterSearch_shouldNotBeSearchable() { - InstructorsDb instructorsDb = new InstructorsDb(); - InstructorAttributes ins1InCourse2 = dataBundle.instructors.get("instructor1OfCourse2"); InstructorAttributes ins2InCourse2 = dataBundle.instructors.get("instructor2OfCourse2"); InstructorAttributes ins3InCourse2 = dataBundle.instructors.get("instructor3OfCourse2"); diff --git a/src/test/java/teammates/test/cases/search/StudentSearchTest.java b/src/test/java/teammates/storage/search/StudentSearchTest.java similarity index 96% rename from src/test/java/teammates/test/cases/search/StudentSearchTest.java rename to src/test/java/teammates/storage/search/StudentSearchTest.java index f5a474dfd0d..64e04819e74 100644 --- a/src/test/java/teammates/test/cases/search/StudentSearchTest.java +++ b/src/test/java/teammates/storage/search/StudentSearchTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.search; +package teammates.storage.search; import java.util.Arrays; import java.util.List; @@ -11,7 +11,7 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.storage.api.StudentsDb; -import teammates.test.driver.AssertHelper; +import teammates.test.AssertHelper; /** * SUT: {@link StudentsDb}, @@ -20,11 +20,10 @@ */ public class StudentSearchTest extends BaseSearchTest { + private StudentsDb studentsDb = new StudentsDb(); + @Test public void allTests() { - - StudentsDb studentsDb = new StudentsDb(); - StudentAttributes stu1InCourse1 = dataBundle.students.get("student1InCourse1"); StudentAttributes stu2InCourse1 = dataBundle.students.get("student2InCourse1"); StudentAttributes stu1InCourse2 = dataBundle.students.get("student1InCourse2"); @@ -91,8 +90,6 @@ public void allTests() { @Test public void testSearchStudent_createNewStudent_studentShouldBeSearchable() throws Exception { - - StudentsDb studentsDb = new StudentsDb(); CourseAttributes courseAttributes = dataBundle.courses.get("typicalCourse1"); StudentSearchResultBundle bundle = @@ -117,8 +114,6 @@ public void testSearchStudent_createNewStudent_studentShouldBeSearchable() throw @Test public void testSearchStudent_deleteAfterSearch_shouldNotBeSearchable() { - StudentsDb studentsDb = new StudentsDb(); - StudentAttributes stu1InCourse1 = dataBundle.students.get("student1InCourse1"); StudentAttributes stu1InCourse2 = dataBundle.students.get("student1InCourse2"); StudentAttributes stu1InCourse3 = dataBundle.students.get("student1InCourse3"); diff --git a/src/test/java/teammates/storage/search/package-info.java b/src/test/java/teammates/storage/search/package-info.java new file mode 100644 index 00000000000..299bd801a61 --- /dev/null +++ b/src/test/java/teammates/storage/search/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.storage.search} package. + */ +package teammates.storage.search; diff --git a/src/test/java/teammates/test/driver/AssertHelper.java b/src/test/java/teammates/test/AssertHelper.java similarity index 52% rename from src/test/java/teammates/test/driver/AssertHelper.java rename to src/test/java/teammates/test/AssertHelper.java index c8779f4bd60..158bac61b8d 100644 --- a/src/test/java/teammates/test/driver/AssertHelper.java +++ b/src/test/java/teammates/test/AssertHelper.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -7,10 +7,11 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.regex.Pattern; import com.google.common.base.Joiner; +import teammates.common.util.TimeHelperExtension; + /** * Provides additional assertion methods that are often used during testing. */ @@ -57,58 +58,6 @@ public static void assertContains(String substringExpected, } } - /** - * Asserts that the superstringActual contains the exact occurence of - * substringExpected. Display the difference between the two on failure - * with the specified message. - */ - public static void assertContains(String message, String substringExpected, - String superstringActual) { - if (!superstringActual.contains(substringExpected)) { - assertEquals(message, substringExpected, superstringActual); - } - } - - /** - * Asserts that the stringActual contains the occurence regexExpected. - * Replaces occurences of {*} at regexExpected to match anything in - * stringActual. Tries to display the difference between the two on failure. - * Ignores the tab character (i.e., ignore indentation using - * tabs) and ignores the newline when comparing. - */ - public static void assertContainsRegex(String regexExpected, - String stringActual) { - if (!isContainsRegex(regexExpected, stringActual)) { - assertEquals(regexExpected, stringActual); - } - } - - /** - * Asserts that the stringActual contains the occurence regexExpected. - * Replaces occurences of {*} at regexExpected to match anything in - * stringActual. Tries to display the difference between the two on failure - * with the specified message. - */ - public static void assertContainsRegex(String message, - String regexExpected, String stringActual) { - if (!isContainsRegex(regexExpected, stringActual)) { - assertEquals(message, regexExpected, stringActual); - } - } - - /** - * Checks that the stringActual contains the occurrence regexExpected.
    - * Occurrences of {*} at regexExpected can match anything (as defined by the regex .*) - * in stringActual. - */ - public static boolean isContainsRegex(String regexExpected, String stringActual) { - String processedActual = stringActual.replaceAll("[\t\r\n]", ""); - String processedRegex = Pattern.quote(regexExpected) - .replaceAll(Pattern.quote("{*}"), "\\\\E.*?\\\\Q") - .replaceAll("[\t\r\n]", ""); - return processedActual.matches("(?s)(?m).*?" + processedRegex + ".*?"); - } - /** * Asserts that the two given lists have the same contents, ignoring their order. */ diff --git a/src/test/java/teammates/test/AssertHelperTest.java b/src/test/java/teammates/test/AssertHelperTest.java new file mode 100644 index 00000000000..ca534fc5d58 --- /dev/null +++ b/src/test/java/teammates/test/AssertHelperTest.java @@ -0,0 +1,17 @@ +package teammates.test; + +import org.testng.annotations.Test; + +/** + * SUT: {@link AssertHelper}. + */ +public class AssertHelperTest extends BaseTestCase { + + @Test + public void testAssertContains() { + + AssertHelper.assertContains("404 Page Not Found", + "Error: 404 Page Not Found. Check the URL."); + } + +} diff --git a/src/test/java/teammates/test/cases/BaseComponentTestCase.java b/src/test/java/teammates/test/BaseComponentTestCase.java similarity index 95% rename from src/test/java/teammates/test/cases/BaseComponentTestCase.java rename to src/test/java/teammates/test/BaseComponentTestCase.java index e94d3be5c0b..d1112c2e47e 100644 --- a/src/test/java/teammates/test/cases/BaseComponentTestCase.java +++ b/src/test/java/teammates/test/BaseComponentTestCase.java @@ -1,4 +1,4 @@ -package teammates.test.cases; +package teammates.test; import java.io.IOException; import java.net.URLConnection; @@ -23,20 +23,17 @@ import teammates.common.util.Const; import teammates.common.util.GoogleCloudStorageHelper; import teammates.common.util.retry.RetryManager; -import teammates.logic.api.Logic; -import teammates.test.driver.FileHelper; -import teammates.test.driver.GaeSimulation; -import teammates.test.driver.TestProperties; +import teammates.logic.api.LogicExtension; /** * Base class for all component tests. - * It runs a simulated Datastore ({@link GaeSimulation}) which can be accessed via {@link Logic}. + * It runs a simulated Datastore ({@link GaeSimulation}) which can be accessed via {@link LogicExtension}. */ @Test(singleThreaded = true) // GaeSimulation is not thread safe public class BaseComponentTestCase extends BaseTestCaseWithDatastoreAccess { protected static final GaeSimulation gaeSimulation = GaeSimulation.inst(); - protected static final Logic logic = new Logic(); + protected static final LogicExtension logic = new LogicExtension(); @Override @BeforeClass diff --git a/src/test/java/teammates/test/cases/BaseTestCase.java b/src/test/java/teammates/test/BaseTestCase.java similarity index 94% rename from src/test/java/teammates/test/cases/BaseTestCase.java rename to src/test/java/teammates/test/BaseTestCase.java index a26323ce2a5..4ed4fc039df 100644 --- a/src/test/java/teammates/test/cases/BaseTestCase.java +++ b/src/test/java/teammates/test/BaseTestCase.java @@ -1,4 +1,4 @@ -package teammates.test.cases; +package teammates.test; import java.io.IOException; import java.lang.reflect.Method; @@ -10,19 +10,12 @@ import teammates.common.datatransfer.DataBundle; import teammates.common.util.FieldValidator; import teammates.common.util.JsonUtils; -import teammates.test.driver.FileHelper; -import teammates.test.driver.TestProperties; /** * Base class for all test cases. */ public class BaseTestCase { - /** - * Dummy session token for use in tests that depend on, but don't use, it (e.g. page data tests). - */ - protected static final String dummySessionToken = null; - /** * Test Segment divider. Used to divide a test case into logical sections. * The weird name is for easy spotting. @@ -73,10 +66,6 @@ protected DataBundle loadDataBundle(String jsonFileName) { } } - protected static void ignorePossibleException() { - assertTrue(true); - } - /** * Invokes the method named {@code methodName} as defined in the {@code definingClass}. * @param definingClass the class which defines the method @@ -184,10 +173,6 @@ protected static void fail(String message) { Assert.fail(message); } - protected static void assertArrayEquals(Object[] expecteds, Object[] actuals) { - Assert.assertArrayEquals(expecteds, actuals); - } - // This method is adapted from JUnit 5's assertThrows. // Once we upgrade to JUnit 5, their built-in method shall be used instead. @SuppressWarnings({ diff --git a/src/test/java/teammates/test/cases/BaseTestCaseWithDatastoreAccess.java b/src/test/java/teammates/test/BaseTestCaseWithDatastoreAccess.java similarity index 98% rename from src/test/java/teammates/test/cases/BaseTestCaseWithDatastoreAccess.java rename to src/test/java/teammates/test/BaseTestCaseWithDatastoreAccess.java index 0694f9f3452..ad2c3098f7c 100644 --- a/src/test/java/teammates/test/cases/BaseTestCaseWithDatastoreAccess.java +++ b/src/test/java/teammates/test/BaseTestCaseWithDatastoreAccess.java @@ -1,4 +1,4 @@ -package teammates.test.cases; +package teammates.test; import teammates.common.datatransfer.DataBundle; import teammates.common.datatransfer.attributes.AccountAttributes; @@ -186,6 +186,9 @@ private void equalizeIrrelevantData(FeedbackResponseAttributes expected, Feedbac private void equalizeIrrelevantData(FeedbackSessionAttributes expected, FeedbackSessionAttributes actual) { expected.setRespondingInstructorList(actual.getRespondingInstructorList()); expected.setRespondingStudentList(actual.getRespondingStudentList()); + expected.setCreatedTime(actual.getCreatedTime()); + // Not available in FeedbackSessionData and thus ignored + expected.setCreatorEmail(actual.getCreatorEmail()); } private void equalizeIrrelevantData(InstructorAttributes expected, InstructorAttributes actual) { diff --git a/src/test/java/teammates/test/cases/BaseTestCaseWithMinimalGaeEnvironment.java b/src/test/java/teammates/test/BaseTestCaseWithMinimalGaeEnvironment.java similarity index 89% rename from src/test/java/teammates/test/cases/BaseTestCaseWithMinimalGaeEnvironment.java rename to src/test/java/teammates/test/BaseTestCaseWithMinimalGaeEnvironment.java index 31c70e18571..89426fc9391 100644 --- a/src/test/java/teammates/test/cases/BaseTestCaseWithMinimalGaeEnvironment.java +++ b/src/test/java/teammates/test/BaseTestCaseWithMinimalGaeEnvironment.java @@ -1,12 +1,10 @@ -package teammates.test.cases; +package teammates.test; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import com.google.appengine.tools.development.testing.LocalServiceTestHelper; -import teammates.test.driver.GaeSimulation; - /** * Base class for all test cases which require a minimal GAE API environment registered. */ diff --git a/src/test/java/teammates/test/cases/BaseTestCaseWithObjectifyAccess.java b/src/test/java/teammates/test/BaseTestCaseWithObjectifyAccess.java similarity index 96% rename from src/test/java/teammates/test/cases/BaseTestCaseWithObjectifyAccess.java rename to src/test/java/teammates/test/BaseTestCaseWithObjectifyAccess.java index d78cf66fe11..52256ea8178 100644 --- a/src/test/java/teammates/test/cases/BaseTestCaseWithObjectifyAccess.java +++ b/src/test/java/teammates/test/BaseTestCaseWithObjectifyAccess.java @@ -1,4 +1,4 @@ -package teammates.test.cases; +package teammates.test; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; diff --git a/src/test/java/teammates/test/driver/EmailChecker.java b/src/test/java/teammates/test/EmailChecker.java similarity index 99% rename from src/test/java/teammates/test/driver/EmailChecker.java rename to src/test/java/teammates/test/EmailChecker.java index 0a318d7f8a1..4a2b8064630 100644 --- a/src/test/java/teammates/test/driver/EmailChecker.java +++ b/src/test/java/teammates/test/EmailChecker.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import static org.junit.Assert.assertEquals; diff --git a/src/test/java/teammates/test/cases/testdriver/EmailCheckerTest.java b/src/test/java/teammates/test/EmailCheckerTest.java similarity index 84% rename from src/test/java/teammates/test/cases/testdriver/EmailCheckerTest.java rename to src/test/java/teammates/test/EmailCheckerTest.java index cf97c5c9b8c..2ef9237989a 100644 --- a/src/test/java/teammates/test/cases/testdriver/EmailCheckerTest.java +++ b/src/test/java/teammates/test/EmailCheckerTest.java @@ -1,13 +1,10 @@ -package teammates.test.cases.testdriver; +package teammates.test; import java.io.IOException; import org.testng.annotations.Test; import teammates.common.util.Config; -import teammates.test.driver.EmailChecker; -import teammates.test.driver.FileHelper; -import teammates.test.driver.TestProperties; /** * SUT: {@link EmailChecker}. diff --git a/src/test/java/teammates/test/driver/FileHelper.java b/src/test/java/teammates/test/FileHelper.java similarity index 97% rename from src/test/java/teammates/test/driver/FileHelper.java rename to src/test/java/teammates/test/FileHelper.java index f6044dc6e57..b3512832b76 100644 --- a/src/test/java/teammates/test/driver/FileHelper.java +++ b/src/test/java/teammates/test/FileHelper.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import java.io.BufferedWriter; import java.io.File; diff --git a/src/test/java/teammates/test/driver/GaeSimulation.java b/src/test/java/teammates/test/GaeSimulation.java similarity index 82% rename from src/test/java/teammates/test/driver/GaeSimulation.java rename to src/test/java/teammates/test/GaeSimulation.java index 9d787beda80..2907701e4a1 100644 --- a/src/test/java/teammates/test/driver/GaeSimulation.java +++ b/src/test/java/teammates/test/GaeSimulation.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import java.io.IOException; import java.net.MalformedURLException; @@ -21,21 +21,16 @@ import teammates.common.datatransfer.UserInfo; import teammates.common.exception.ActionMappingException; -import teammates.common.util.Const; import teammates.common.util.RecaptchaVerifier; import teammates.logic.api.GateKeeper; -import teammates.ui.automated.AutomatedAction; -import teammates.ui.automated.AutomatedActionFactory; -import teammates.ui.webapi.action.Action; -import teammates.ui.webapi.action.ActionFactory; +import teammates.ui.webapi.Action; +import teammates.ui.webapi.ActionFactory; /** * Provides a Singleton in-memory simulation of the GAE for unit testing. * *

    This is not the same as testing against the dev server. * When testing against the GAE simulation, there is no need for the dev server to be running. - * - *

    The GAE simulation does not support JSP and can only be used to test up to Servlets level. */ public class GaeSimulation { @@ -128,7 +123,7 @@ public void logoutUser() { public Action getActionObject(String uri, String method, String body, Map parts, List cookies, String... params) { try { - MockHttpServletRequest req = new MockHttpServletRequest(method, Const.ResourceURIs.URI_PREFIX + uri); + MockHttpServletRequest req = new MockHttpServletRequest(method, uri); for (int i = 0; i < params.length; i = i + 2) { req.addParam(params[i], params[i + 1]); } @@ -159,28 +154,6 @@ public Action getActionObject(String uri, String method, String body, Map> headers) { this.cookies = new ArrayList<>(); this.parts = new HashMap<>(); - this.headers = new HashMap<>(); + this.headers = headers; this.params = new HashMap<>(); this.method = method; this.requestUrl = requestUrl; } + public MockHttpServletRequest(String method, String requestUrl) { + this(method, requestUrl, new HashMap<>()); + } + @Override public String getAuthType() { return null; diff --git a/src/test/java/teammates/test/driver/MockHttpServletResponse.java b/src/test/java/teammates/test/MockHttpServletResponse.java similarity index 99% rename from src/test/java/teammates/test/driver/MockHttpServletResponse.java rename to src/test/java/teammates/test/MockHttpServletResponse.java index a64bc54d81f..de0d06ddacb 100644 --- a/src/test/java/teammates/test/driver/MockHttpServletResponse.java +++ b/src/test/java/teammates/test/MockHttpServletResponse.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import java.io.PrintWriter; import java.util.ArrayList; diff --git a/src/test/java/teammates/test/driver/MockPart.java b/src/test/java/teammates/test/MockPart.java similarity index 98% rename from src/test/java/teammates/test/driver/MockPart.java rename to src/test/java/teammates/test/MockPart.java index 1074e40baa6..904c1183459 100644 --- a/src/test/java/teammates/test/driver/MockPart.java +++ b/src/test/java/teammates/test/MockPart.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import java.io.File; import java.io.IOException; diff --git a/src/test/java/teammates/test/driver/MockTaskQueuer.java b/src/test/java/teammates/test/MockTaskQueuer.java similarity index 72% rename from src/test/java/teammates/test/driver/MockTaskQueuer.java rename to src/test/java/teammates/test/MockTaskQueuer.java index 451977973f6..62e34832d99 100644 --- a/src/test/java/teammates/test/driver/MockTaskQueuer.java +++ b/src/test/java/teammates/test/MockTaskQueuer.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import java.util.ArrayList; import java.util.HashMap; @@ -19,24 +19,16 @@ public class MockTaskQueuer extends TaskQueuer { private List tasksAdded = new ArrayList<>(); @Override - protected void addTask(String queueName, String workerUrl, Map paramMap) { - Map multisetParamMap = new HashMap<>(); - paramMap.forEach((key, value) -> multisetParamMap.put(key, new String[] { value })); - TaskWrapper task = new TaskWrapper(queueName, workerUrl, multisetParamMap); + protected void addTask(String queueName, String workerUrl, Map paramMap, Object requestBody) { + TaskWrapper task = new TaskWrapper(queueName, workerUrl, paramMap, requestBody); tasksAdded.add(task); } @Override - protected void addDeferredTask(String queueName, String workerUrl, Map paramMap, + protected void addDeferredTask(String queueName, String workerUrl, Map paramMap, Object requestBody, long countdownTime) { // countdown time not tested, thus fallback to another method - addTask(queueName, workerUrl, paramMap); - } - - @Override - protected void addTaskMultisetParam(String queueName, String workerUrl, Map paramMap) { - TaskWrapper task = new TaskWrapper(queueName, workerUrl, paramMap); - tasksAdded.add(task); + addTask(queueName, workerUrl, paramMap, requestBody); } @Override diff --git a/src/test/java/teammates/test/cases/testdriver/TestNgXmlTest.java b/src/test/java/teammates/test/TestNgXmlTest.java similarity index 92% rename from src/test/java/teammates/test/cases/testdriver/TestNgXmlTest.java rename to src/test/java/teammates/test/TestNgXmlTest.java index 4d9b077714b..47fc2962d85 100644 --- a/src/test/java/teammates/test/cases/testdriver/TestNgXmlTest.java +++ b/src/test/java/teammates/test/TestNgXmlTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.testdriver; +package teammates.test; import java.io.File; import java.io.IOException; @@ -7,9 +7,6 @@ import org.testng.annotations.Test; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.FileHelper; - /** * Verifies that the testng-component.xml configuration file contains all the component test cases in the project. */ @@ -20,7 +17,7 @@ public void checkTestsInTestNg() throws IOException { String testNgXml = FileHelper.readFile("./src/test/resources/testng-component.xml"); // - Map testFiles = getTestFiles(testNgXml, "./src/test/java/teammates/test/cases"); + Map testFiles = getTestFiles(testNgXml, "./src/test/java/teammates"); testFiles.forEach((key, value) -> assertTrue(isTestFileIncluded(testNgXml, value, key))); } @@ -36,7 +33,7 @@ private Map getTestFiles(String testNgXml, String rootPath) { // BaseComponentTestCase, BaseTestCase (files in current directory) excluded because // base classes are extended by the actual tests - return addFilesToTestsRecursively(rootPath, true, "teammates.test.cases", testNgXml); + return addFilesToTestsRecursively(rootPath, true, "teammates", testNgXml); } private boolean isTestFileIncluded(String testNgXml, String packageName, String testClassName) { @@ -74,8 +71,9 @@ private Map addFilesToTestsRecursively(String path, boolean areF && !areFilesInCurrentDirExcluded) { testFiles.put(name.replace(".java", ""), packageName); - } else if (file.isDirectory() && !name.endsWith("browsertests") && !name.endsWith("architecture")) { - // If the package name is in TestNG in the form of + } else if (file.isDirectory() && !name.endsWith("browsertests") && !name.endsWith("pageobjects") + && !name.endsWith("architecture")) { + // If the package name is in TestNG in the form of // then files in the current directory are excluded because the whole package would be tested by TestNG. testFiles.putAll( diff --git a/src/test/java/teammates/test/driver/TestProperties.java b/src/test/java/teammates/test/TestProperties.java similarity index 88% rename from src/test/java/teammates/test/driver/TestProperties.java rename to src/test/java/teammates/test/TestProperties.java index 8d69ed552c7..6376117e813 100644 --- a/src/test/java/teammates/test/driver/TestProperties.java +++ b/src/test/java/teammates/test/TestProperties.java @@ -1,4 +1,4 @@ -package teammates.test.driver; +package teammates.test; import java.io.IOException; import java.io.InputStream; @@ -14,9 +14,6 @@ public final class TestProperties { /** The directory where HTML files for testing email contents are stored. */ public static final String TEST_EMAILS_FOLDER = "src/test/resources/emails"; - /** The directory where CSV files for testing CSV contents are stored. */ - public static final String TEST_CSV_FOLDER = "src/test/resources/csv"; - /** The directory where JSON files used to create data bundles are stored. */ public static final String TEST_DATA_FOLDER = "src/test/resources/data"; diff --git a/src/test/java/teammates/test/cases/testdriver/TestPropertiestTest.java b/src/test/java/teammates/test/TestPropertiesTest.java similarity index 51% rename from src/test/java/teammates/test/cases/testdriver/TestPropertiestTest.java rename to src/test/java/teammates/test/TestPropertiesTest.java index 20f728446af..a17a30cd961 100644 --- a/src/test/java/teammates/test/cases/testdriver/TestPropertiestTest.java +++ b/src/test/java/teammates/test/TestPropertiesTest.java @@ -1,14 +1,11 @@ -package teammates.test.cases.testdriver; +package teammates.test; import org.testng.annotations.Test; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.TestProperties; - /** * SUT: {@link TestProperties}. */ -public class TestPropertiestTest extends BaseTestCase { +public class TestPropertiesTest extends BaseTestCase { @Test public void testUpdateSnapshotFlag() { diff --git a/src/test/java/teammates/test/cases/architecture/package-info.java b/src/test/java/teammates/test/cases/architecture/package-info.java deleted file mode 100644 index 0bf47effc95..00000000000 --- a/src/test/java/teammates/test/cases/architecture/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Test cases for checking the system's architecture. - */ -package teammates.test.cases.architecture; diff --git a/src/test/java/teammates/test/cases/automated/AutomatedServletTest.java b/src/test/java/teammates/test/cases/automated/AutomatedServletTest.java deleted file mode 100644 index 22242ed6618..00000000000 --- a/src/test/java/teammates/test/cases/automated/AutomatedServletTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package teammates.test.cases.automated; - -import org.apache.http.HttpStatus; -import org.apache.http.client.methods.HttpGet; -import org.testng.annotations.Test; - -import com.google.appengine.api.datastore.DatastoreTimeoutException; -import com.google.apphosting.api.DeadlineExceededException; - -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.util.Const; -import teammates.test.cases.BaseTestCaseWithObjectifyAccess; -import teammates.test.driver.MockHttpServletRequest; -import teammates.test.driver.MockHttpServletResponse; -import teammates.ui.automated.CronJobServlet; - -/** - * SUT: {@link teammates.ui.automated.AutomatedServlet}. - * - *

    Uses {@link CronJobServlet} as the concrete class to test. - */ -public class AutomatedServletTest extends BaseTestCaseWithObjectifyAccess { - - private static final CronJobServlet SERVLET = new CronJobServlet(); - - private MockHttpServletRequest mockRequest; - private MockHttpServletResponse mockResponse; - - private void setupMocks(String requestUrl) { - mockRequest = new MockHttpServletRequest(HttpGet.METHOD_NAME, requestUrl); - mockResponse = new MockHttpServletResponse(); - } - - @Test - public void allTests() { - - ______TS("Typical case: valid action mapping"); - - setupMocks(Const.CronJobURIs.AUTOMATED_FEEDBACK_OPENING_REMINDERS); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_OK, mockResponse.getStatus()); - - ______TS("\"Successful\" case: invalid action mapping"); - - setupMocks("/auto/mappingDoesNotExist"); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_OK, mockResponse.getStatus()); - - ______TS("\"Successful\" case: NullHttpParameterException"); - - setupMocks(Const.CronJobURIs.AUTOMATED_EXCEPTION_TEST); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_OK, mockResponse.getStatus()); - - ______TS("\"Successful\" case: InvalidHttpParameterException"); - - setupMocks(Const.CronJobURIs.AUTOMATED_EXCEPTION_TEST); - mockRequest.addParam(Const.ParamsNames.ERROR, InvalidHttpParameterException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_OK, mockResponse.getStatus()); - - ______TS("Failure case: DeadlineExceededException"); - - setupMocks(Const.CronJobURIs.AUTOMATED_EXCEPTION_TEST); - mockRequest.addParam(Const.ParamsNames.ERROR, DeadlineExceededException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); - - ______TS("Failure case: DatastoreTimeoutException"); - - setupMocks(Const.CronJobURIs.AUTOMATED_EXCEPTION_TEST); - mockRequest.addParam(Const.ParamsNames.ERROR, DatastoreTimeoutException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); - - ______TS("Failure case: NullPointerException"); - - setupMocks(Const.CronJobURIs.AUTOMATED_EXCEPTION_TEST); - mockRequest.addParam(Const.ParamsNames.ERROR, NullPointerException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); - - ______TS("Failure case: AssertionError"); - - setupMocks(Const.CronJobURIs.AUTOMATED_EXCEPTION_TEST); - mockRequest.addParam(Const.ParamsNames.ERROR, AssertionError.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); - - } - -} diff --git a/src/test/java/teammates/test/cases/automated/BaseAutomatedActionTest.java b/src/test/java/teammates/test/cases/automated/BaseAutomatedActionTest.java deleted file mode 100644 index dc6ca0ab97b..00000000000 --- a/src/test/java/teammates/test/cases/automated/BaseAutomatedActionTest.java +++ /dev/null @@ -1,66 +0,0 @@ -package teammates.test.cases.automated; - -import java.util.List; -import java.util.Map; - -import org.testng.annotations.BeforeClass; - -import teammates.common.datatransfer.DataBundle; -import teammates.common.util.EmailWrapper; -import teammates.test.cases.BaseComponentTestCase; -import teammates.ui.automated.AutomatedAction; - -/** - * Base class for all automated actions tests. - * - * @param The automated action class being tested. - */ -public abstract class BaseAutomatedActionTest extends BaseComponentTestCase { - - protected DataBundle dataBundle; - - protected abstract String getActionUri(); - - @SuppressWarnings("unchecked") - protected T getAction(String... params) { - return (T) gaeSimulation.getAutomatedActionObject(getActionUri(), params); - } - - @BeforeClass - public void baseClassSetup() { - prepareTestData(); - loginAsAdmin(); - } - - protected void prepareTestData() { - dataBundle = getTypicalDataBundle(); - removeAndRestoreTypicalDataBundle(); - } - - protected void loginAsAdmin() { - gaeSimulation.loginAsAdmin("admin.user"); - } - - protected void verifyNoTasksAdded(AutomatedAction action) { - Map tasksAdded = action.getTaskQueuer().getNumberOfTasksAdded(); - assertEquals(0, tasksAdded.keySet().size()); - } - - protected void verifySpecifiedTasksAdded(AutomatedAction action, String taskName, int taskCount) { - Map tasksAdded = action.getTaskQueuer().getNumberOfTasksAdded(); - assertEquals(taskCount, tasksAdded.get(taskName).intValue()); - } - - protected void verifyNoEmailsSent(AutomatedAction action) { - assertTrue(getEmailsSent(action).isEmpty()); - } - - protected List getEmailsSent(AutomatedAction action) { - return action.getEmailSender().getEmailsSent(); - } - - protected void verifyNumberOfEmailsSent(AutomatedAction action, int emailCount) { - assertEquals(emailCount, action.getEmailSender().getEmailsSent().size()); - } - -} diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionRemindParticularUsersEmailWorkerActionTest.java b/src/test/java/teammates/test/cases/automated/FeedbackSessionRemindParticularUsersEmailWorkerActionTest.java deleted file mode 100644 index 541901b553d..00000000000 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionRemindParticularUsersEmailWorkerActionTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package teammates.test.cases.automated; - -import java.util.List; -import java.util.Map; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.Const; -import teammates.common.util.Const.ParamsNames; -import teammates.common.util.EmailType; -import teammates.common.util.TaskWrapper; -import teammates.logic.core.CoursesLogic; -import teammates.ui.automated.FeedbackSessionRemindParticularUsersEmailWorkerAction; - -/** - * SUT: {@link FeedbackSessionRemindParticularUsersEmailWorkerAction}. - */ -public class FeedbackSessionRemindParticularUsersEmailWorkerActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - - @Override - protected String getActionUri() { - return Const.TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_WORKER_URL; - } - - @Test - public void allTests() { - - ______TS("Send feedback session reminder email"); - - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); - StudentAttributes student1 = dataBundle.students.get("student1InCourse1"); - InstructorAttributes instructor1 = dataBundle.instructors.get("instructor1OfCourse1"); - - String[] submissionParams = new String[] { - ParamsNames.SUBMISSION_FEEDBACK, session1.getFeedbackSessionName(), - ParamsNames.SUBMISSION_COURSE, session1.getCourseId(), - ParamsNames.SUBMISSION_REMIND_USERLIST, student1.email, - ParamsNames.SUBMISSION_REMIND_USERLIST, instructor1.email, - ParamsNames.USER_ID, instructor1.googleId, - ParamsNames.SUBMISSION_REMIND_USERLIST, "non-existent", - }; - - FeedbackSessionRemindParticularUsersEmailWorkerAction action = getAction(submissionParams); - action.execute(); - - // send 3 emails as specified in the submission parameters - verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 3); - - String courseName = coursesLogic.getCourse(session1.getCourseId()).getName(); - List tasksAdded = action.getTaskQueuer().getTasksAdded(); - for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); - assertEquals(String.format(EmailType.FEEDBACK_SESSION_REMINDER.getSubject(), courseName, - session1.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); - String recipient = paramMap.get(ParamsNames.EMAIL_RECEIVER)[0]; - assertTrue(recipient.equals(student1.email) || recipient.equals(instructor1.email)); - } - } - -} diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionResendPublishedEmailWorkerActionTest.java b/src/test/java/teammates/test/cases/automated/FeedbackSessionResendPublishedEmailWorkerActionTest.java deleted file mode 100644 index f5459047e2d..00000000000 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionResendPublishedEmailWorkerActionTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package teammates.test.cases.automated; - -import java.util.List; -import java.util.Map; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.Const; -import teammates.common.util.Const.ParamsNames; -import teammates.common.util.EmailType; -import teammates.common.util.TaskWrapper; -import teammates.logic.core.CoursesLogic; -import teammates.ui.automated.FeedbackSessionResendPublishedEmailWorkerAction; - -/** - * SUT: {@link FeedbackSessionResendPublishedEmailWorkerAction}. - */ -public class FeedbackSessionResendPublishedEmailWorkerActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - - @Override - protected String getActionUri() { - return Const.TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL; - } - - @Test - public void allTests() { - - ______TS("Resend feedback session results published email"); - - FeedbackSessionAttributes publishedSession = dataBundle.feedbackSessions.get("closedSession"); - StudentAttributes student1 = dataBundle.students.get("student1InCourse1"); - InstructorAttributes instructor1 = dataBundle.instructors.get("instructor1OfCourse1"); - - String[] submissionParams = new String[] { - ParamsNames.SUBMISSION_FEEDBACK, publishedSession.getFeedbackSessionName(), - ParamsNames.SUBMISSION_COURSE, publishedSession.getCourseId(), - ParamsNames.SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST, student1.email, - ParamsNames.SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST, instructor1.email, - ParamsNames.SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST, "non-existent", - }; - - FeedbackSessionResendPublishedEmailWorkerAction action = getAction(submissionParams); - action.execute(); - - // send 2 emails as specified in the submission parameters - verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 2); - - String courseName = coursesLogic.getCourse(publishedSession.getCourseId()).getName(); - List tasksAdded = action.getTaskQueuer().getTasksAdded(); - for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); - assertEquals(String.format(EmailType.FEEDBACK_PUBLISHED.getSubject(), courseName, - publishedSession.getFeedbackSessionName()), paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); - String recipient = paramMap.get(ParamsNames.EMAIL_RECEIVER)[0]; - assertTrue(recipient.equals(student1.email) || recipient.equals(instructor1.email)); - } - } - -} diff --git a/src/test/java/teammates/test/cases/automated/package-info.java b/src/test/java/teammates/test/cases/automated/package-info.java deleted file mode 100644 index fc1d7e802a6..00000000000 --- a/src/test/java/teammates/test/cases/automated/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * System test cases for testing the system-automated actions (manually invoked during testing). - */ -package teammates.test.cases.automated; diff --git a/src/test/java/teammates/test/cases/browsertests/AdminAccountDetailsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/AdminAccountDetailsPageUiTest.java deleted file mode 100644 index 927ae799774..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/AdminAccountDetailsPageUiTest.java +++ /dev/null @@ -1,65 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.Test; - -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.AdminAccountDetailsPage; - -/** - * SUT: {@link Const.WebPageURIs#ADMIN_ACCOUNTS_PAGE}. - */ -@Priority(1) -public class AdminAccountDetailsPageUiTest extends BaseE2ETestCase { - private AdminAccountDetailsPage detailsPage; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/AdminAccountDetailsPageUiTest.json"); - removeAndRestoreDataBundle(testData); - } - - @Test - public void testAll() throws Exception { - testContent(); - //no links or input validation to check - testRemoveFromCourseAction(); - } - - private void testContent() throws Exception { - - ______TS("content: typical page"); - - AppUrl detailsPageUrl = createUrl(Const.WebPageURIs.ADMIN_ACCOUNTS_PAGE) - .withInstructorId("AAMgtUiT.instr2") - .withUserId(TestProperties.TEST_ADMIN_ACCOUNT); - detailsPage = loginAdminToPageOld(detailsPageUrl, AdminAccountDetailsPage.class); - - detailsPage.verifyHtml("/adminAccountDetails.html"); - } - - private void testRemoveFromCourseAction() throws Exception { - - ______TS("action: remove instructor from course"); - - String googleId = "AAMgtUiT.instr2"; - String courseId = "AAMgtUiT.CS2104"; - - detailsPage.clickRemoveInstructorFromCourse(courseId) - .waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.INSTRUCTOR_REMOVED_FROM_COURSE); - assertNull(BackDoor.getInstructorByGoogleId(googleId, courseId)); - - ______TS("action: remove student from course"); - - courseId = "AAMgtUiT.CS1101"; - detailsPage.clickRemoveStudentFromCourse(courseId) - .waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.STUDENT_DELETED); - assertNull(BackDoor.getStudent(courseId, "AAMgtUiT.instr2@gmail.com")); - detailsPage.verifyHtmlMainContent("/adminAccountDetailsRemoveStudent.html"); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/AdminSessionsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/AdminSessionsPageUiTest.java deleted file mode 100644 index ebfc226b667..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/AdminSessionsPageUiTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.openqa.selenium.By; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.pageobjects.AdminSessionsPage; - -/** - * SUT: {@link Const.WebPageURIs#ADMIN_SESSIONS_PAGE}. - */ -public class AdminSessionsPageUiTest extends BaseE2ETestCase { - private AdminSessionsPage sessionsPage; - - @Override - protected void prepareTestData() { - // no test data used in this test - } - - @BeforeClass - public void classSetup() { - browser.driver.manage().deleteAllCookies(); - } - - @Test - public void testAll() { - testContent(); - } - - private void testContent() { - - ______TS("content: typical page"); - - AppUrl sessionsUrl = createUrl(Const.WebPageURIs.ADMIN_SESSIONS_PAGE); - sessionsPage = loginAdminToPageOld(sessionsUrl, AdminSessionsPage.class); - By timeFramePanel = By.id("timeFramePanel"); - sessionsPage.waitForElementToDisappear(timeFramePanel); - assertTrue(isSessionDataDisplayCorrect()); - - ______TS("content: show filter"); - - sessionsPage.clickDetailButton(); - sessionsPage.waitForElementVisibility(browser.driver.findElement(timeFramePanel)); - assertTrue(isSessionDataDisplayCorrect()); - - ______TS("content: hide filter"); - - sessionsPage.clickDetailButton(); - sessionsPage.waitForElementToDisappear(timeFramePanel); - assertTrue(isSessionDataDisplayCorrect()); - - } - - /** - * This method only checks if the session data tables are displayed correctly - * i.e, table headers are correct, and appropriate message is displayed if no - * session data is present. - * It does not test for the table content - */ - private boolean isSessionDataDisplayCorrect() { - if (sessionsPage.isElementPresent(By.className("data-table"))) { - int numSessionDataTables = browser.driver.findElements(By.className("data-table")).size(); - for (int i = 0; i < numSessionDataTables; i++) { - if (!isSessionTableHeaderCorrect(i)) { - return false; - } - } - return true; - } - sessionsPage.waitForTextsForAllStatusMessagesToUserEquals("Currently No Ongoing Sessions"); - return true; - - } - - private boolean isSessionTableHeaderCorrect(int tableNum) { - int numColumns = sessionsPage.getNumberOfColumnsFromDataTable(tableNum); - if (numColumns != 6) { - return false; - } - List expectedSessionTableHeaders = Arrays.asList("Status", - "[Course ID] Session Name ", - "Response Rate", - "Start Time ", - "End Time ", - "Creator"); - List actualSessionTableHeaders = new ArrayList<>(); - for (int i = 0; i < numColumns; i++) { - actualSessionTableHeaders.add(sessionsPage.getHeaderValueFromDataTable(tableNum, 0, i)); - } - return actualSessionTableHeaders.equals(expectedSessionTableHeaders); - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/AllAccessControlUiTests.java b/src/test/java/teammates/test/cases/browsertests/AllAccessControlUiTests.java deleted file mode 100644 index 6fcda85654e..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/AllAccessControlUiTests.java +++ /dev/null @@ -1,195 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.AssertHelper; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.AppPage; -import teammates.test.pageobjects.HomePage; -import teammates.test.pageobjects.LoginPage; - -/** - * We do not test all access control at UI level. This class contains a few - * representative tests only. Access control is tested fully at 'Action' level. - */ -@Priority(6) -public class AllAccessControlUiTests extends BaseE2ETestCase { - - private AppPage currentPage; - - private InstructorAttributes otherInstructor; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/AllAccessControlUiTest.json"); - - // This test suite requires some real accounts; Here, we inject them to the test data. - testData.students.get("student1InCourse1.access").googleId = TestProperties.TEST_STUDENT1_ACCOUNT; - testData.instructors.get("instructor1OfCourse1").googleId = TestProperties.TEST_INSTRUCTOR_ACCOUNT; - - removeAndRestoreDataBundle(testData); - - otherInstructor = testData.instructors.get("instructor1OfCourse2"); - } - - @BeforeClass - public void classSetup() { - currentPage = null; // getHomePage(); - } - - @Test - public void testUserNotLoggedIn() { - - logout(); - AppPage.getNewPageInstance(browser, HomePage.class); - - ______TS("student pages"); - - verifyRedirectToLogin(createUrl(Const.WebPageURIs.STUDENT_HOME_PAGE)); - - ______TS("instructor pages"); - - verifyRedirectToLogin(createUrl(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE)); - - ______TS("admin pages"); - - verifyRedirectToLogin(createUrl(Const.WebPageURIs.ADMIN_HOME_PAGE)); - - } - - @Test - public void testUserNotRegistered() { - - ______TS("student pages"); - - loginStudent(TestProperties.TEST_UNREG_ACCOUNT, TestProperties.TEST_UNREG_PASSWORD); - - verifyRedirectToWelcomeStrangerPage(createUrl(Const.WebPageURIs.STUDENT_HOME_PAGE), - TestProperties.TEST_UNREG_ACCOUNT); - - ______TS("instructor pages"); - - loginInstructorUnsuccessfully(TestProperties.TEST_UNREG_ACCOUNT, TestProperties.TEST_UNREG_PASSWORD); - - AppUrl url = createUrl(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE); - verifyRedirectToNotAuthorized(url); - verifyCannotMasquerade(url, otherInstructor.googleId); - - ______TS("admin pages"); - - //cannot access admin while logged in as student - verifyCannotAccessAdminPages(); - - ______TS("incorrect URL"); - - // AppUrl nonExistentActionUrl = createUrl("/page/nonExistentAction"); - // AppPage.getNewPageInstance(browser, nonExistentActionUrl, NotFoundPage.class); - - } - - @Test - public void testStudentAccessToAdminPages() { - loginStudent(TestProperties.TEST_STUDENT1_ACCOUNT, TestProperties.TEST_STUDENT1_PASSWORD); - verifyCannotAccessAdminPages(); - } - - @Test - public void testStudentHome() { - loginStudent(TestProperties.TEST_STUDENT1_ACCOUNT, TestProperties.TEST_STUDENT1_PASSWORD); - - ______TS("cannot view other homepage"); - - verifyCannotMasquerade(createUrl(Const.WebPageURIs.STUDENT_HOME_PAGE), otherInstructor.googleId); - } - - @Test - public void testInstructorHome() { - - loginInstructor(TestProperties.TEST_INSTRUCTOR_ACCOUNT, TestProperties.TEST_INSTRUCTOR_PASSWORD); - - ______TS("cannot view other homepage"); - - verifyCannotMasquerade(createUrl(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE), otherInstructor.googleId); - } - - private void loginStudent(String userName, String password) { - logout(); - LoginPage loginPage = null; // getHomePage().clickStudentLogin(); - currentPage = loginPage.loginAsStudent(userName, password); - } - - private void loginInstructorUnsuccessfully(String userName, String password) { - logout(); - LoginPage loginPage = null; // getHomePage().clickInstructorLogin(); - currentPage = loginPage.loginAsInstructorUnsuccessfully(userName, password); - } - - private void loginInstructor(String userName, String password) { - logout(); - LoginPage loginPage = null; // getHomePage().clickInstructorLogin(); - currentPage = loginPage.loginAsInstructor(userName, password); - } - - private void verifyCannotAccessAdminPages() { - //cannot access directly - AppUrl url = createUrl(Const.WebPageURIs.ADMIN_HOME_PAGE); - verifyRedirectToForbidden(url); - //cannot access by masquerading either - url = url.withUserId(TestProperties.TEST_ADMIN_ACCOUNT); - verifyRedirectToForbidden(url); - } - - private void verifyCannotMasquerade(AppUrl url, String otherInstructorId) { - AppUrl masqueradeUrl = url.withUserId(otherInstructorId); - verifyRedirectToNotAuthorized(masqueradeUrl); - } - - private void verifyRedirectToWelcomeStrangerPage(AppUrl url, String unregUsername) { - printUrl(url.toAbsoluteString()); - currentPage.navigateTo(url); - // A simple regex check is enough because we do full HTML tests - // elsewhere - AssertHelper.assertContainsRegex( - unregUsername + "{*}Ooops! Your Google account is not known to TEAMMATES", - currentPage.getPageSource()); - } - - private void verifyRedirectToForbidden(AppUrl url) { - if (TestProperties.isDevServer()) { - verifyRedirectToNotAuthorized(url); - } else { - printUrl(url.toAbsoluteString()); - currentPage.navigateTo(url); - assertTrue(currentPage.getPageSource().contains("Your client does not have permission")); - } - } - - private void verifyRedirectToNotAuthorized(AppUrl url) { - printUrl(url.toAbsoluteString()); - currentPage.navigateTo(url); - // currentPage.changePageType(NotAuthorizedPage.class); - } - - private void verifyRedirectToLogin(AppUrl url) { - printUrl(url.toAbsoluteString()); - currentPage.navigateTo(url); - AppPage.createCorrectLoginPageType(browser); - } - - private void printUrl(String url) { - print(" " + url); - } - - @AfterClass - public void classTearDown() { - BackDoor.removeDataBundle(testData); - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/BaseFeedbackQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/BaseFeedbackQuestionUiTest.java deleted file mode 100644 index bc7f3d2456f..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/BaseFeedbackQuestionUiTest.java +++ /dev/null @@ -1,31 +0,0 @@ -package teammates.test.cases.browsertests; - -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.pageobjects.InstructorFeedbackEditPage; - -/** - * Base class for all Feedback*QuestionUiTest. - */ -public abstract class BaseFeedbackQuestionUiTest extends BaseE2ETestCase { - - protected abstract void testNewQuestionFrame(); - - protected abstract void testInputValidation(); - - protected abstract void testCustomizeOptions(); - - protected abstract void testAddQuestionAction() throws Exception; - - protected abstract void testEditQuestionAction() throws Exception; - - protected abstract void testDeleteQuestionAction(); - - protected InstructorFeedbackEditPage getFeedbackEditPage(String instructorId, String courseId, - String feedbackSessionName) { - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE).withUserId(instructorId) - .withCourseId(courseId).withSessionName(feedbackSessionName).withEnableSessionEditDetails(true); - return loginAdminToPageOld(feedbackPageLink, InstructorFeedbackEditPage.class); - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackConstSumOptionQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackConstSumOptionQuestionUiTest.java deleted file mode 100644 index 7eb835cd851..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackConstSumOptionQuestionUiTest.java +++ /dev/null @@ -1,385 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.json.JSONObject; -import org.openqa.selenium.By; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.questions.FeedbackConstantSumDistributePointsType; -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorFeedbackEditPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for constant sum (options) questions. - */ -public class FeedbackConstSumOptionQuestionUiTest extends BaseFeedbackQuestionUiTest { - - private static final int NEW_QUESTION_INDEX = -1; - private static final String QN_TYPE = "constSum"; - - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackConstSumOptionQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @BeforeClass - public void classSetup() { - feedbackEditPage = getFeedbackEditPage(instructorId, courseId, feedbackSessionName); - } - - @Test - public void allTests() throws Exception { - testEditPage(); - - //TODO: move/create other ConstSumOption question related UI tests here. - //i.e. results page, submit page. - } - - private void testEditPage() throws Exception { - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - testReorderOptions(); - testDisableConstSumPointsAction(); - testUiConsistencyForNewQuestion(); - } - - @Override - public void testNewQuestionFrame() { - ______TS("CONSTSUM-option: new question (frame) link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_OPTION"); - assertTrue(feedbackEditPage.verifyNewConstSumQuestionFormIsDisplayed()); - } - - @Override - public void testInputValidation() { - - ______TS("empty options"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("ConstSum-option qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - - feedbackEditPage.fillConstSumPointsBoxForNewQuestion(""); - assertEquals("100", feedbackEditPage.getConstSumPointsBoxForNewQuestion()); - - feedbackEditPage.selectConstSumPointsOptionsForNewQuestion("PerOption"); - feedbackEditPage.fillConstSumPointsForEachOptionBoxForNewQuestion(""); - assertEquals("100", feedbackEditPage.getConstSumPointsForEachOptionBoxForNewQuestion()); - - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little options for Distribute points (among options) question. Minimum number of options is: 2."); - - ______TS("remove when 1 left"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_OPTION"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test const sum question"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - assertTrue(feedbackEditPage.verifyNewConstSumQuestionFormIsDisplayed()); - - feedbackEditPage.clickRemoveConstSumOptionLinkForNewQuestion(1); - assertFalse(feedbackEditPage.isElementPresent("constSumOptionRow-1--1")); - - // TODO: Check that after deleting, the value is cleared - assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-0--1")); - feedbackEditPage.clickRemoveConstSumOptionLinkForNewQuestion(0); - assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-0--1")); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little options for Distribute points (among options) question. Minimum number of options is: 2."); - - ______TS("duplicate options"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_OPTION"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test duplicate options"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - - feedbackEditPage.fillConstSumOptionForNewQuestion(0, "duplicate option"); - feedbackEditPage.fillConstSumOptionForNewQuestion(1, "duplicate option"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.FeedbackQuestion.CONST_SUM_ERROR_DUPLICATE_OPTIONS); - } - - @Override - public void testCustomizeOptions() { - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_OPTION"); - - feedbackEditPage.fillConstSumOptionForNewQuestion(0, "Option 1"); - feedbackEditPage.fillConstSumOptionForNewQuestion(1, "Option 2"); - - ______TS("CONST SUM: add option"); - - assertFalse(feedbackEditPage.isElementPresent("constSumOptionRow-2--1")); - feedbackEditPage.clickAddMoreConstSumOptionLinkForNewQuestion(); - assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-2--1")); - - ______TS("CONST SUM: remove option"); - - feedbackEditPage.fillConstSumOptionForNewQuestion(2, "Option 3"); - assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-1--1")); - feedbackEditPage.clickRemoveConstSumOptionLinkForNewQuestion(1); - assertFalse(feedbackEditPage.isElementPresent("constSumOptionRow-1--1")); - - ______TS("CONST SUM: add option after remove"); - - feedbackEditPage.clickAddMoreConstSumOptionLinkForNewQuestion(); - assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-3--1")); - feedbackEditPage.clickAddMoreConstSumOptionLinkForNewQuestion(); - feedbackEditPage.fillConstSumOptionForNewQuestion(4, "Option 5"); - assertTrue(feedbackEditPage.isElementPresent("constSumOptionRow-4--1")); - } - - @Override - public void testAddQuestionAction() throws Exception { - ______TS("CONST SUM: add question action success"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("const sum qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.fillConstSumPointsBoxForNewQuestion("30"); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.NONE.getDisplayedOption()); - - assertEquals("30", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("30", feedbackEditPage.getConstSumPointsForEachOptionBox(1)); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackConstSumOptionQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - ______TS("CONST SUM: edit question success"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("edited const sum qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - feedbackEditPage.selectConstSumPointsOptions("PerOption", 1); - feedbackEditPage.fillConstSumPointsForEachOptionBox("200", 1); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - assertEquals("200", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("200", feedbackEditPage.getConstSumPointsForEachOptionBox(1)); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackConstSumOptionQuestionEditSuccess.html"); - - ______TS("CONST SUM: edit question failure due to duplicate options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillConstSumOption(0, "duplicate option", 1); - feedbackEditPage.fillConstSumOption(1, "duplicate option", 1); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.FeedbackQuestion.CONST_SUM_ERROR_DUPLICATE_OPTIONS); - - ______TS("CONST SUM: edit to force uneven distribution for all options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.NONE.getDisplayedOption()); - assertFalse(feedbackEditPage.isElementEnabled("constSumDistributePointsSelect-1")); - feedbackEditPage.clickDistributePointsOptionsCheckbox(1); - assertTrue(feedbackEditPage.isElementEnabled("constSumDistributePointsSelect-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption()); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - assertEquals("200", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("200", feedbackEditPage.getConstSumPointsForEachRecipientBox(1)); - - ______TS("CONST SUM: edit to force uneven distribution for at least some options"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("constSumDistributePointsSelect-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption()); - feedbackEditPage.selectConstSumDistributePointsOptions("At least some options", 1); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.DISTRIBUTE_SOME_UNEVENLY.getDisplayedOption()); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - assertEquals("200", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("200", feedbackEditPage.getConstSumPointsForEachRecipientBox(1)); - } - - @Override - public void testDeleteQuestionAction() { - ______TS("CONSTSUM: qn delete then cancel"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - ______TS("CONSTSUM: qn delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - /** - * Tests that distribute points among options (new and existing) can be reordered using drag and drop mechanism. - * @throws Exception when option is not draggable - */ - private void testReorderOptions() throws Exception { - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_OPTION"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddMoreConstSumOptionLinkForNewQuestion(); - feedbackEditPage.clickAddMoreConstSumOptionLinkForNewQuestion(); - - feedbackEditPage.fillConstSumOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillConstSumOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillConstSumOptionForNewQuestion(2, "Choice 3"); - feedbackEditPage.fillConstSumOptionForNewQuestion(3, "Choice 4"); - - ______TS("CONSTSUM: reorder existing options"); - - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, NEW_QUESTION_INDEX, 2, 0); - feedbackEditPage.clickAddQuestionButton(); - JSONObject constSumQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - constSumQuestionDetails.get("constSumOptions").toString()); - - ______TS("CONSTSUM: add option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreConstSumOptionLink(1); - feedbackEditPage.fillConstSumOption(4, "New Choice", 1); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - constSumQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"New Choice\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - constSumQuestionDetails.get("constSumOptions").toString()); - - ______TS("CONSTSUM: delete option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveConstSumOptionLink(2, 1); - feedbackEditPage.fillConstSumOption(1, "Old Choice", 1); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - constSumQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 4\",\"Old Choice\",\"Choice 2\"]", - constSumQuestionDetails.get("constSumOptions").toString()); - - ______TS("CONSTSUM: add, delete and reorder options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveConstSumOptionLink(2, 1); - feedbackEditPage.clickAddMoreConstSumOptionLink(1); - feedbackEditPage.clickAddMoreConstSumOptionLink(1); - feedbackEditPage.fillConstSumOption(4, "New Choice", 1); - feedbackEditPage.fillConstSumOption(5, "Newer Choice", 1); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 5, 0); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - constSumQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Newer Choice\",\"New Choice\",\"Choice 3\",\"Choice 4\",\"Choice 2\"]", - constSumQuestionDetails.get("constSumOptions").toString()); - - ______TS("CONSTSUM: delete question"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - } - - /** - * The element {@code constSumOption_Option} hides, and element {@code constSumOption_Recipient} - * becomes visible when a CONSTSUM_RECIPIENT question is added.
    - * Check that the changes are reverted when a CONSTSUM_OPTION question is added. - */ - private void testUiConsistencyForNewQuestion() { - ______TS("CONSTSUM-option after CONSTSUM-recipient: Check ui consistency success case"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_RECIPIENT"); - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_OPTION"); - - assertTrue(feedbackEditPage.isElementVisible(By.id("constSumPointsTotal--1"))); - assertTrue(feedbackEditPage.isElementVisible(By.id("constSumOption_Option--1"))); - assertFalse(feedbackEditPage.isElementVisible(By.id("constSumOption_Recipient--1"))); - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - } - - /** - * Tests that the constSumPoints* number fields gets disabled, if the corresponding radio button is not checked. - */ - private void testDisableConstSumPointsAction() { - ______TS("Success case: CONSTSUM-option points to distribute field disables when radio button is unchecked"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_OPTION"); - - // Make sure that constSumPointsTotal radio button is selected by default - assertTrue(browser.driver.findElement(By.id("constSumPointsTotal--1")).isSelected()); - // Verify that constSumPointsForEachOption field is disabled - feedbackEditPage.verifyUnclickable(browser.driver.findElement(By.id("constSumPointsForEachOption--1"))); - // Select constSumPointsPerOption radio button - feedbackEditPage.selectConstSumPointsOptionsForNewQuestion("PerOption"); - // Verify that constSumPoints field is disabled - feedbackEditPage.verifyUnclickable(browser.driver.findElement(By.id("constSumPoints--1"))); - // Select constSumPointsTotal radio button. - feedbackEditPage.selectConstSumPointsOptionsForNewQuestion("Total"); - // Verify that constSumPointsForEachOption field is disabled - feedbackEditPage.verifyUnclickable(browser.driver.findElement(By.id("constSumPointsForEachOption--1"))); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackConstSumRecipientQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackConstSumRecipientQuestionUiTest.java deleted file mode 100644 index 8c8b8ae197d..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackConstSumRecipientQuestionUiTest.java +++ /dev/null @@ -1,220 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.util.Collections; - -import org.openqa.selenium.By; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.questions.FeedbackConstantSumDistributePointsType; -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorFeedbackEditPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for constant sum (recipients) questions. - */ -public class FeedbackConstSumRecipientQuestionUiTest extends BaseFeedbackQuestionUiTest { - - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackConstSumRecipientQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @BeforeClass - public void classSetup() { - feedbackEditPage = getFeedbackEditPage(instructorId, courseId, feedbackSessionName); - } - - @Test - public void allTests() throws Exception { - testEditPage(); - - //TODO: move/create other ConstSumRecipient question related UI tests here. - //i.e. results page, submit page. - } - - private void testEditPage() throws Exception { - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - testDisableConstSumPointsAction(); - } - - @Override - public void testNewQuestionFrame() { - ______TS("CONSTSUM-recipient: new question (frame) link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_RECIPIENT"); - assertTrue(feedbackEditPage.verifyNewConstSumQuestionFormIsDisplayed()); - } - - @Override - public void testInputValidation() { - - ______TS("CONST SUM: input validation"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("ConstSum-recipient qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - - feedbackEditPage.fillConstSumPointsBoxForNewQuestion(""); - assertEquals("100", feedbackEditPage.getConstSumPointsBoxForNewQuestion()); - - feedbackEditPage.selectConstSumPointsOptionsForNewQuestion("PerRecipient"); - feedbackEditPage.fillConstSumPointsForEachRecipientBoxForNewQuestion(""); - assertEquals("100", feedbackEditPage.getConstSumPointsForEachRecipientBoxForNewQuestion()); - - assertFalse(feedbackEditPage.isElementVisible("constSumOptionTable--1")); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - assertEquals(Collections.emptyList(), feedbackEditPage.getTextsForAllStatusMessagesToUser()); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Override - public void testCustomizeOptions() { - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_RECIPIENT"); - - ______TS("CONST SUM: set points options"); - - feedbackEditPage.selectConstSumPointsOptionsForNewQuestion("PerRecipient"); - feedbackEditPage.fillConstSumPointsForEachRecipientBoxForNewQuestion("30"); - } - - @Override - public void testAddQuestionAction() throws Exception { - ______TS("CONST SUM: add question action success"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("const sum qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.NONE.getDisplayedOption()); - - assertEquals("30", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("30", feedbackEditPage.getConstSumPointsForEachRecipientBox(1)); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackConstSumRecipientQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - ______TS("CONST SUM: edit question success"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("edited const sum qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - feedbackEditPage.selectConstSumPointsOptions("Total", 1); - feedbackEditPage.fillConstSumPointsBox("200", 1); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - assertEquals("200", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("200", feedbackEditPage.getConstSumPointsForEachRecipientBox(1)); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackConstSumRecipientQuestionEditSuccess.html"); - - ______TS("CONST SUM: edit to force uneven distribution for all recipients"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.NONE.getDisplayedOption()); - assertFalse(feedbackEditPage.isElementEnabled("constSumDistributePointsSelect-1")); - feedbackEditPage.clickDistributePointsOptionsCheckbox(1); - assertTrue(feedbackEditPage.isElementEnabled("constSumDistributePointsSelect-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption()); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - assertEquals("200", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("200", feedbackEditPage.getConstSumPointsForEachRecipientBox(1)); - - ______TS("CONST SUM: edit to force uneven distribution for at least some recipients"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("constSumDistributePointsSelect-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.DISTRIBUTE_ALL_UNEVENLY.getDisplayedOption()); - feedbackEditPage.selectConstSumDistributePointsOptions("At least some options", 1); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_CONSTSUMDISTRIBUTEPOINTSOPTIONS + "-1", - FeedbackConstantSumDistributePointsType.DISTRIBUTE_SOME_UNEVENLY.getDisplayedOption()); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - assertEquals("200", feedbackEditPage.getConstSumPointsBox(1)); - assertEquals("200", feedbackEditPage.getConstSumPointsForEachRecipientBox(1)); - } - - @Override - public void testDeleteQuestionAction() { - ______TS("CONSTSUM: qn delete then cancel"); - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - ______TS("CONSTSUM: qn delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - /** - * Tests that the constSumPoints* number fields gets disabled, if the corresponding radio button is not checked. - */ - private void testDisableConstSumPointsAction() { - ______TS("Success case: CONSTSUM-recipient points to distribute field disables when radio button is unchecked"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONSTSUM_RECIPIENT"); - - // Make sure that constSumPointsTotal radio button is selected by default - assertTrue(browser.driver.findElement(By.id("constSumPointsTotal--1")).isSelected()); - // Verify that constSumPointsForEachRecipient field is disabled - feedbackEditPage.verifyUnclickable(browser.driver.findElement(By.id("constSumPointsForEachRecipient--1"))); - // Select constSumPointsPerOption radio button - feedbackEditPage.selectConstSumPointsOptionsForNewQuestion("PerRecipient"); - // Verify that constSumPoints field is disabled - feedbackEditPage.verifyUnclickable(browser.driver.findElement(By.id("constSumPoints--1"))); - // Select constSumPointsTotal radio button. - feedbackEditPage.selectConstSumPointsOptionsForNewQuestion("Total"); - // Verify that constSumPointsForEachRecipient field is disabled - feedbackEditPage.verifyUnclickable(browser.driver.findElement(By.id("constSumPointsForEachRecipient--1"))); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackContributionQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackContributionQuestionUiTest.java deleted file mode 100644 index 0b615ad376d..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackContributionQuestionUiTest.java +++ /dev/null @@ -1,228 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorFeedbackEditPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for contribution questions. - */ -public class FeedbackContributionQuestionUiTest extends BaseFeedbackQuestionUiTest { - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackContributionQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @BeforeClass - public void classSetup() { - feedbackEditPage = getFeedbackEditPage(instructorId, courseId, feedbackSessionName); - } - - @Test - public void allTests() throws Exception { - testEditPage(); - - //TODO: move/create other Contribution question related UI tests here. - //i.e. results page, submit page. - } - - private void testEditPage() throws Exception { - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - testCopyOptions(); - } - - @Override - public void testNewQuestionFrame() { - ______TS("CONTRIB: new question (frame) link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONTRIB"); - assertTrue(feedbackEditPage.verifyNewContributionQuestionFormIsDisplayed()); - } - - @Override - public void testInputValidation() { - - ______TS("empty question text"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEqualsErrorTexts( - Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); - } - - @Override - public void testCustomizeOptions() { - - //no question specific options to test - - ______TS("CONTRIB: verify only valid visibility options are visible"); - - assertTrue(feedbackEditPage - .isVisibilityDropdownOptionHiddenForNewQuestion("ANONYMOUS_TO_RECIPIENT_AND_INSTRUCTORS")); - assertTrue(feedbackEditPage - .isVisibilityDropdownOptionHiddenForNewQuestion("ANONYMOUS_TO_RECIPIENT_VISIBLE_TO_INSTRUCTORS")); - assertFalse(feedbackEditPage - .isVisibilityDropdownOptionHiddenForNewQuestion("ANONYMOUS_TO_RECIPIENT_AND_TEAM_VISIBLE_TO_INSTRUCTORS")); - assertFalse(feedbackEditPage.isVisibilityDropdownOptionHiddenForNewQuestion("VISIBLE_TO_INSTRUCTORS_ONLY")); - assertTrue(feedbackEditPage.isVisibilityDropdownOptionHiddenForNewQuestion("VISIBLE_TO_RECIPIENT_AND_INSTRUCTORS")); - assertTrue(feedbackEditPage.isVisibilityDropdownSeparatorHiddenForNewQuestion()); - assertTrue(feedbackEditPage.isVisibilityDropdownOptionHiddenForNewQuestion("OTHER")); - - ______TS("CONTRIB: verify correct output params for selected visibility option"); - - // default (first option) - assertEquals("RECEIVER,OWN_TEAM_MEMBERS,RECEIVER_TEAM_MEMBERS,INSTRUCTORS", - feedbackEditPage.getVisibilityParamShowResponsesToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowGiverToForNewQuestion()); - assertEquals("RECEIVER,INSTRUCTORS", feedbackEditPage.getVisibilityParamShowRecipientToForNewQuestion()); - - feedbackEditPage.clickVisibilityDropdownForNewQuestionAndWaitForVisibilityMessageToLoad( - "VISIBLE_TO_INSTRUCTORS_ONLY"); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowResponsesToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowGiverToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowRecipientToForNewQuestion()); - - feedbackEditPage.clickVisibilityDropdownForNewQuestionAndWaitForVisibilityMessageToLoad( - "ANONYMOUS_TO_RECIPIENT_AND_TEAM_VISIBLE_TO_INSTRUCTORS"); - assertEquals("RECEIVER,OWN_TEAM_MEMBERS,RECEIVER_TEAM_MEMBERS,INSTRUCTORS", - feedbackEditPage.getVisibilityParamShowResponsesToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowGiverToForNewQuestion()); - assertEquals("RECEIVER,INSTRUCTORS", feedbackEditPage.getVisibilityParamShowRecipientToForNewQuestion()); - - } - - @Override - public void testAddQuestionAction() throws Exception { - ______TS("CONTRIB: add question action success"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("contrib qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackContribQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - ______TS("CONTRIB: edit question success"); - - feedbackEditPage.clickEditQuestionButton(1); - - //Check invalid feedback paths are disabled. - //Javascript should hide giver/recipient options that are not STUDENTS to OWN_TEAM_MEMBERS_INCLUDING_SELF - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackContribQuestionEdit.html"); - - feedbackEditPage.fillQuestionTextBox("edited contrib qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - feedbackEditPage.toggleNotSureCheck(1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackContribQuestionEditSuccess.html"); - } - - @Override - public void testDeleteQuestionAction() { - ______TS("CONTRIB: qn delete then cancel"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - ______TS("CONTRIB: qn delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - /** - * Tests the copying of options to/from contribution questions. Options should not be - * copied in the case of a contribution question being added after a non-contribution - * question. This is to prevent options that are invalid for contribution questions - * from being copied over to a contribution question. - */ - private void testCopyOptions() { - ______TS("CONTRIB: skip copy visibility options non-contrib -> contrib"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("q1, essay qn"); - feedbackEditPage.clickVisibilityDropdownForNewQuestionAndWaitForVisibilityMessageToLoad( - "VISIBLE_TO_INSTRUCTORS_ONLY"); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowResponsesToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowGiverToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowRecipientToForNewQuestion()); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONTRIB"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("q2, contribution qn"); - assertEquals("Shown anonymously to recipient and team members, visible to instructors", - feedbackEditPage.getVisibilityDropdownLabelForNewQuestion()); - assertEquals("RECEIVER,OWN_TEAM_MEMBERS,RECEIVER_TEAM_MEMBERS,INSTRUCTORS", - feedbackEditPage.getVisibilityParamShowResponsesToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowGiverToForNewQuestion()); - assertEquals("RECEIVER,INSTRUCTORS", feedbackEditPage.getVisibilityParamShowRecipientToForNewQuestion()); - - feedbackEditPage.clickVisibilityDropdownForNewQuestionAndWaitForVisibilityMessageToLoad( - "VISIBLE_TO_INSTRUCTORS_ONLY"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - ______TS("CONTRIB: copy visibility options contrib -> contrib"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONTRIB"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("q3, contribution qn"); - assertEquals("Visible to instructors only", - feedbackEditPage.getVisibilityDropdownLabelForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowResponsesToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowGiverToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowRecipientToForNewQuestion()); - - feedbackEditPage.clickVisibilityDropdownForNewQuestionAndWaitForVisibilityMessageToLoad( - "ANONYMOUS_TO_RECIPIENT_AND_TEAM_VISIBLE_TO_INSTRUCTORS"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - ______TS("CONTRIB: copy visibility options contrib -> non-contrib"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - - assertEquals("Shown anonymously to recipient and team members, visible to instructors", - feedbackEditPage.getVisibilityDropdownLabelForNewQuestion()); - assertEquals("RECEIVER,OWN_TEAM_MEMBERS,INSTRUCTORS", - feedbackEditPage.getVisibilityParamShowResponsesToForNewQuestion()); - assertEquals("INSTRUCTORS", feedbackEditPage.getVisibilityParamShowGiverToForNewQuestion()); - assertEquals("RECEIVER,INSTRUCTORS", feedbackEditPage.getVisibilityParamShowRecipientToForNewQuestion()); - - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackMcqQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackMcqQuestionUiTest.java deleted file mode 100644 index e01186ce1b8..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackMcqQuestionUiTest.java +++ /dev/null @@ -1,762 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.util.List; - -import org.json.JSONObject; -import org.openqa.selenium.By; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorFeedbackEditPage; -import teammates.test.pageobjects.InstructorFeedbackResultsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for multiple choice (single answer) questions. - */ -public class FeedbackMcqQuestionUiTest extends BaseFeedbackQuestionUiTest { - - private static final int NEW_QUESTION_INDEX = -1; - private static final String QN_TYPE = "mcq"; - - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackMcqQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @BeforeClass - public void classSetup() { - feedbackEditPage = getFeedbackEditPage(instructorId, courseId, feedbackSessionName); - } - - @Test - public void allTests() throws Exception { - testEditPage(); - - //TODO: move/create other MCQ question related UI tests here. - //i.e. results page, submit page. - } - - private void testEditPage() throws Exception { - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - testReorderOptions(); - } - - @Override - public void testNewQuestionFrame() { - - ______TS("MCQ: new question (frame) link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); - - ______TS("MCQ: Check UI after cancelling and add new MCQ question again"); - - feedbackEditPage.clickGenerateMcqOptionsCheckbox(NEW_QUESTION_INDEX); - assertFalse(feedbackEditPage.isElementVisible("mcqChoiceTable--1")); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); - assertFalse(feedbackEditPage.isElementVisible("mcqChoiceTable--1")); - assertTrue(feedbackEditPage.isElementEnabled("mcqGenerateForSelect--1")); - assertTrue(feedbackEditPage.isElementSelected("generateMcqOptionsCheckbox--1")); - - feedbackEditPage.clickGenerateMcqOptionsCheckbox(NEW_QUESTION_INDEX); //Make the generate options checkbox unchecked - - } - - @Override - public void testInputValidation() { - - ______TS("empty question text"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); - - ______TS("empty options"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little choices for Multiple-choice (single answer) question. Minimum number of options is: 2."); - - ______TS("remove when 1 left"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); - - feedbackEditPage.clickRemoveMcqOptionLinkForNewQuestion(1); - assertFalse(feedbackEditPage.isElementPresent("mcqOptionRow-1--1")); - - // TODO: Check that after deleting, the value is cleared - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-0--1")); - feedbackEditPage.clickRemoveMcqOptionLinkForNewQuestion(0); - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-0--1")); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little choices for Multiple-choice (single answer) question. Minimum number of options is: 2."); - - ______TS("remove when 1 left and select Add Other Option"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); - - feedbackEditPage.clickRemoveMcqOptionLinkForNewQuestion(1); - assertFalse(feedbackEditPage.isElementPresent("mcqOptionRow-1--1")); - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-0--1")); - - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little choices for Multiple-choice (single answer) question. Minimum number of options is: 2."); - } - - @Override - public void testCustomizeOptions() { - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - - feedbackEditPage.fillMcqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMcqOptionForNewQuestion(1, "Choice 2"); - - ______TS("MCQ: add mcq option"); - - assertFalse(feedbackEditPage.isElementPresent("mcqOptionRow-2--1")); - feedbackEditPage.clickAddMoreMcqOptionLinkForNewQuestion(); - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-2--1")); - - ______TS("MCQ: remove mcq option"); - - feedbackEditPage.fillMcqOptionForNewQuestion(2, "Choice 3"); - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-1--1")); - feedbackEditPage.clickRemoveMcqOptionLinkForNewQuestion(1); - assertFalse(feedbackEditPage.isElementPresent("mcqOptionRow-1--1")); - - ______TS("MCQ: add mcq option after remove"); - - feedbackEditPage.clickAddMoreMcqOptionLinkForNewQuestion(); - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-3--1")); - feedbackEditPage.clickAddMoreMcqOptionLinkForNewQuestion(); - feedbackEditPage.fillMcqOptionForNewQuestion(4, "Choice 5"); - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-4--1")); - } - - @Override - public void testAddQuestionAction() throws Exception { - - ______TS("MCQ: add question action success"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("mcq qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - //NOTE: Tests feedback giver/recipient and visibility options are copied from previous question. - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMcqQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - - ______TS("MCQ: edit question success"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("edited mcq qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - assertTrue(feedbackEditPage.isElementPresent("mcqOptionRow-0-1")); - feedbackEditPage.clickRemoveMcqOptionLink(0, 1); - assertFalse(feedbackEditPage.isElementPresent("mcqOptionRow-0-1")); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMcqQuestionEditSuccess.html"); - - ______TS("MCQ: edit to generated options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("generated mcq qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - assertTrue(feedbackEditPage.isElementVisible("mcqAddOptionLink-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.NONE.toString()); - assertFalse(feedbackEditPage.isElementEnabled("mcqGenerateForSelect-1")); - feedbackEditPage.clickGenerateMcqOptionsCheckbox(1); - assertTrue(feedbackEditPage.isElementEnabled("mcqGenerateForSelect-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.STUDENTS.toString()); - assertFalse(feedbackEditPage.isElementVisible("mcqAddOptionLink-1")); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - assertFalse(feedbackEditPage.isElementPresent("mcqOptionRow-0-1")); - assertFalse(feedbackEditPage.isElementEnabled("generateMcqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMcqOptionsCheckbox-1")); - assertFalse(feedbackEditPage.isElementEnabled("mcqGenerateForSelect-1")); - feedbackEditPage.verifyFieldValue( - "mcqGenerateForSelect-1", - FeedbackParticipantType.STUDENTS.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.STUDENTS.toString()); - - ______TS("MCQ: change generated type to students (excluding self)"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("generateMcqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMcqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementEnabled("mcqGenerateForSelect-1")); - feedbackEditPage.selectMcqGenerateOptionsFor("students (excluding self)", 1); - feedbackEditPage.verifyFieldValue( - "mcqGenerateForSelect-1", - FeedbackParticipantType.STUDENTS_EXCLUDING_SELF.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.STUDENTS_EXCLUDING_SELF.toString()); - - ______TS("MCQ: change generated type to teams"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("generateMcqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMcqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementEnabled("mcqGenerateForSelect-1")); - feedbackEditPage.selectMcqGenerateOptionsFor("teams", 1); - feedbackEditPage.verifyFieldValue( - "mcqGenerateForSelect-1", - FeedbackParticipantType.TEAMS.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.TEAMS.toString()); - - ______TS("MCQ: change generated type to teams (excluding self)"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("generateMcqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMcqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementEnabled("mcqGenerateForSelect-1")); - feedbackEditPage.selectMcqGenerateOptionsFor("teams (excluding self)", 1); - feedbackEditPage.verifyFieldValue( - "mcqGenerateForSelect-1", - FeedbackParticipantType.TEAMS_EXCLUDING_SELF.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.TEAMS_EXCLUDING_SELF.toString()); - - } - - @Override - public void testDeleteQuestionAction() { - - ______TS("MCQ: qn delete then cancel"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - ______TS("MCQ: qn delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - /** - * Tests that MCQ options (new and existing) can be reordered using drag and drop mechanism. - * @throws Exception when option is not draggable - */ - private void testReorderOptions() throws Exception { - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddMoreMcqOptionLinkForNewQuestion(); - feedbackEditPage.clickAddMoreMcqOptionLinkForNewQuestion(); - - feedbackEditPage.fillMcqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMcqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillMcqOptionForNewQuestion(2, "Choice 3"); - feedbackEditPage.fillMcqOptionForNewQuestion(3, "Choice 4"); - - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 0, "10"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 1, "20"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 2, "30"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 3, "40"); - - ______TS("MCQ: reorder existing options"); - - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, NEW_QUESTION_INDEX, 2, 0); - feedbackEditPage.clickAddQuestionButton(); - JSONObject mcqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - mcqQuestionDetails.get("mcqChoices").toString()); - assertEquals("[30,10,20,40]", mcqQuestionDetails.get("mcqWeights").toString()); - - ______TS("MCQ: add option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMcqOptionLink(1); - feedbackEditPage.fillMcqOption(1, 4, "New Choice"); - feedbackEditPage.fillMcqWeightBox(1, 4, "50"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - mcqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"New Choice\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - mcqQuestionDetails.get("mcqChoices").toString()); - assertEquals("[30,50,10,20,40]", mcqQuestionDetails.get("mcqWeights").toString()); - - ______TS("MCQ: delete option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveMcqOptionLink(2, 1); - feedbackEditPage.fillMcqOption(1, 1, "Old Choice"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - mcqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 4\",\"Old Choice\",\"Choice 2\"]", - mcqQuestionDetails.get("mcqChoices").toString()); - assertEquals("[30,40,50,20]", mcqQuestionDetails.get("mcqWeights").toString()); - - ______TS("MCQ: add, delete and reorder options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveMcqOptionLink(2, 1); - feedbackEditPage.clickAddMoreMcqOptionLink(1); - feedbackEditPage.clickAddMoreMcqOptionLink(1); - feedbackEditPage.fillMcqOption(1, 4, "New Choice"); - feedbackEditPage.fillMcqOption(1, 5, "Newer Choice"); - feedbackEditPage.fillMcqWeightBox(1, 4, "50"); - feedbackEditPage.fillMcqWeightBox(1, 5, "60"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 5, 0); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - mcqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Newer Choice\",\"New Choice\",\"Choice 3\",\"Choice 4\",\"Choice 2\"]", - mcqQuestionDetails.get("mcqChoices").toString()); - assertEquals("[60,50,30,40,20]", mcqQuestionDetails.get("mcqWeights").toString()); - - ______TS("MCQ: weights should be reordered when checkbox is unticked"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMcqOptionLink(1); - feedbackEditPage.fillMcqOption(1, 5, "Newest Choice"); - feedbackEditPage.fillMcqWeightBox(1, 5, "70"); - feedbackEditPage.clickMcqHasAssignWeightsCheckbox(1); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 0); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 3, 1); - feedbackEditPage.clickMcqHasAssignWeightsCheckbox(1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - mcqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 2\",\"Choice 3\",\"Newer Choice\",\"New Choice\",\"Choice 4\",\"Newest Choice\"]", - mcqQuestionDetails.get("mcqChoices").toString()); - assertEquals("[20,30,60,50,40,70]", mcqQuestionDetails.get("mcqWeights").toString()); - - ______TS("MCQ: delete question"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMcqWeightsFeature_shouldToggleStateCorrectly() { - - ______TS("MCQ: Weight cells are visible when assigneWeights checkbox is clicked?"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - // Check if the MCQ weights column are visible or not. - assertTrue(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - // Check the 'other' option is disabled and otherWeight cell is hidden - assertFalse(feedbackEditPage.isMcqOtherOptionCheckboxChecked(NEW_QUESTION_INDEX)); - assertFalse(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - ______TS("MCQ: Other weight Cell is visible when other option and weights both are enabled"); - - // Check Assign MCQ weights Enabled but other option disabled - assertTrue(feedbackEditPage.isMcqHasAssignWeightCheckboxChecked(NEW_QUESTION_INDEX)); - assertFalse(feedbackEditPage.isMcqOtherOptionCheckboxChecked(NEW_QUESTION_INDEX)); - - // Assign Other option and test that other weight cell is displayed. - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - assertTrue(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - // Uncheck checkboxes for consistency among other tests, - // otherwise these settings will persist after cancelling the question form - // Uncheck the 'Choices are weighted' checkbox. - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - assertFalse(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - assertFalse(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - - // Cancel question - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - @Test - public void testMcqWeightsFeature_shouldHaveCorrectDefaultValue() throws Exception { - - ______TS("MCQ: Weight cells are hidden by default"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - // Check if the 'Choices are weighted' checkbox unchecked by default. - assertFalse(feedbackEditPage.isMcqHasAssignWeightCheckboxChecked(NEW_QUESTION_INDEX)); - // Check if the MCQ weights column hidden by default - assertFalse(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - assertFalse(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - ______TS("MCQ: Check Mcq weight default value"); - feedbackEditPage.fillQuestionTextBox("MCQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - - // Fill MCQ choices and check corresponding weight values - feedbackEditPage.fillMcqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.verifyFieldValue("mcqWeight-0--1", "0"); - feedbackEditPage.fillMcqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.verifyFieldValue("mcqWeight-1--1", "0"); - - // Verify MCQ other weight default value - feedbackEditPage.verifyFieldValue("mcqOtherWeight--1", "0"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - // verify html page - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMcqQuestionWeightAddSuccess.html"); - - // Delete the question - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - @Test - public void testMcqWeightsFeature_shouldValidateFieldCorrectly() { - ______TS("MCQ: Test front-end validation for empty weights"); - // Add a question with valid weights to check front-end validation - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - feedbackEditPage.fillQuestionTextBox("MCQ weight front-end validation", NEW_QUESTION_INDEX); - feedbackEditPage.fillMcqOption(NEW_QUESTION_INDEX, 0, "Choice 1"); - feedbackEditPage.fillMcqOption(NEW_QUESTION_INDEX, 1, "Choice 2"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 0, "1"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 1, "2"); - feedbackEditPage.fillMcqOtherWeightBox(NEW_QUESTION_INDEX, "1"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - // Edit the question to enter invalid weight values - feedbackEditPage.clickEditQuestionButton(1); - - // Check validation for MCQ weight cells - feedbackEditPage.fillMcqWeightBox(1, 0, ""); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMcqWeightBoxFocused(1, 0)); - feedbackEditPage.fillMcqWeightBox(1, 0, "0"); - - // Check validation for empty other weight - feedbackEditPage.fillMcqOtherWeightBox(1, ""); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMcqOtherWeightBoxFocused(1)); - feedbackEditPage.fillMcqOtherWeightBox(1, "0"); - - // Check validation for the weight cells added by 'add option' button - feedbackEditPage.clickAddMoreMcqOptionLink(1); - assertTrue(feedbackEditPage.isElementPresent(By.id("mcqWeight-2-1"))); - feedbackEditPage.fillMcqOption(1, 2, "Choice 3"); - feedbackEditPage.fillMcqWeightBox(1, 2, ""); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMcqWeightBoxFocused(1, 2)); - feedbackEditPage.clickRemoveMcqOptionLink(2, 1); - feedbackEditPage.clickDiscardChangesLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - ______TS("Test front-end validation for negative weights"); - feedbackEditPage.clickEditQuestionButton(1); - // Check validation for mcq weight box - feedbackEditPage.fillMcqWeightBox(1, 0, "-2"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.isMcqWeightBoxFocused(1, 0); - feedbackEditPage.fillMcqWeightBox(1, 0, "2"); - - // Check validation for other weight - feedbackEditPage.fillMcqOtherWeightBox(1, "-3"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.isMcqOtherWeightBoxFocused(1); - feedbackEditPage.fillMcqOtherWeightBox(1, "2"); - - // Check validation for weight cells added by 'Add Option' button - feedbackEditPage.clickAddMoreMcqOptionLink(1); - assertTrue(feedbackEditPage.isElementPresent(By.id("mcqWeight-2-1"))); - feedbackEditPage.fillMcqOption(1, 2, "Choice 3"); - feedbackEditPage.fillMcqWeightBox(1, 2, "-5"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMcqWeightBoxFocused(1, 2)); - feedbackEditPage.clickRemoveMcqOptionLink(2, 1); - - // Delete the question. - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMcqWeightsFeature_shouldAddWeightsCorrectly() throws Exception { - ______TS("Success: Add weights"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - feedbackEditPage.fillQuestionTextBox("MCQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - - // Fill MCQ choices and corresponding weight values - feedbackEditPage.fillMcqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 0, "1"); - feedbackEditPage.fillMcqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 1, "2"); - feedbackEditPage.fillMcqOtherWeightBox(NEW_QUESTION_INDEX, "3"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - FeedbackQuestionAttributes question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - assertNotNull(question); - - // Check that weights have been added correctly - FeedbackMcqQuestionDetails questionDetails = (FeedbackMcqQuestionDetails) question.getQuestionDetails(); - List mcqWeights = questionDetails.getMcqWeights(); - assertEquals(2, mcqWeights.size()); - assertEquals(1.0, mcqWeights.get(0)); - assertEquals(2.0, mcqWeights.get(1)); - assertEquals(3.0, questionDetails.getMcqOtherWeight()); - - ______TS("MCQ: Add more weights"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMcqOptionLink(1); - assertTrue(feedbackEditPage.isElementPresent("mcqOption-2-1")); - assertTrue(feedbackEditPage.isElementPresent("mcqWeight-2-1")); - feedbackEditPage.fillMcqOption(1, 2, "Choice 3"); - feedbackEditPage.fillMcqWeightBox(1, 2, "4"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check that weights have been added correctly - question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - questionDetails = (FeedbackMcqQuestionDetails) question.getQuestionDetails(); - mcqWeights = questionDetails.getMcqWeights(); - assertEquals(3, mcqWeights.size()); - assertEquals(4.0, mcqWeights.get(2)); - - ______TS("MCQ: Failed to add weight due to invalid choice value"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMcqOptionLink(1); - - // Test for choice that has only spaces - assertTrue(feedbackEditPage.isElementPresent("mcqOption-3-1")); - assertTrue(feedbackEditPage.isElementPresent("mcqWeight-3-1")); - feedbackEditPage.fillMcqOption(1, 3, " "); // Choices with only spaces - feedbackEditPage.fillMcqWeightBox(1, 3, "5"); - - // The question form removes invalid choices, - // So, the corresponding weights should be removed as well, without throwing an error. - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check that the invalid choice and the corresponding weight cell is removed from the question. - assertFalse(feedbackEditPage.isElementPresent("mcqOption-3-1")); - assertFalse(feedbackEditPage.isElementPresent("mcqWeight-3-1")); - - // Check that weight has not been added to the question. - question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - questionDetails = (FeedbackMcqQuestionDetails) question.getQuestionDetails(); - mcqWeights = questionDetails.getMcqWeights(); - // Size of weight list should remain 3 as weight has not been added. - assertEquals(3, mcqWeights.size()); - - // Delete the question. - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMcqWeightsFeature_shouldEditWeightsCorrectly() throws Exception { - // Add a question to test edit weight feature. - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - feedbackEditPage.fillQuestionTextBox("MCQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - - // Fill MCQ choices and check corresponding weight values - feedbackEditPage.fillMcqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 0, "1"); - feedbackEditPage.fillMcqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillMcqWeightBox(NEW_QUESTION_INDEX, 1, "2"); - feedbackEditPage.fillMcqOtherWeightBox(NEW_QUESTION_INDEX, "3"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - ______TS("MCQ: Edit weights success"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillMcqWeightBox(1, 0, "1.55"); - feedbackEditPage.fillMcqWeightBox(1, 1, "2.77"); - feedbackEditPage.fillMcqOtherWeightBox(1, "3.66"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // verify weights for the question - feedbackEditPage.verifyFieldValue("mcqWeight-0-1", "1.55"); - feedbackEditPage.verifyFieldValue("mcqWeight-1-1", "2.77"); - feedbackEditPage.verifyFieldValue("mcqOtherWeight-1", "3.66"); - - // verify html page - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMcqQuestionWeightEditSuccess.html"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMcqWeightFeature_shouldNotHaveWeightsForGenerateOptions() { - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - feedbackEditPage.fillQuestionTextBox("MCQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); - - ______TS("MCQ: Test that selecting generated option hides mcq weights cells and checkbox"); - - // Test visibility of mcq weights and checkbox before selecting mcq generated option. - assertTrue(feedbackEditPage.getMcqHasAssignWeightsCheckbox(NEW_QUESTION_INDEX).isDisplayed()); - assertTrue(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - assertTrue(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - feedbackEditPage.clickGenerateMcqOptionsCheckbox(NEW_QUESTION_INDEX); - - // Check that 'choices are weighted' checkbox is hidden - assertFalse(feedbackEditPage.getMcqHasAssignWeightsCheckbox(NEW_QUESTION_INDEX).isDisplayed()); - assertFalse(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - assertFalse(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - ______TS("MCQ: Test mcq weight have default values after edit to generated options"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickGenerateMcqOptionsCheckbox(1); // Uncheck the generated option checkbox - - // Check that weight fields are again visible after unchecking generated option, - // and also check that all the fields have the default values stored. - assertFalse(feedbackEditPage.isMcqHasAssignWeightCheckboxChecked(1)); - assertFalse(feedbackEditPage.isMcqOtherOptionCheckboxChecked(1)); - - // Add One option and check MCQ assign weight checkbox to check the mcq weight field value. - feedbackEditPage.clickAddMoreMcqOptionLink(1); - feedbackEditPage.clickMcqHasAssignWeightsCheckbox(1); - assertTrue(feedbackEditPage.getMcqWeightBox(1, 0).isDisplayed()); - feedbackEditPage.verifyFieldValue("mcqWeight-0-1", "0"); - - // Check the other option to test the value of other weight - feedbackEditPage.clickAddMcqOtherOptionCheckbox(1); - assertTrue(feedbackEditPage.getMcqOtherWeightBox(1).isDisplayed()); - feedbackEditPage.verifyFieldValue("mcqOtherWeight-1", "0"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test(priority = 1) - public void testMcqWeightsFeature_instructorResultsPageQuestionView_showStatistics() throws Exception { - // Create the Action URI for 'MCQ Weights Session' to show the result page. - AppUrl editUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_RESULTS_PAGE) - .withUserId("FMcqQnUiT.instructor") - .withCourseId("FMcqQnUiT.CS2104") - .withSessionName(testData.feedbackSessions.get("mcqSession").getFeedbackSessionName()) - .withParam(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, "question"); - - InstructorFeedbackResultsPage instructorResultsPage = - loginAdminToPageOld(editUrl, InstructorFeedbackResultsPage.class); - - ______TS("Show statistics for mcq question without weights enabled"); - - instructorResultsPage.clickShowStats(); - instructorResultsPage.loadResultQuestionPanel(1); - assertEquals(instructorResultsPage.showStatsCheckbox.getAttribute("checked"), "true"); - assertTrue(instructorResultsPage.verifyAllStatsVisibility()); - instructorResultsPage.verifyHtmlMainContent( - "/instructorFeedbackResultsPageMcqQuestionViewWithoutWeightsAttached.html"); - instructorResultsPage.clickShowStats(); // This will collapse the particular question 1 panel - - ______TS("Show statistics for MCQ question with weights attached"); - - instructorResultsPage.clickShowStats(); - instructorResultsPage.loadResultQuestionPanel(2); - assertEquals(instructorResultsPage.showStatsCheckbox.getAttribute("checked"), "true"); - assertTrue(instructorResultsPage.verifyAllStatsVisibility()); - instructorResultsPage.verifyHtmlMainContent( - "/instructorFeedbackResultsPageMcqQuestionViewWithWeightsAttached.html"); - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackMsqQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackMsqQuestionUiTest.java deleted file mode 100644 index eb0d0047593..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackMsqQuestionUiTest.java +++ /dev/null @@ -1,974 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.util.List; - -import org.json.JSONObject; -import org.openqa.selenium.By; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.DataBundle; -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.questions.FeedbackMsqQuestionDetails; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorFeedbackEditPage; -import teammates.test.pageobjects.InstructorFeedbackResultsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for multiple choice (multiple answers) questions. - */ -public class FeedbackMsqQuestionUiTest extends BaseFeedbackQuestionUiTest { - - private static final int NEW_QUESTION_INDEX = -1; - private static final String QN_TYPE = "msq"; - - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackMsqQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @BeforeClass - public void classSetup() { - feedbackEditPage = getFeedbackEditPage(instructorId, courseId, feedbackSessionName); - } - - @Test - public void allTests() throws Exception { - testEditPage(); - - //TODO: move/create other MSQ question related UI tests here. - //i.e. results page, submit page. - } - - private void testEditPage() throws Exception { - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - testReorderOptions(); - } - - @Override - public void testNewQuestionFrame() { - - ______TS("MSQ: new question (frame) link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - assertTrue(feedbackEditPage.verifyNewMsqQuestionFormIsDisplayed()); - - ______TS("MSQ: Check UI after cancelling and add new MSQ question again"); - - feedbackEditPage.clickGenerateMsqOptionsCheckbox(NEW_QUESTION_INDEX); - assertFalse(feedbackEditPage.isElementVisible("msqChoiceTable--1")); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - assertTrue(feedbackEditPage.verifyNewMsqQuestionFormIsDisplayed()); - assertFalse(feedbackEditPage.isElementVisible("msqChoiceTable--1")); - assertTrue(feedbackEditPage.isElementEnabled("msqGenerateForSelect--1")); - assertTrue(feedbackEditPage.isElementSelected("generateMsqOptionsCheckbox--1")); - - feedbackEditPage.clickGenerateMsqOptionsCheckbox(NEW_QUESTION_INDEX); //Make the generate options checkbox unchecked - - } - - @Override - public void testInputValidation() { - - ______TS("empty question text"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); - - ______TS("empty options"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little choices for Multiple-choice (multiple answers) question. Minimum number of options is: 2."); - - ______TS("remove when 1 left"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - - feedbackEditPage.clickRemoveMsqOptionLinkForNewQuestion(1); - assertFalse(feedbackEditPage.isElementPresent("msqOptionRow-1--1")); - - // TODO: Check that after deleting, the value is cleared - assertTrue(feedbackEditPage.isElementPresent("msqOptionRow-0--1")); - feedbackEditPage.clickRemoveMsqOptionLinkForNewQuestion(0); - assertTrue(feedbackEditPage.isElementPresent("msqOptionRow-0--1")); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little choices for Multiple-choice (multiple answers) question. Minimum number of options is: 2."); - - ______TS("select Add Other Option"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Msq with other option"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - assertTrue(feedbackEditPage.verifyNewMsqQuestionFormIsDisplayed()); - - assertTrue(feedbackEditPage.isElementPresent("msqOtherOptionFlag--1")); - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - assertTrue(feedbackEditPage.isElementSelected("msqOtherOptionFlag--1")); - feedbackEditPage.clickAddQuestionButton(); - - ______TS("Check that Max/Min selectable choices cannot be blank"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.fillMsqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMsqOptionForNewQuestion(1, "Choice 2"); - - feedbackEditPage.toggleMsqMaxSelectableChoices(NEW_QUESTION_INDEX); - feedbackEditPage.fillMsqMaxSelectableChoices(NEW_QUESTION_INDEX, ""); - assertFalse(feedbackEditPage.isInputElementValid( - feedbackEditPage.getMsqMaxSelectableChoicesBox(NEW_QUESTION_INDEX))); - feedbackEditPage.fillMsqMaxSelectableChoices(NEW_QUESTION_INDEX, "2"); - assertTrue(feedbackEditPage.isInputElementValid( - feedbackEditPage.getMsqMaxSelectableChoicesBox(NEW_QUESTION_INDEX))); - feedbackEditPage.toggleMsqMaxSelectableChoices(NEW_QUESTION_INDEX); - - feedbackEditPage.toggleMsqMinSelectableChoices(NEW_QUESTION_INDEX); - feedbackEditPage.fillMsqMinSelectableChoices(NEW_QUESTION_INDEX, ""); - assertFalse(feedbackEditPage.isInputElementValid( - feedbackEditPage.getMsqMinSelectableChoicesBox(NEW_QUESTION_INDEX))); - feedbackEditPage.fillMsqMinSelectableChoices(NEW_QUESTION_INDEX, "1"); - assertTrue(feedbackEditPage.isInputElementValid( - feedbackEditPage.getMsqMinSelectableChoicesBox(NEW_QUESTION_INDEX))); - feedbackEditPage.toggleMsqMinSelectableChoices(NEW_QUESTION_INDEX); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - } - - @Override - public void testCustomizeOptions() { - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - - feedbackEditPage.fillMsqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMsqOptionForNewQuestion(1, "Choice 2"); - - ______TS("MSQ: add msq option"); - - assertFalse(feedbackEditPage.isElementPresent("msqOptionRow-2--1")); - feedbackEditPage.clickAddMoreMsqOptionLinkForNewQuestion(); - assertTrue(feedbackEditPage.isElementPresent("msqOptionRow-2--1")); - - ______TS("MSQ: remove msq option"); - - feedbackEditPage.fillMsqOptionForNewQuestion(2, "Choice 3"); - assertTrue(feedbackEditPage.isElementPresent("msqOptionRow-1--1")); - feedbackEditPage.clickRemoveMsqOptionLinkForNewQuestion(1); - assertFalse(feedbackEditPage.isElementPresent("msqOptionRow-1--1")); - - ______TS("MSQ: add msq option after remove"); - - feedbackEditPage.clickAddMoreMsqOptionLinkForNewQuestion(); - assertTrue(feedbackEditPage.isElementPresent("msqOptionRow-3--1")); - feedbackEditPage.clickAddMoreMsqOptionLinkForNewQuestion(); - feedbackEditPage.fillMsqOptionForNewQuestion(4, "Choice 5"); - assertTrue(feedbackEditPage.isElementPresent("msqOptionRow-4--1")); - } - - @Override - public void testAddQuestionAction() throws Exception { - - ______TS("MSQ: add question action success"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("msq qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMsqQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - - ______TS("MSQ: edit question success"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("edited msq qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - assertTrue(feedbackEditPage.isElementPresent("msqOptionRow-0-1")); - feedbackEditPage.clickRemoveMsqOptionLink(0, 1); - assertFalse(feedbackEditPage.isElementPresent("msqOptionRow-0-1")); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMsqQuestionEditSuccess.html"); - - ______TS("MSQ: edit to generated options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("generated msq qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - assertTrue(feedbackEditPage.isElementVisible("msqAddOptionLink-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MSQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.NONE.toString()); - assertFalse(feedbackEditPage.isElementEnabled("msqGenerateForSelect-1")); - feedbackEditPage.clickGenerateMsqOptionsCheckbox(1); - assertTrue(feedbackEditPage.isElementEnabled("msqGenerateForSelect-1")); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MSQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.STUDENTS.toString()); - assertFalse(feedbackEditPage.isElementVisible("msqAddOptionLink-1")); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - assertFalse(feedbackEditPage.isElementPresent("msqOptionRow-0-1")); - assertFalse(feedbackEditPage.isElementEnabled("generateMsqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMsqOptionsCheckbox-1")); - assertFalse(feedbackEditPage.isElementEnabled("msqGenerateForSelect-1")); - feedbackEditPage.verifyFieldValue( - "msqGenerateForSelect-1", - FeedbackParticipantType.STUDENTS.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MSQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.STUDENTS.toString()); - - ______TS("MSQ: change generated type to students (excluding self)"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("generateMsqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMsqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementEnabled("msqGenerateForSelect-1")); - feedbackEditPage.selectMsqGenerateOptionsFor("students (excluding self)", 1); - feedbackEditPage.verifyFieldValue( - "msqGenerateForSelect-1", - FeedbackParticipantType.STUDENTS_EXCLUDING_SELF.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MSQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.STUDENTS_EXCLUDING_SELF.toString()); - - ______TS("MSQ: change generated type to teams"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("generateMsqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMsqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementEnabled("msqGenerateForSelect-1")); - feedbackEditPage.selectMsqGenerateOptionsFor("teams", 1); - feedbackEditPage.verifyFieldValue( - "msqGenerateForSelect-1", - FeedbackParticipantType.TEAMS.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MSQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.TEAMS.toString()); - - ______TS("MSQ: change generated type to teams (excluding self)"); - - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isElementEnabled("generateMsqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementSelected("generateMsqOptionsCheckbox-1")); - assertTrue(feedbackEditPage.isElementEnabled("msqGenerateForSelect-1")); - feedbackEditPage.selectMsqGenerateOptionsFor("teams (excluding self)", 1); - feedbackEditPage.verifyFieldValue( - "msqGenerateForSelect-1", - FeedbackParticipantType.TEAMS_EXCLUDING_SELF.toString()); - feedbackEditPage.verifyFieldValue( - Const.ParamsNames.FEEDBACK_QUESTION_MSQ_GENERATED_OPTIONS + "-1", - FeedbackParticipantType.TEAMS_EXCLUDING_SELF.toString()); - - ______TS("MSQ: min/max selectable options"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check min/max selectable restrictions for - // new MSQ question with custom options - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Custom options"); - feedbackEditPage.fillMsqOptionForNewQuestion(0, "A"); - feedbackEditPage.fillMsqOptionForNewQuestion(1, "B"); - feedbackEditPage.clickAddMoreMsqOptionLinkForNewQuestion(); - feedbackEditPage.clickAddMoreMsqOptionLinkForNewQuestion(); - feedbackEditPage.fillMsqOptionForNewQuestion(2, "C"); - feedbackEditPage.fillMsqOptionForNewQuestion(3, "D"); - checkMinMaxSelectableRestrictionForCustomOptions(-1); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - // Check min/max selectable restrictions for - // existing MSQ question with custom options - feedbackEditPage.clickEditQuestionButton(2); - checkMinMaxSelectableRestrictionForCustomOptions(2); - feedbackEditPage.clickDeleteQuestionLink(2); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - - // Check min/max selectable restrictions for new - // MSQ question with options generated from students - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Msq generated options"); - feedbackEditPage.clickGenerateMsqOptionsCheckbox(NEW_QUESTION_INDEX); - checkMinMaxSelectableRestrictionsForAllGenerateOptionSelections(-1); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - // Check min/max selectable restrictions for existing - // MSQ question with options generated from students - feedbackEditPage.clickEditQuestionButton(2); - checkMinMaxSelectableRestrictionsForAllGenerateOptionSelections(2); - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - } - - private void checkMinMaxSelectableRestrictionForCustomOptions(int qnNumber) { - // checking inputs after enabling maxSelectableChoices restriction - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - - int numOfOptions = feedbackEditPage.getNumOfMsqOptions(qnNumber); - int maxSelectableChoices = numOfOptions; - - // when maxSelectableChoices = numOfOptions and - // an option is removed, maxSelectableChoices should decrease - feedbackEditPage.fillMsqMaxSelectableChoices(qnNumber, String.valueOf(maxSelectableChoices)); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - feedbackEditPage.clickRemoveMsqOptionLink(0, qnNumber); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(--maxSelectableChoices, feedbackEditPage.getMsqMaxSelectableChoices(qnNumber)); - - // add an option back, maxSelectableChoices should remain same - feedbackEditPage.clickAddMoreMsqOptionLink(qnNumber); - feedbackEditPage.fillMsqOption(qnNumber, numOfOptions, "X"); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(maxSelectableChoices, feedbackEditPage.getMsqMaxSelectableChoices(qnNumber)); - - // enable minSelectableChoices restriction only - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.toggleMsqMinSelectableChoices(qnNumber); - - // check inputs after enabling minSelectableChoices - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - - int minSelectableChoices = numOfOptions; - - // when minSelectableChoices = numOfOptions and - // an option is removed, minSelectableChoices should decrease - feedbackEditPage.fillMsqMinSelectableChoices(qnNumber, String.valueOf(minSelectableChoices)); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - feedbackEditPage.clickRemoveMsqOptionLink(1, qnNumber); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(--minSelectableChoices, feedbackEditPage.getMsqMinSelectableChoices(qnNumber)); - - // add an option back, minSelectableChoices should remain same - feedbackEditPage.clickAddMoreMsqOptionLink(qnNumber); - feedbackEditPage.fillMsqOption(qnNumber, numOfOptions + 1, "Y"); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(minSelectableChoices, feedbackEditPage.getMsqMinSelectableChoices(qnNumber)); - - // enable minSelectableChoices and maxSelectableChoices - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - - // check inputs after enabling minSelectableChoices and maxSelectableChoices - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - - // if maxSelectableChoices = minSelectableChoices and - // maxSelectableChoices is decreased, minSelectableChoices should also decrease - feedbackEditPage.fillMsqMaxSelectableChoices(qnNumber, String.valueOf(--maxSelectableChoices)); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(--minSelectableChoices, feedbackEditPage.getMsqMinSelectableChoices(qnNumber)); - - // when minSelectableChoices = maxSelectableChoices = numOfOptions and an option - // is removed, both minSelectableChoices and maxSelectableChoices should decrease - maxSelectableChoices = numOfOptions; - minSelectableChoices = numOfOptions; - feedbackEditPage.fillMsqMaxSelectableChoices(qnNumber, String.valueOf(maxSelectableChoices)); - feedbackEditPage.fillMsqMinSelectableChoices(qnNumber, String.valueOf(minSelectableChoices)); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - feedbackEditPage.clickRemoveMsqOptionLink(2, qnNumber); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(--maxSelectableChoices, feedbackEditPage.getMsqMaxSelectableChoices(qnNumber)); - assertEquals(--minSelectableChoices, feedbackEditPage.getMsqMinSelectableChoices(qnNumber)); - - // add an option back, both minSelectableChoices and maxSelectableChoices should remain same - feedbackEditPage.clickAddMoreMsqOptionLink(qnNumber); - feedbackEditPage.fillMsqOption(qnNumber, numOfOptions + 2, "Z"); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(maxSelectableChoices, feedbackEditPage.getMsqMaxSelectableChoices(qnNumber)); - assertEquals(minSelectableChoices, feedbackEditPage.getMsqMinSelectableChoices(qnNumber)); - - // disable minSelectableChoices and maxSelectableChoices - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.toggleMsqMinSelectableChoices(qnNumber); - } - - /** - * Assumes student is already selected. - * @param qnNumber question number. - */ - private void checkMinMaxSelectableRestrictionsForAllGenerateOptionSelections(int qnNumber) { - // Check minSelectableChoices/maxSelectableChoices restrictions - // for MSQ question with options generated from students - checkMinMaxSelectableRestrictionForGeneratedOption(qnNumber); - - // Check minSelectableChoices/maxSelectableChoices - // restrictions for MSQ question with options generated from teams - feedbackEditPage.selectMsqGenerateOptionsFor("teams", qnNumber); - checkMinMaxSelectableRestrictionForGeneratedOption(qnNumber); - - // enable minSelectableChoices/maxSelectableChoices - // restrictions, change generated options for selection - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.toggleMsqMinSelectableChoices(qnNumber); - feedbackEditPage.selectMsqGenerateOptionsFor("students", qnNumber); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - - // disable minSelectableChoices and maxSelectableChoices - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.toggleMsqMinSelectableChoices(qnNumber); - } - - private void checkMinMaxSelectableRestrictionForGeneratedOption(int qnNumber) { - int numOfOptions = feedbackEditPage.getNumOfMsqOptions(qnNumber); - - // checking inputs after enabling maxSelectableChoices - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - - // enable minSelectableChoices restriction only - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.toggleMsqMinSelectableChoices(qnNumber); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - - // enable minSelectableChoices and maxSelectableChoices restrictions - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - - // check inputs after enabling minSelectableChoices and maxSelectableChoices - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - - // set maxSelectableChoices = numOfOptions and minSelectableChoices = numOfOptions, - // then decreasing maxSelectableChoices must decrease minSelectableChoices too - feedbackEditPage.fillMsqMaxSelectableChoices(qnNumber, String.valueOf(numOfOptions)); - feedbackEditPage.fillMsqMinSelectableChoices(qnNumber, String.valueOf(numOfOptions)); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - feedbackEditPage.fillMsqMaxSelectableChoices(qnNumber, String.valueOf(numOfOptions - 1)); - feedbackEditPage.verifyMsqMinMaxSelectableChoices(qnNumber); - assertEquals(numOfOptions - 1, feedbackEditPage.getMsqMinSelectableChoices(qnNumber)); - assertEquals(numOfOptions - 1, feedbackEditPage.getMsqMaxSelectableChoices(qnNumber)); - - // disable minSelectableChoices and maxSelectableChoices - feedbackEditPage.toggleMsqMaxSelectableChoices(qnNumber); - feedbackEditPage.toggleMsqMinSelectableChoices(qnNumber); - } - - @Override - public void testDeleteQuestionAction() { - - ______TS("MSQ: qn delete then cancel"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - ______TS("MSQ: qn delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - /** - * Tests that MSQ options (new and existing) can be reordered using drag and drop mechanism. - * @throws Exception when option is not draggable - */ - private void testReorderOptions() throws Exception { - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddMoreMsqOptionLinkForNewQuestion(); - feedbackEditPage.clickAddMoreMsqOptionLinkForNewQuestion(); - - feedbackEditPage.fillMsqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMsqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillMsqOptionForNewQuestion(2, "Choice 3"); - feedbackEditPage.fillMsqOptionForNewQuestion(3, "Choice 4"); - - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 0, "10"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 1, "20"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 2, "30"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 3, "40"); - - ______TS("MSQ: reorder existing options"); - - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, NEW_QUESTION_INDEX, 2, 0); - feedbackEditPage.clickAddQuestionButton(); - JSONObject msqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - msqQuestionDetails.get("msqChoices").toString()); - - ______TS("MSQ: add option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMsqOptionLink(1); - feedbackEditPage.fillMsqOption(1, 4, "New Choice"); - feedbackEditPage.fillMsqWeightBox(1, 4, "50"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - msqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"New Choice\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - msqQuestionDetails.get("msqChoices").toString()); - assertEquals("[30,50,10,20,40]", msqQuestionDetails.get("msqWeights").toString()); - - ______TS("MSQ: delete option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveMsqOptionLink(2, 1); - feedbackEditPage.fillMsqOption(1, 1, "Old Choice"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - msqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 4\",\"Old Choice\",\"Choice 2\"]", - msqQuestionDetails.get("msqChoices").toString()); - assertEquals("[30,40,50,20]", msqQuestionDetails.get("msqWeights").toString()); - - ______TS("MSQ: add, delete and reorder options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveMsqOptionLink(2, 1); - feedbackEditPage.clickAddMoreMsqOptionLink(1); - feedbackEditPage.clickAddMoreMsqOptionLink(1); - feedbackEditPage.fillMsqOption(1, 4, "New Choice"); - feedbackEditPage.fillMsqOption(1, 5, "Newer Choice"); - feedbackEditPage.fillMsqWeightBox(1, 4, "50"); - feedbackEditPage.fillMsqWeightBox(1, 5, "60"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 5, 0); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - msqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Newer Choice\",\"New Choice\",\"Choice 3\",\"Choice 4\",\"Choice 2\"]", - msqQuestionDetails.get("msqChoices").toString()); - assertEquals("[60,50,30,40,20]", msqQuestionDetails.get("msqWeights").toString()); - - ______TS("MSQ: weights should be reordered when checkbox is unticked"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMsqOptionLink(1); - feedbackEditPage.fillMsqOption(1, 5, "Newest Choice"); - feedbackEditPage.fillMsqWeightBox(1, 5, "70"); - feedbackEditPage.clickMsqHasAssignWeightsCheckbox(1); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 0); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 3, 1); - feedbackEditPage.clickMsqHasAssignWeightsCheckbox(1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - msqQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 2\",\"Choice 3\",\"Newer Choice\",\"New Choice\",\"Choice 4\",\"Newest Choice\"]", - msqQuestionDetails.get("msqChoices").toString()); - assertEquals("[20,30,60,50,40,70]", msqQuestionDetails.get("msqWeights").toString()); - - ______TS("MSQ: delete question"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMsqWeightsFeature_shouldToggleStateCorrectly() { - - ______TS("MSQ: Weight cells are visible when assigneWeights checkbox is clicked?"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - // Check if the MSQ weights column are visible or not. - assertTrue(feedbackEditPage.getMsqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - // Check the 'other' option is disabled and otherWeight cell is hidden - assertFalse(feedbackEditPage.isMsqOtherOptionCheckboxChecked(NEW_QUESTION_INDEX)); - assertFalse(feedbackEditPage.getMsqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - ______TS("MSQ: Other weight Cell is visible when other option and weights both are enabled"); - - // Check Assign MSQ weights Enabled but other option disabled - assertTrue(feedbackEditPage.isMsqHasAssignWeightCheckboxChecked(NEW_QUESTION_INDEX)); - assertFalse(feedbackEditPage.isMsqOtherOptionCheckboxChecked(NEW_QUESTION_INDEX)); - - // Assign Other option and test that other weight cell is displayed. - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - assertTrue(feedbackEditPage.getMsqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - // Uncheck checkboxes for consistency among other tests, - // otherwise these settings will persist after cancelling the question form - // Uncheck the 'Choices are weighted' checkbox. - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - assertFalse(feedbackEditPage.getMsqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - assertFalse(feedbackEditPage.getMsqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - - // Cancel question - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - @Test - public void testMsqWeightsFeature_shouldHaveCorrectDefaultValue() throws Exception { - - ______TS("MSQ: Weight cells are hidden by default"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - // Check if the 'Choices are weighted' checkbox unchecked by default. - assertFalse(feedbackEditPage.isMsqHasAssignWeightCheckboxChecked(NEW_QUESTION_INDEX)); - // Check if the MSQ weights column hidden by default - assertFalse(feedbackEditPage.getMsqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - assertFalse(feedbackEditPage.getMsqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - ______TS("MSQ: Check Msq weight default value"); - feedbackEditPage.fillQuestionTextBox("MSQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - - // Fill MSQ choices and check corresponding weight values - feedbackEditPage.fillMsqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.verifyFieldValue("msqWeight-0--1", "0"); - feedbackEditPage.fillMsqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.verifyFieldValue("msqWeight-1--1", "0"); - - // Verify MSQ other weight default value - feedbackEditPage.verifyFieldValue("msqOtherWeight--1", "0"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - // verify html page - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMsqQuestionWeightAddSuccess.html"); - - // Delete the question - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - @Test - public void testMsqWeightsFeature_shouldValidateFieldCorrectly() { - ______TS("MSQ: Test front-end validation for empty weights"); - // Add a question with valid weights to check front-end validation - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - feedbackEditPage.fillQuestionTextBox("MSQ weight front-end validation", NEW_QUESTION_INDEX); - feedbackEditPage.fillMsqOption(NEW_QUESTION_INDEX, 0, "Choice 1"); - feedbackEditPage.fillMsqOption(NEW_QUESTION_INDEX, 1, "Choice 2"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 0, "1"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 1, "2"); - feedbackEditPage.fillMsqOtherWeightBox(NEW_QUESTION_INDEX, "1"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - // Edit the question to enter invalid weight values - feedbackEditPage.clickEditQuestionButton(1); - - // Check validation for MSQ weight cells - feedbackEditPage.fillMsqWeightBox(1, 0, ""); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMsqWeightBoxFocused(1, 0)); - feedbackEditPage.fillMsqWeightBox(1, 0, "0"); - - // Check validation for empty other weight - feedbackEditPage.fillMsqOtherWeightBox(1, ""); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMsqOtherWeightBoxFocused(1)); - feedbackEditPage.fillMsqOtherWeightBox(1, "0"); - - // Check validation for the weight cells added by 'add option' button - feedbackEditPage.clickAddMoreMsqOptionLink(1); - assertTrue(feedbackEditPage.isElementPresent(By.id("msqWeight-2-1"))); - feedbackEditPage.fillMsqOption(1, 2, "Choice 3"); - feedbackEditPage.fillMsqWeightBox(1, 2, ""); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMsqWeightBoxFocused(1, 2)); - feedbackEditPage.clickRemoveMsqOptionLink(2, 1); - feedbackEditPage.clickDiscardChangesLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - ______TS("Test front-end validation for negative weights"); - feedbackEditPage.clickEditQuestionButton(1); - // Check validation for Msq weight box - feedbackEditPage.fillMsqWeightBox(1, 0, "-2"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.isMsqWeightBoxFocused(1, 0); - feedbackEditPage.fillMsqWeightBox(1, 0, "2"); - - // Check validation for other weight - feedbackEditPage.fillMsqOtherWeightBox(1, "-3"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.isMsqOtherWeightBoxFocused(1); - feedbackEditPage.fillMsqOtherWeightBox(1, "2"); - - // Check validation for weight cells added by 'Add Option' button - feedbackEditPage.clickAddMoreMsqOptionLink(1); - assertTrue(feedbackEditPage.isElementPresent(By.id("msqWeight-2-1"))); - feedbackEditPage.fillMsqOption(1, 2, "Choice 3"); - feedbackEditPage.fillMsqWeightBox(1, 2, "-5"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - assertTrue(feedbackEditPage.isMsqWeightBoxFocused(1, 2)); - feedbackEditPage.clickRemoveMsqOptionLink(2, 1); - - // Delete the question. - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMsqWeightsFeature_shouldAddWeightsCorrectly() throws Exception { - ______TS("Success: Add weights"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBox("MSQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - - // Fill MSQ choices and corresponding weight values - feedbackEditPage.fillMsqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 0, "1"); - feedbackEditPage.fillMsqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 1, "2"); - feedbackEditPage.fillMsqOtherWeightBox(NEW_QUESTION_INDEX, "3"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - FeedbackQuestionAttributes question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - assertNotNull(question); - - // Check that weights have been added correctly - FeedbackMsqQuestionDetails questionDetails = (FeedbackMsqQuestionDetails) question.getQuestionDetails(); - List msqWeights = questionDetails.getMsqWeights(); - assertEquals(2, msqWeights.size()); - assertEquals(1.0, msqWeights.get(0)); - assertEquals(2.0, msqWeights.get(1)); - assertEquals(3.0, questionDetails.getMsqOtherWeight()); - - ______TS("MSQ: Add more weights"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMsqOptionLink(1); - assertTrue(feedbackEditPage.isElementPresent("msqOption-2-1")); - assertTrue(feedbackEditPage.isElementPresent("msqWeight-2-1")); - feedbackEditPage.fillMsqOption(1, 2, "Choice 3"); - feedbackEditPage.fillMsqWeightBox(1, 2, "4"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check that weights have been added correctly - question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - questionDetails = (FeedbackMsqQuestionDetails) question.getQuestionDetails(); - msqWeights = questionDetails.getMsqWeights(); - assertEquals(3, msqWeights.size()); - assertEquals(4.0, msqWeights.get(2)); - - ______TS("MSQ: Failed to add weight due to invalid choice value"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreMsqOptionLink(1); - - // Test for choice that has only spaces - assertTrue(feedbackEditPage.isElementPresent("msqOption-3-1")); - assertTrue(feedbackEditPage.isElementPresent("msqWeight-3-1")); - feedbackEditPage.fillMsqOption(1, 3, " "); // Choices with only spaces - feedbackEditPage.fillMsqWeightBox(1, 3, "5"); - - // The question form removes invalid choices, - // So, the corresponding weights should be removed as well, without throwing an error. - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check that the invalid choice and the corresponding weight cell is removed from the question. - assertFalse(feedbackEditPage.isElementPresent("msqOption-3-1")); - assertFalse(feedbackEditPage.isElementPresent("msqWeight-3-1")); - - // Check that weight has not been added to the question. - question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - questionDetails = (FeedbackMsqQuestionDetails) question.getQuestionDetails(); - msqWeights = questionDetails.getMsqWeights(); - // Size of weight list should remain 3 as weight has not been added. - assertEquals(3, msqWeights.size()); - - // Delete the question. - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMsqWeightsFeature_shouldEditWeightsCorrectly() throws Exception { - // Add a question to test edit weight feature. - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBox("MSQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - - // Fill MSQ choices and check corresponding weight values - feedbackEditPage.fillMsqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 0, "1"); - feedbackEditPage.fillMsqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillMsqWeightBox(NEW_QUESTION_INDEX, 1, "2"); - feedbackEditPage.fillMsqOtherWeightBox(NEW_QUESTION_INDEX, "3"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - ______TS("MSQ: Edit weights success"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillMsqWeightBox(1, 0, "1.55"); - feedbackEditPage.fillMsqWeightBox(1, 1, "2.77"); - feedbackEditPage.fillMsqOtherWeightBox(1, "3.66"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // verify weights for the question - feedbackEditPage.verifyFieldValue("msqWeight-0-1", "1.55"); - feedbackEditPage.verifyFieldValue("msqWeight-1-1", "2.77"); - feedbackEditPage.verifyFieldValue("msqOtherWeight-1", "3.66"); - - // verify html page - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackMsqQuestionWeightEditSuccess.html"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test - public void testMsqWeightsFeature_shouldNotHaveWeightsForGenerateOptions() { - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MSQ"); - feedbackEditPage.fillQuestionTextBox("MSQ weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickMsqAssignWeightCheckboxForNewQuestion(); - feedbackEditPage.clickAddMsqOtherOptionCheckboxForNewQuestion(); - - ______TS("MSQ: Test that selecting generated option hides msq weights cells and checkbox"); - // Test visibility of msq weights and checkbox before selecting msq generated option. - assertTrue(feedbackEditPage.getMsqHasAssignWeightsCheckbox(NEW_QUESTION_INDEX).isDisplayed()); - assertTrue(feedbackEditPage.getMsqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - assertTrue(feedbackEditPage.getMsqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - feedbackEditPage.clickGenerateMsqOptionsCheckbox(NEW_QUESTION_INDEX); - - // Check that 'choices are weighted' checkbox is hidden - assertFalse(feedbackEditPage.getMsqHasAssignWeightsCheckbox(NEW_QUESTION_INDEX).isDisplayed()); - assertFalse(feedbackEditPage.getMsqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); - assertFalse(feedbackEditPage.getMsqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - ______TS("MSQ: Test msq weight have default values after edit to generated options"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickGenerateMsqOptionsCheckbox(1); // Uncheck the generated option checkbox - - // Check that weight fields are again visible after unchecking generated option, - // and also check that all the fields have the default values stored. - assertFalse(feedbackEditPage.isMsqHasAssignWeightCheckboxChecked(1)); - assertFalse(feedbackEditPage.isMsqOtherOptionCheckboxChecked(1)); - - // Add One option and check MSQ assign weight checkbox to check the msq weight field value. - feedbackEditPage.clickAddMoreMsqOptionLink(1); - feedbackEditPage.clickMsqHasAssignWeightsCheckbox(1); - assertTrue(feedbackEditPage.getMsqWeightBox(1, 0).isDisplayed()); - feedbackEditPage.verifyFieldValue("msqWeight-0-1", "0"); - - // Check the other option to test the value of other weight - feedbackEditPage.clickAddMsqOtherOptionCheckbox(1); - assertTrue(feedbackEditPage.getMsqOtherWeightBox(1).isDisplayed()); - feedbackEditPage.verifyFieldValue("msqOtherWeight-1", "0"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Test(priority = 1) - public void testMcqWeightsFeature_instructorResultsPageQuestionView_showStatistics() throws Exception { - - DataBundle msqWeightsTestData = loadDataBundle("/FeedbackSessionQuestionTypeTest.json"); - removeAndRestoreDataBundle(msqWeightsTestData); - // Create the Action URI for 'MCQ Weights Session' to show the result page. - AppUrl editUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_RESULTS_PAGE) - .withUserId("FSQTT.idOfInstructor1OfCourse1") - .withCourseId("FSQTT.idOfTypicalCourse1") - .withSessionName(msqWeightsTestData.feedbackSessions.get("msqSession").getFeedbackSessionName()) - .withParam(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, "question"); - - InstructorFeedbackResultsPage instructorResultsPage = - loginAdminToPageOld(editUrl, InstructorFeedbackResultsPage.class); - - ______TS("Show statistics for mcq question without weights enabled"); - - instructorResultsPage.clickShowStats(); - instructorResultsPage.loadResultQuestionPanel(1); - assertEquals(instructorResultsPage.showStatsCheckbox.getAttribute("checked"), "true"); - assertTrue(instructorResultsPage.verifyAllStatsVisibility()); - instructorResultsPage.verifyHtmlMainContent( - "/instructorFeedbackResultsPageMsqQuestionViewWithoutWeightsAttached.html"); - instructorResultsPage.clickShowStats(); // This will collapse the particular question 1 panel - - ______TS("Show statistics for MCQ question with weights attached"); - - instructorResultsPage.clickShowStats(); - instructorResultsPage.loadResultQuestionPanel(3); - assertEquals(instructorResultsPage.showStatsCheckbox.getAttribute("checked"), "true"); - assertTrue(instructorResultsPage.verifyAllStatsVisibility()); - instructorResultsPage.verifyHtmlMainContent( - "/instructorFeedbackResultsPageMsqQuestionViewWithWeightsAttached.html"); - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackNumScaleQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackNumScaleQuestionUiTest.java deleted file mode 100644 index a5b2485a8fc..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackNumScaleQuestionUiTest.java +++ /dev/null @@ -1,206 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorFeedbackEditPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for numerical scale questions. - */ -public class FeedbackNumScaleQuestionUiTest extends BaseFeedbackQuestionUiTest { - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackNumScaleQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @BeforeClass - public void classSetup() { - feedbackEditPage = getFeedbackEditPage(instructorId, courseId, feedbackSessionName); - } - - @Test - public void allTests() throws Exception { - testEditPage(); - - //TODO: move/create other NumScale question related UI tests here. - //i.e. results page, submit page. - } - - private void testEditPage() throws Exception { - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - } - - @Override - public void testNewQuestionFrame() { - ______TS("NUMSCALE: new question (frame) link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("NUMSCALE"); - - assertTrue(feedbackEditPage.verifyNewNumScaleQuestionFormIsDisplayed()); - } - - @Override - public void testInputValidation() { - - ______TS("empty options"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("NumScale qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.fillMinNumScaleBoxForNewQuestion(""); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion(""); - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion(""); - - assertEquals("[Please enter valid numbers for all the options.]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEqualsErrorTexts( - "Please enter valid options. The min/max/step cannot be empty."); - - ______TS("invalid options"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("NumScale qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.fillMinNumScaleBoxForNewQuestion("1"); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion("0.3"); - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion("5"); - - assertEquals("[The interval 1 - 5 is not divisible by the specified increment.]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEqualsErrorTexts( - "Please enter valid options. The interval is not divisible by the specified increment."); - - ______TS("possible floating point error"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("NumScale qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.fillMinNumScaleBoxForNewQuestion("1"); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion("0.001"); - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion("5555"); - - assertEquals("[Based on the above settings, acceptable responses are: 1, 1.001, 1.002, ..., " - + "5554.998, 5554.999, 5555]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - - ______TS("more than three dp step rounding test"); - - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion("1002"); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion("1.00123456789"); - - assertEquals("[Based on the above settings, acceptable responses are: 1, 2.001, 3.002, ..., " - + "999.998, 1000.999, 1002]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - - ______TS("NUMSCALE: min >= max test"); - //Tests javascript that automatically makes max = min+1 when max is <= min. - feedbackEditPage.fillMinNumScaleBoxForNewQuestion(1); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion(1); - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion(5); - assertEquals("[Based on the above settings, acceptable responses are: 1, 2, 3, 4, 5]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - - feedbackEditPage.fillMinNumScaleBoxForNewQuestion(6); - assertEquals("7", feedbackEditPage.getMaxNumScaleBoxForNewQuestion()); - - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion(6); - assertEquals("7", feedbackEditPage.getMaxNumScaleBoxForNewQuestion()); - - //Reset values - feedbackEditPage.fillMinNumScaleBoxForNewQuestion(1); - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion(5); - } - - @Override - public void testCustomizeOptions() { - feedbackEditPage.fillQuestionTextBoxForNewQuestion("NumScale qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - assertEquals("[Based on the above settings, acceptable responses are: 1, 2, 3, 4, 5]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion(0.3); - assertEquals("[The interval 1 - 5 is not divisible by the specified increment.]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - feedbackEditPage.fillMinNumScaleBoxForNewQuestion(5); - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion(6); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion(0.001); - assertEquals("[Based on the above settings, acceptable responses are: 5, 5.001, 5.002, ..., 5.998, 5.999, 6]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - feedbackEditPage.fillMinNumScaleBoxForNewQuestion(0); - feedbackEditPage.fillMaxNumScaleBoxForNewQuestion(1); - feedbackEditPage.fillStepNumScaleBoxForNewQuestion(0.1); - assertEquals("[Based on the above settings, acceptable responses are: 0, 0.1, 0.2, ..., 0.8, 0.9, 1]", - feedbackEditPage.getNumScalePossibleValuesStringForNewQuestion()); - } - - @Override - public void testAddQuestionAction() throws Exception { - ______TS("NUMSCALE: add question action success"); - - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackNumScaleQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - ______TS("NUMSCALE: edit question success"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("edited numscale qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - feedbackEditPage.fillMinNumScaleBox(3, 1); - feedbackEditPage.fillMaxNumScaleBox(4, 1); - feedbackEditPage.fillStepNumScaleBox(0.002, 1); - assertEquals("[Based on the above settings, acceptable responses are: 3, 3.002, 3.004, ..., 3.996, 3.998, 4]", - feedbackEditPage.getNumScalePossibleValuesString(1)); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackNumScaleQuestionEditSuccess.html"); - } - - @Override - public void testDeleteQuestionAction() { - ______TS("NUMSCALE: qn delete then cancel"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - ______TS("NUMSCALE: qn delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackRankQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackRankQuestionUiTest.java deleted file mode 100644 index 562c4fda5f6..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackRankQuestionUiTest.java +++ /dev/null @@ -1,752 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.json.JSONObject; -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.questions.FeedbackRankOptionsQuestionDetails; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.FeedbackSubmitPage; -import teammates.test.pageobjects.InstructorFeedbackEditPage; -import teammates.test.pageobjects.InstructorFeedbackResultsPage; -import teammates.test.pageobjects.StudentFeedbackResultsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for rank questions. - * TODO: Backend validation. Blocked by #8646 - */ -public class FeedbackRankQuestionUiTest extends BaseFeedbackQuestionUiTest { - - private static final int NEW_QUESTION_INDEX = -1; - private static final String QN_TYPE = "rank"; - - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackRankQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("edit").getFeedbackSessionName(); - } - - @Test - public void testStudentSubmitAndResultsPages() throws Exception { - ______TS("Rank submission: input disabled for closed session"); - - FeedbackSubmitPage submitPage = loginToStudentFeedbackSubmitPage("alice.tmms@FRankUiT.CS4221", "closed"); - submitPage.waitForAndDismissAlertModal(); - assertTrue(submitPage.isElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-1-0-0")); - assertFalse(submitPage.isElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-1-0-0")); - ______TS("Rank submission"); - - submitPage = loginToStudentFeedbackSubmitPage("alice.tmms@FRankUiT.CS4221", "student"); - - // verifies that question submit form without existing responses loads correctly - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageRank.html"); - - submitPage.selectResponseTextDropdown(1, 0, 0, "1"); - submitPage.selectResponseTextDropdown(1, 0, 1, "2"); - - // to check if deleting responses work - submitPage.selectResponseTextDropdown(1, 1, 1, ""); - assertEquals("Please rank the above options.", submitPage.getRankMessage(1, 1)); - - submitPage.selectResponseTextDropdown(2, 0, 0, "1"); - submitPage.selectResponseTextDropdown(2, 1, 0, "2"); - - // test rank messages - assertEquals("Please rank the above recipients.", submitPage.getRankMessage(5, 3)); - submitPage.selectResponseTextDropdown(5, 0, 0, "2"); - assertTrue(submitPage.getRankMessage(5, 0).isEmpty()); - submitPage.selectResponseTextDropdown(5, 1, 0, "2"); - assertEquals("The same rank should not be given multiple times.", submitPage.getRankMessage(5, 3)); - - // try to submit with error - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals("Please fix the error(s) for rank question(s) 5. " - + "To skip a rank question, leave all the boxes blank."); - - submitPage.selectResponseTextDropdown(5, 1, 0, "1"); - assertEquals("Please rank the above recipients.", submitPage.getRankMessage(5, 3)); - - // Submit - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "4, 6, 7, 8, 9, 10, 11, 12, 13, 14."); - - FeedbackQuestionAttributes fq1 = BackDoor.getFeedbackQuestion("FRankUiT.CS4221", "Student Session", 1); - assertNotNull(BackDoor.getFeedbackResponse(fq1.getId(), - "alice.b.tmms@gmail.tmt", - "tmms.helper1@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fq1.getId(), - "alice.b.tmms@gmail.tmt", - "tmms.test@gmail.tmt")); - - FeedbackQuestionAttributes fq2 = BackDoor.getFeedbackQuestion("FRankUiT.CS4221", "Student Session", 2); - assertNotNull(BackDoor.getFeedbackResponse(fq2.getId(), - "alice.b.tmms@gmail.tmt", - "tmms.helper1@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse(fq2.getId(), - "alice.b.tmms@gmail.tmt", - "tmms.test@gmail.tmt")); - - // Go back to submission page and verify html - submitPage = loginToStudentFeedbackSubmitPage("alice.tmms@FRankUiT.CS4221", "student"); - - // try to submit duplicate ranks for question that permits it - submitPage.selectResponseTextDropdown(6, 0, 0, "1"); - submitPage.selectResponseTextDropdown(6, 1, 0, "1"); - assertTrue("No error message expected", submitPage.getRankMessage(6, 0).isEmpty()); - - submitPage.selectResponseTextDropdown(1, 0, 0, "3"); - assertEquals("The display message indicating this is a rank question is displayed until all options are ranked", - "Please rank the above options.", submitPage.getRankMessage(1, 0)); - submitPage.selectResponseTextDropdown(1, 0, 1, "3"); - submitPage.selectResponseTextDropdown(1, 0, 2, "1"); - submitPage.selectResponseTextDropdown(1, 0, 3, "4"); - assertTrue("No error message expected", submitPage.getRankMessage(1, 0).isEmpty()); - - submitPage.selectResponseTextDropdown(7, 0, 0, "4"); - submitPage.selectResponseTextDropdown(7, 0, 1, "3"); - submitPage.selectResponseTextDropdown(7, 0, 2, "2"); - submitPage.selectResponseTextDropdown(7, 0, 3, "1"); - assertTrue("No error message expected", submitPage.getRankMessage(7, 0).isEmpty()); - - submitPage.clickSubmitButton(); - // Go back to submission page - submitPage = loginToStudentFeedbackSubmitPage("alice.tmms@FRankUiT.CS4221", "student"); - // to verify that the question submit form with existing response works correctly - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageSuccessRank.html"); - - ______TS("Rank : min/max options to be ranked test"); - - // Question with only min options to be ranked restriction - int qnNumber = 8; - submitPage.selectResponseTextDropdown(qnNumber, 0, 0, "1"); - assertEquals("You need to rank at least 2 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 2, "2"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 0).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 0, 2, ""); - assertEquals("You need to rank at least 2 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 3, "3"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 0).isEmpty()); - - // Question with only max options to be ranked restriction - qnNumber = 9; - submitPage.selectResponseTextDropdown(qnNumber, 0, 0, "1"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 0).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 0, 2, "2"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 0).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 0, 3, "3"); - assertEquals("Rank no more than 2 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 3, ""); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 0).isEmpty()); - - // Question with both min and max options to be ranked restriction - qnNumber = 10; - submitPage.selectResponseTextDropdown(qnNumber, 0, 0, "1"); - assertEquals("You need to rank at least 3 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 2, "2"); - assertEquals("You need to rank at least 3 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 4, "4"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 0).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 0, 1, "3"); - assertEquals("Rank no more than 3 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 3, "5"); - assertEquals("Rank no more than 3 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 3, ""); - assertEquals("Rank no more than 3 options.", submitPage.getRankMessage(qnNumber, 0)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 1, ""); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 0).isEmpty()); - - ______TS("Rank : min/max recipients to be ranked test"); - - // Question with only min recipients to be ranked restriction - qnNumber = 11; - submitPage.selectResponseTextDropdown(qnNumber, 0, 0, "1"); - assertEquals("You need to rank at least 2 recipients.", submitPage.getRankMessage(qnNumber, 3)); - submitPage.selectResponseTextDropdown(qnNumber, 2, 0, "2"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 3).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 2, 0, ""); - assertEquals("You need to rank at least 2 recipients.", submitPage.getRankMessage(qnNumber, 3)); - submitPage.selectResponseTextDropdown(qnNumber, 3, 0, "3"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 3).isEmpty()); - - // Question with only max recipients to be ranked restriction - qnNumber = 12; - submitPage.selectResponseTextDropdown(qnNumber, 0, 0, "1"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 3).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 2, 0, "2"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 3).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 3, 0, "3"); - assertEquals("Rank no more than 2 recipients.", submitPage.getRankMessage(qnNumber, 3)); - submitPage.selectResponseTextDropdown(qnNumber, 3, 0, ""); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 3).isEmpty()); - - // Question with both min and max options to be ranked restriction - qnNumber = 13; - submitPage.selectResponseTextDropdown(qnNumber, 0, 0, "1"); - assertEquals("You need to rank at least 3 recipients.", submitPage.getRankMessage(qnNumber, 3)); - submitPage.selectResponseTextDropdown(qnNumber, 1, 0, "2"); - assertEquals("You need to rank at least 3 recipients.", submitPage.getRankMessage(qnNumber, 3)); - submitPage.selectResponseTextDropdown(qnNumber, 2, 0, "3"); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 3).isEmpty()); - submitPage.selectResponseTextDropdown(qnNumber, 3, 0, "4"); - assertEquals("Rank no more than 3 recipients.", submitPage.getRankMessage(qnNumber, 3)); - submitPage.selectResponseTextDropdown(qnNumber, 0, 0, ""); - assertTrue("No error message expected", submitPage.getRankMessage(qnNumber, 3).isEmpty()); - - ______TS("Rank : student results"); - - StudentFeedbackResultsPage studentResultsPage = - loginToStudentFeedbackResultsPage("alice.tmms@FRankUiT.CS4221", "student"); - studentResultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageRank.html"); - - } - - @Test - public void testInstructorSubmitAndResultsPage() throws Exception { - - ______TS("Rank submission: input disabled for closed session"); - - FeedbackSubmitPage submitPage = loginToInstructorFeedbackSubmitPage("instructor1", "closed"); - int qnNumber = 1; - int responseNumber = 0; - int rowNumber = 0; - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_QUESTION_RANKOPTION + "-" - + qnNumber + "-" + responseNumber + "-" + rowNumber)); - - ______TS("Rank submission: test submission page if some students are not visible to the instructor"); - submitPage = loginToInstructorFeedbackSubmitPage("instructorhelper", "instructor"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageRankHelper.html"); - - ______TS("Rank standard submission"); - - submitPage = loginToInstructorFeedbackSubmitPage("instructor1", "instructor"); - submitPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRankSubmission.html"); - - submitPage.selectResponseTextDropdown(1, 0, 2, "2"); - submitPage.selectResponseTextDropdown(1, 0, 1, "1"); - submitPage.selectResponseTextDropdown(1, 0, 0, "3"); - assertTrue(submitPage.getRankMessage(1, 0).isEmpty()); - - submitPage.selectRecipient(2, 0, "Emily F."); - submitPage.selectResponseTextDropdown(2, 0, 13, "1"); - submitPage.selectResponseTextDropdown(2, 0, 1, "2"); - - submitPage.selectRecipient(2, 1, "Alice Betsy'\""); - submitPage.selectResponseTextDropdown(2, 1, 11, "1"); - submitPage.selectResponseTextDropdown(2, 1, 1, "1"); - assertEquals("Testing duplicate rank for rank options", - "The same rank should not be given multiple times.", submitPage.getRankMessage(2, 1)); - submitPage.selectResponseTextDropdown(2, 1, 1, "2"); - - submitPage.selectResponseTextDropdown(3, 0, 0, "1"); - submitPage.selectResponseTextDropdown(3, 3, 0, "2"); - - submitPage.clickSubmitButton(); - - ______TS("Rank instructor results : question"); - - InstructorFeedbackResultsPage instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("instructor1", "instructor", false, "question"); - instructorResultsPage.loadResultQuestionPanel(1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRankQuestionView.html"); - - ______TS("Rank instructor results : Giver > Recipient > Question"); - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("instructor1", "instructor", false, - "giver-recipient-question"); - instructorResultsPage.loadResultSectionPanel(1, 2); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRankGRQView.html"); - - ______TS("Rank instructor results : Giver > Question > Recipient"); - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("instructor1", "instructor", false, - "giver-question-recipient"); - instructorResultsPage.loadResultSectionPanel(1, 2); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRankGQRView.html"); - - ______TS("Rank instructor results : Recipient > Question > Giver "); - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("instructor1", "instructor", false, - "recipient-question-giver"); - instructorResultsPage.loadResultSectionPanel(0, 1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRankRQGView.html"); - - ______TS("Rank instructor results : Recipient > Giver > Question"); - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("instructor1", "instructor", false, - "recipient-giver-question"); - instructorResultsPage.loadResultSectionPanel(0, 1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRankRGQView.html"); - } - - @Test - public void testInstructorResultsPageForRankRecipientQuestion() throws Exception { - ______TS("Rank recipient instructor results : question"); - - InstructorFeedbackResultsPage instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("instructor1", "student", false, null); - instructorResultsPage.loadResultQuestionPanel(3); - instructorResultsPage.loadResultQuestionPanel(9); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRankRecipient.html"); - } - - @Test - public void testEditPage() throws Exception { - feedbackEditPage = getFeedbackEditPage(); - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - testReorderOptions(); - } - - @Override - public void testNewQuestionFrame() { - testNewRankRecipientsQuestionFrame(); - feedbackEditPage.reloadPage(); - testNewRankOptionsQuestionFrame(); - } - - private void testNewRankRecipientsQuestionFrame() { - ______TS("Rank recipients: new question (frame)"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_RECIPIENTS"); - assertTrue(feedbackEditPage.verifyNewRankRecipientsQuestionFormIsDisplayed()); - } - - private void testNewRankOptionsQuestionFrame() { - ______TS("Rank options: new question (frame)"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_OPTIONS"); - assertTrue(feedbackEditPage.verifyNewRankOptionsQuestionFormIsDisplayed()); - } - - @Override - public void testInputValidation() { - - ______TS("Rank edit: empty question text"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); - } - - @Override - public void testCustomizeOptions() { - // todo - } - - @Override - public void testAddQuestionAction() throws Exception { - ______TS("Rank edit: add rank option question action success"); - - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Rank qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.fillRankOptionForNewQuestion(0, "Option 1 <>"); - - assertEquals(2, feedbackEditPage.getNumOfOptionsInRankOptionsForNewQuestion()); - // try to submit with insufficient non-blank option - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - FeedbackRankOptionsQuestionDetails.ERROR_NOT_ENOUGH_OPTIONS - + FeedbackRankOptionsQuestionDetails.MIN_NUM_OF_OPTIONS + "."); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_OPTIONS"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Rank qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - - // blank option at the start and end, to check they are removed - feedbackEditPage.clickAddMoreRankOptionLinkForNewQuestion(); - feedbackEditPage.fillRankOptionForNewQuestion(1, "Option 1 <>"); - feedbackEditPage.fillRankOptionForNewQuestion(2, " Option 2 "); - feedbackEditPage.clickAddMoreRankOptionLinkForNewQuestion(); - assertEquals(4, feedbackEditPage.getNumOfOptionsInRankOptionsForNewQuestion()); - - feedbackEditPage.tickDuplicatesAllowedCheckboxForNewQuestion(); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - assertEquals("Blank options should have been removed", 2, feedbackEditPage.getNumOfOptionsInRankOptions(1)); - - ______TS("Rank edit: Invalid empty input in number of options a respondent must rank"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_OPTIONS"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("filled qn"); - feedbackEditPage.fillRankOptionForNewQuestion(0, "Option 1"); - feedbackEditPage.fillRankOptionForNewQuestion(1, "Option 2"); - - feedbackEditPage.clickEnableMinRankOptions(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - feedbackEditPage.clickMinRankOptions(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - feedbackEditPage.clearMinRankOptions(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - - WebElement minOptionsInputElement = - feedbackEditPage.getMinOptionsToBeRankedInputElement(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - - assertFalse(feedbackEditPage.isInputElementValid(minOptionsInputElement)); - - ______TS("Rank edit: Invalid letters in number of options a respondent must rank"); - feedbackEditPage.fillMinOptionsToBeRanked(InstructorFeedbackEditPage.NEW_QUESTION_NUM, "1"); - assertTrue(feedbackEditPage.isInputElementValid(minOptionsInputElement)); - - feedbackEditPage.fillMinOptionsToBeRanked(InstructorFeedbackEditPage.NEW_QUESTION_NUM, "invalid letters"); - assertFalse(feedbackEditPage.isInputElementValid(minOptionsInputElement)); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - ______TS("Rank edit: Auto fill with 1 in number of options a respondent must rank success"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_OPTIONS"); - - // Ensure that rank options is cleared. - feedbackEditPage.clickMinRankOptions(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - feedbackEditPage.clearMinRankOptions(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - - // Unchecks and check to auto-fill with 1 - feedbackEditPage.clickEnableMinRankOptions(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - feedbackEditPage.clickEnableMinRankOptions(InstructorFeedbackEditPage.NEW_QUESTION_NUM); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - feedbackEditPage.clickDeleteQuestionLink(2); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - ______TS("Rank edit: add rank recipient question action success"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_RECIPIENTS"); - - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 2)); - - feedbackEditPage.verifyRankOptionIsHiddenForNewQuestion(0); - feedbackEditPage.verifyRankOptionIsHiddenForNewQuestion(1); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Rank recipients qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 2)); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRankQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - ______TS("rank edit: edit rank options question success"); - feedbackEditPage.clickEditQuestionButton(1); - - // Verify that fields are editable - feedbackEditPage.verifyHtmlPart(By.id("questionTable-1"), - "/instructorFeedbackRankQuestionEdit.html"); - - feedbackEditPage.fillQuestionTextBox("edited Rank qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - - feedbackEditPage.clickRemoveRankOptionLink(1, 0); - assertEquals("Should still remain with 2 options," - + "less than 2 options should not be permitted", - 2, feedbackEditPage.getNumOfOptionsInRankOptions(1)); - - feedbackEditPage.fillRankOption(1, 1, " (Edited) Option 2 "); - - // Should end up with 4 choices, including (1) and (2) - feedbackEditPage.clickAddMoreRankOptionLink(1); - feedbackEditPage.clickAddMoreRankOptionLink(1); - feedbackEditPage.fillRankOption(1, 2, " Option 3 "); - feedbackEditPage.fillRankOption(1, 3, "Option 4 (slightly longer text for this one)"); - - feedbackEditPage.untickDuplicatesAllowedCheckbox(1); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRankQuestionEditSuccess.html"); - - ______TS("rank edit: edit rank recipients question success"); - feedbackEditPage.clickEditQuestionButton(2); - - feedbackEditPage.tickDuplicatesAllowedCheckbox(2); - feedbackEditPage.clickSaveExistingQuestionButton(2); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - assertTrue(feedbackEditPage.isRankDuplicatesAllowedChecked(2)); - - ______TS("Rank options: test min/max restrictions"); - - int qNum = 1; - feedbackEditPage.clickEditQuestionButton(qNum); - - // ticking "Maximum number of options a respondent must rank" checkbox only, - // should enable the maxOptionsToBeRanked input field only, with correct attributes - feedbackEditPage.toggleMaxOptionsToBeRankedCheckbox(qNum); - assertTrue(feedbackEditPage.isMaxOptionsToBeRankedEnabled(qNum)); - assertFalse(feedbackEditPage.isMinOptionsToBeRankedEnabled(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // ticking "Minimum number of options a respondent must rank" checkbox only, - // should enable the minOptionsToBeRanked input field only, with correct attributes - feedbackEditPage.toggleMaxOptionsToBeRankedCheckbox(qNum); - feedbackEditPage.toggleMinOptionsToBeRankedCheckbox(qNum); - assertTrue(feedbackEditPage.isMinOptionsToBeRankedEnabled(qNum)); - assertFalse(feedbackEditPage.isMaxOptionsToBeRankedEnabled(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // ticking both "Minimum number of options a respondent must rank" checkbox and - // "Maximum number of options a respondent must rank" checkbox must enable both - // minOptionsToBeRanked and maxOptionsToBeRanked input fields, with correct attributes - feedbackEditPage.toggleMaxOptionsToBeRankedCheckbox(qNum); - assertTrue(feedbackEditPage.isMinOptionsToBeRankedEnabled(qNum)); - assertTrue(feedbackEditPage.isMaxOptionsToBeRankedEnabled(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // when maxOptionsToBeRanked = minOptionsToBeRanked, - // decreasing maxOptionsToBeRanked must decrease minOptionsToBeRanked too - feedbackEditPage.fillMaxOptionsToBeRanked(qNum, "3"); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - feedbackEditPage.fillMinOptionsToBeRanked(qNum, "3"); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - feedbackEditPage.fillMaxOptionsToBeRanked(qNum, "2"); - assertEquals(2, feedbackEditPage.getMinOptionsToBeRanked(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // when maxOptionsToBeRanked = minOptionsToBeRanked, - // increasing minOptionsToBeRanked must increase maxOptionsToBeRanked too - feedbackEditPage.fillMaxOptionsToBeRanked(qNum, "2"); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - feedbackEditPage.fillMinOptionsToBeRanked(qNum, "2"); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - feedbackEditPage.fillMinOptionsToBeRanked(qNum, "3"); - assertEquals(3, feedbackEditPage.getMaxOptionsToBeRanked(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // when maxOptionsToBeRanked = numOfOptions and maxOptionsToBeRanked = minOptionsToBeRanked, - // removing an option must decrease maxOptionsToBeRanked and minOptionsToBeRanked - feedbackEditPage.clickAddMoreRankOptionLink(qNum); - feedbackEditPage.fillMaxOptionsToBeRanked(qNum, "4"); - feedbackEditPage.fillMinOptionsToBeRanked(qNum, "4"); - feedbackEditPage.clickRemoveRankOptionLink(qNum, 3); - assertEquals(3, feedbackEditPage.getMaxOptionsToBeRanked(qNum)); - assertEquals(3, feedbackEditPage.getMinOptionsToBeRanked(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - feedbackEditPage.clickSaveExistingQuestionButton(qNum); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - ______TS("Rank recipients: test min/max restrictions"); - qNum = 2; - - feedbackEditPage.clickEditQuestionButton(qNum); - feedbackEditPage.enableOtherFeedbackPathOptions(qNum); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, qNum); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.INSTRUCTORS, qNum); // There are 2 instructors - - // ticking "Maximum number of options a respondent must rank" checkbox only, - // should enable the maxOptionsToBeRanked input field only, with correct attributes - feedbackEditPage.toggleMaxOptionsToBeRankedCheckbox(qNum); - assertTrue(feedbackEditPage.isMaxOptionsToBeRankedEnabled(qNum)); - assertFalse(feedbackEditPage.isMinOptionsToBeRankedEnabled(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // ticking "Minimum number of options a respondent must rank" checkbox only, - // should enable the minOptionsToBeRanked input field only, with correct attributes - feedbackEditPage.toggleMaxOptionsToBeRankedCheckbox(qNum); - feedbackEditPage.toggleMinOptionsToBeRankedCheckbox(qNum); - assertTrue(feedbackEditPage.isMinOptionsToBeRankedEnabled(qNum)); - assertFalse(feedbackEditPage.isMaxOptionsToBeRankedEnabled(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // ticking both "Minimum number of options a respondent must rank" checkbox and - // "Maximum number of options a respondent must rank" checkbox must enable both - // minOptionsToBeRanked and maxOptionsToBeRanked input fields, with correct attributes - feedbackEditPage.toggleMaxOptionsToBeRankedCheckbox(qNum); - assertTrue(feedbackEditPage.isMinOptionsToBeRankedEnabled(qNum)); - assertTrue(feedbackEditPage.isMaxOptionsToBeRankedEnabled(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // when maxOptionsToBeRanked = minOptionsToBeRanked, - // increasing minOptionsToBeRanked must increase maxOptionsToBeRanked too - feedbackEditPage.fillMinOptionsToBeRanked(qNum, "2"); - assertEquals(2, feedbackEditPage.getMaxOptionsToBeRanked(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - // when maxOptionsToBeRanked = minOptionsToBeRanked, - // decreasing maxOptionsToBeRanked must decrease minOptionsToBeRanked too - feedbackEditPage.fillMaxOptionsToBeRanked(qNum, "1"); - assertEquals(1, feedbackEditPage.getMinOptionsToBeRanked(qNum)); - feedbackEditPage.verifyMinMaxOptionsToBeSelectedRestrictions(qNum); - - feedbackEditPage.clickSaveExistingQuestionButton(qNum); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRankMinMaxChoicesSuccess.html"); - } - - @Override - public void testDeleteQuestionAction() { - ______TS("rank: qn delete"); - - feedbackEditPage.clickDeleteQuestionLink(2); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 2)); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - /** - * Tests that rank options choices (new and existing) can be reordered using drag and drop mechanism. - * @throws Exception when option is not draggable - */ - private void testReorderOptions() throws Exception { - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_OPTIONS"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Test question text"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddMoreRankOptionLinkForNewQuestion(); - feedbackEditPage.clickAddMoreRankOptionLinkForNewQuestion(); - - feedbackEditPage.fillRankOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillRankOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.fillRankOptionForNewQuestion(2, "Choice 3"); - feedbackEditPage.fillRankOptionForNewQuestion(3, "Choice 4"); - - ______TS("Rank options: reorder existing options"); - - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, NEW_QUESTION_INDEX, 2, 0); - feedbackEditPage.clickAddQuestionButton(); - JSONObject rankOptionsQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - rankOptionsQuestionDetails.get("options").toString()); - - ______TS("Rank options: add option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddMoreRankOptionLink(1); - feedbackEditPage.fillRankOption(1, 4, "New Choice"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - rankOptionsQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"New Choice\",\"Choice 1\",\"Choice 2\",\"Choice 4\"]", - rankOptionsQuestionDetails.get("options").toString()); - - ______TS("Rank options: delete option and reorder"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveRankOptionLink(1, 2); - feedbackEditPage.fillRankOption(1, 1, "Old Choice"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - rankOptionsQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Choice 3\",\"Choice 4\",\"Old Choice\",\"Choice 2\"]", - rankOptionsQuestionDetails.get("options").toString()); - - ______TS("Rank options: add, delete and reorder options"); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickRemoveRankOptionLink(1, 2); - feedbackEditPage.clickAddMoreRankOptionLink(1); - feedbackEditPage.clickAddMoreRankOptionLink(1); - feedbackEditPage.fillRankOption(1, 4, "New Choice"); - feedbackEditPage.fillRankOption(1, 5, "Newer Choice"); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 5, 0); - feedbackEditPage.dragAndDropQuestionOption(QN_TYPE, 1, 4, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - rankOptionsQuestionDetails = new JSONObject(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1) - .getSerializedQuestionDetails()); - assertEquals("[\"Newer Choice\",\"New Choice\",\"Choice 3\",\"Choice 4\",\"Choice 2\"]", - rankOptionsQuestionDetails.get("options").toString()); - - ______TS("Rank options: delete question"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - } - - private InstructorFeedbackEditPage getFeedbackEditPage() { - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) - .withUserId(instructorId) - .withCourseId(courseId) - .withSessionName(feedbackSessionName) - .withEnableSessionEditDetails(true); - return loginAdminToPageOld(feedbackPageLink, InstructorFeedbackEditPage.class); - } - - private FeedbackSubmitPage loginToInstructorFeedbackSubmitPage( - String instructorName, String fsName) { - AppUrl submitPageUrl = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(submitPageUrl, FeedbackSubmitPage.class); - } - - private FeedbackSubmitPage loginToStudentFeedbackSubmitPage( - String studentName, String fsName) { - AppUrl submitPageUrl = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(submitPageUrl, FeedbackSubmitPage.class); - } - - private StudentFeedbackResultsPage loginToStudentFeedbackResultsPage( - String studentName, String fsName) { - AppUrl resultsPageUrl = createUrl(Const.WebPageURIs.STUDENT_SESSION_RESULTS_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(resultsPageUrl, StudentFeedbackResultsPage.class); - } - - private InstructorFeedbackResultsPage loginToInstructorFeedbackResultsPageWithViewType( - String instructorName, String fsName, boolean needAjax, String viewType) { - AppUrl resultsPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_RESULTS_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - - if (needAjax) { - resultsPageUrl = resultsPageUrl.withParam(Const.ParamsNames.FEEDBACK_RESULTS_NEED_AJAX, - String.valueOf(needAjax)); - } - - if (viewType != null) { - resultsPageUrl = resultsPageUrl.withParam(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, viewType); - } - - return loginAdminToPageOld(resultsPageUrl, InstructorFeedbackResultsPage.class); - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/FeedbackRubricQuestionUiTest.java b/src/test/java/teammates/test/cases/browsertests/FeedbackRubricQuestionUiTest.java deleted file mode 100644 index 7c1d0256a34..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/FeedbackRubricQuestionUiTest.java +++ /dev/null @@ -1,794 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.util.List; - -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.questions.FeedbackRubricQuestionDetails; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.FeedbackSubmitPage; -import teammates.test.pageobjects.InstructorFeedbackEditPage; -import teammates.test.pageobjects.InstructorFeedbackResultsPage; -import teammates.test.pageobjects.StudentFeedbackResultsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}, - * specifically for rubric questions. - */ -public class FeedbackRubricQuestionUiTest extends BaseFeedbackQuestionUiTest { - - private static final int NEW_QUESTION_INDEX = -1; - - private InstructorFeedbackEditPage feedbackEditPage; - - private String courseId; - private String feedbackSessionName; - private String instructorId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/FeedbackRubricQuestionUiTest.json"); - removeAndRestoreDataBundle(testData); - - instructorId = testData.accounts.get("instructor1").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @BeforeClass - public void classSetup() { - feedbackEditPage = getFeedbackEditPage(); - } - - @Test - public void allTests() throws Exception { - testRubricWeightsFeature(); - testEditPage(); - testInstructorSubmitPage(); - testStudentSubmitPage(); - testStudentResultsPage(); - testInstructorResultsPage(); - } - - private void testStudentResultsPage() throws Exception { - ______TS("test rubric question simple student results page"); - - StudentFeedbackResultsPage simpleResultsPage = - loginToStudentFeedbackResultsPage("alice.tmms@FRubricQnUiT.CS2104", "openSession2"); - simpleResultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageRubric.html"); - - ______TS("test rubric question extended student results page"); - - StudentFeedbackResultsPage extendedResultsPage = - loginToStudentFeedbackResultsPage("alice.tmms@FRubricQnUiT.CS2104", "openSession4"); - extendedResultsPage.verifyHtmlMainContent("/studentExtendedFeedbackResultsPageRubric.html"); - - } - - private void testInstructorResultsPage() throws Exception { - ______TS("Test instructor results page for rubric question with weights attached"); - - // Question view - InstructorFeedbackResultsPage instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("teammates.test.instructor", "openSession2", - false, "question"); - instructorResultsPage.loadResultQuestionPanel(1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRubricQuestionView.html"); - - // Giver Recipient Question View - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("teammates.test.instructor", "openSession2", false, - "giver-recipient-question"); - instructorResultsPage.loadResultSectionPanel(0, 1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRubricGRQView.html"); - - // Giver Question Recipient View - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("teammates.test.instructor", "openSession2", false, - "giver-question-recipient"); - instructorResultsPage.loadResultSectionPanel(0, 1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRubricGQRView.html"); - - // Recipient Question Giver View - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("teammates.test.instructor", "openSession2", false, - "recipient-question-giver"); - instructorResultsPage.loadResultSectionPanel(0, 1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRubricRQGView.html"); - - // Recipient Giver Question View - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("teammates.test.instructor", "openSession2", false, - "recipient-giver-question"); - instructorResultsPage.loadResultSectionPanel(0, 1); - instructorResultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageRubricRGQView.html"); - - ______TS("Test instructor result page for Rubric question without weights attached"); - - // Question view - instructorResultsPage = - loginToInstructorFeedbackResultsPageWithViewType("teammates.test.instructor", "openSession3", - false, "question"); - instructorResultsPage.clickShowStats(); - instructorResultsPage.loadResultQuestionPanel(1); - instructorResultsPage.verifyHtmlMainContent( - "/instructorFeedbackResultsPageRubricQuestionViewWithoutWeightsAttached.html"); - } - - private void testInstructorSubmitPage() { - - ______TS("test rubric question input disabled for closed session"); - - FeedbackSubmitPage submitPage = loginToInstructorFeedbackSubmitPage("teammates.test.instructor", "closedSession"); - int qnNumber = 1; - int responseNumber = 0; - int rowNumber = 0; - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE - + "-" + qnNumber + "-" + responseNumber + "-" + rowNumber)); - - ______TS("test rubric question submission"); - // Done in testStudentSubmitPage - - } - - private void testStudentSubmitPage() throws Exception { - - ______TS("test rubric question input disabled for closed session"); - - FeedbackSubmitPage submitPage = loginToStudentFeedbackSubmitPage("alice.tmms@FRubricQnUiT.CS2104", "closedSession"); - int qnNumber = 1; - int responseNumber = 0; - int rowNumber = 0; - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE - + "-" + qnNumber + "-" + responseNumber + "-" + rowNumber)); - - ______TS("test rubric question submission"); - - submitPage = loginToStudentFeedbackSubmitPage("alice.tmms@FRubricQnUiT.CS2104", "openSession2"); - assertTrue(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE - + "-" + qnNumber + "-" + responseNumber + "-" + rowNumber)); - - // Select table cell - - submitPage.clickRubricRadio(1, 0, 0, 1); - - submitPage.clickRubricRadio(1, 1, 0, 1); - submitPage.clickRubricRadio(1, 1, 1, 0); - - // Submit - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED); - - // Go back to submission page and verify html - submitPage = loginToStudentFeedbackSubmitPage("alice.tmms@FRubricQnUiT.CS2104", "openSession2"); - submitPage.waitForCellHoverToDisappear(); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageRubricSuccess.html"); - - // Submit another feedback response using another student's account - submitPage = loginToStudentFeedbackSubmitPage("benny.tmms@FRubricQnUiT.CS2104", "openSession2"); - - submitPage.clickRubricRadio(1, 0, 0, 0); - submitPage.clickRubricRadio(1, 0, 1, 1); - - submitPage.clickRubricRadio(1, 1, 0, 0); - submitPage.clickRubricRadio(1, 1, 1, 0); - - submitPage.clickSubmitButton(); - - submitPage = loginToStudentFeedbackSubmitPage("colin.tmms@FRubricQnUiT.CS2104", "openSession2"); - - submitPage.clickRubricRadio(1, 0, 0, 1); - submitPage.clickRubricRadio(1, 0, 1, 0); - - submitPage.clickSubmitButton(); - } - - private void testEditPage() throws Exception { - testNewQuestionFrame(); - testInputValidation(); - testCustomizeOptions(); - testAddQuestionAction(); - testEditQuestionAction(); - testDeleteQuestionAction(); - testInputJsValidationForRubricQuestion(); - } - - @Override - public void testNewQuestionFrame() { - ______TS("RUBRIC: new question (frame) link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RUBRIC"); - assertTrue(feedbackEditPage.verifyNewRubricQuestionFormIsDisplayed()); - } - - @Override - public void testInputValidation() { - - ______TS("empty question text"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); - - ______TS("empty sub question test"); - int questionNum = -1; - int subQuestionIndex = 1; - - feedbackEditPage.fillRubricSubQuestionBox("", questionNum, subQuestionIndex); - feedbackEditPage.clickAddQuestionButton(); - assertTrue(feedbackEditPage.isRubricSubQuestionBoxFocused(questionNum, subQuestionIndex)); - feedbackEditPage.fillRubricSubQuestionBox("sub question text", questionNum, subQuestionIndex); - feedbackEditPage.clickAddRubricRowLink(questionNum); - - subQuestionIndex += 1; - - feedbackEditPage.clickAddQuestionButton(); - assertTrue(feedbackEditPage.isRubricSubQuestionBoxFocused(questionNum, subQuestionIndex)); - feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(questionNum, subQuestionIndex); - - ______TS("Front-end validation for empty weight"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("empty weight test"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAssignWeightsCheckboxForNewQuestion(); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("", 0, 3); - feedbackEditPage.clickAddQuestionButton(); - // Checks if the empty weight box is focused after clicking on 'Save question' button. - // If it is, that means the front-end validation works and the question is not submitted. - assertTrue(feedbackEditPage.isRubricWeightBoxFocused(questionNum, 0, 3)); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0", 0, 3); - - // Check if the weight cells added by 'Add Column' button are 'required' or not. - feedbackEditPage.clickAddRubricColLink(questionNum); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("", 1, 4); - feedbackEditPage.clickAddQuestionButton(); - assertTrue(feedbackEditPage.isRubricWeightBoxFocused(questionNum, 1, 4)); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0", 1, 4); - - // Check if the weight cells added by 'Add Row' button are 'required' or not. - feedbackEditPage.clickAddRubricRowLink(questionNum); - subQuestionIndex++; - feedbackEditPage.fillRubricSubQuestionBox("New Sub question", questionNum, subQuestionIndex); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("", subQuestionIndex, 1); - feedbackEditPage.clickAddQuestionButton(); - assertTrue(feedbackEditPage.isRubricWeightBoxFocused(questionNum, subQuestionIndex, 1)); - - // Check if the 'required' attribute is removed and the question is successfully added or not, - // after the checkbox is unchecked. - feedbackEditPage.clickAssignWeightsCheckboxForNewQuestion(); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - @Override - public void testCustomizeOptions() { - - // TODO somebody do this? - - } - - @Override - public void testAddQuestionAction() throws Exception { - ______TS("RUBRIC: add question action success"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RUBRIC"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("RUBRIC qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionAddSuccess.html"); - } - - @Override - public void testEditQuestionAction() throws Exception { - ______TS("RUBRIC: edit question success"); - - // Click edit button - feedbackEditPage.clickEditQuestionButton(1); - - // Check that fields are editable - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEdit.html"); - - feedbackEditPage.fillQuestionTextBox("edited RUBRIC qn text", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check question text is updated - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEditSuccess.html"); - - ______TS("RUBRIC: edit sub-questions success"); - feedbackEditPage.clickEditQuestionButton(1); - - // Edit sub-question for row 1 - feedbackEditPage.fillRubricSubQuestionBox("New(0) sub-question text", 1, 0); - - // Add new sub-question - feedbackEditPage.clickAddRubricRowLink(1); - feedbackEditPage.fillRubricSubQuestionBox("New(1) sub-question text", 1, 2); - - // Remove existing sub-questions - feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 0); - feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 1); - - // Add new sub-question - feedbackEditPage.clickAddRubricRowLink(1); - feedbackEditPage.fillRubricSubQuestionBox("New(2) sub-question text", 1, 3); - - // Remove new sub-question - feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 2); - - // Should end up with 1 question - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEditSubQuestionSuccess.html"); - - ______TS("RUBRIC: edit choices success"); - feedbackEditPage.clickEditQuestionButton(1); - - // Edit choice for col 1 - feedbackEditPage.fillRubricChoiceBox("New(0) choice", 1, 0); - - // Add new choice - feedbackEditPage.clickAddRubricColLink(1); - feedbackEditPage.fillRubricChoiceBox("New(1) choice", 1, 4); - - // Remove existing choice - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 0); - - // Add new choice - feedbackEditPage.clickAddRubricColLink(1); - feedbackEditPage.fillRubricChoiceBox("New(2) choice", 1, 5); - - // Remove new choice - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 4); - - // Should end up with 4 choices, including (1) and (2) - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEditChoiceSuccess.html"); - - ______TS("RUBRIC: edit weight success"); - feedbackEditPage.clickEditQuestionButton(1); - - // Edit the weight of the first choice - feedbackEditPage.clickAssignWeightsCheckbox(1); - feedbackEditPage.fillRubricWeightBox("2.25", 1, 0, 0); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEditWeightSuccess.html"); - - ______TS("RUBRIC: edit descriptions success"); - feedbackEditPage.clickEditQuestionButton(1); - - // Edit description for 0-0 - feedbackEditPage.fillRubricDescriptionBox("New(0) description", 1, 0, 0); - - // Edit description for a new row, to test if the js generated html works. - feedbackEditPage.clickAddRubricRowLink(1); - feedbackEditPage.fillRubricSubQuestionBox("New sub-question text", 1, 1); - - feedbackEditPage.fillRubricDescriptionBox("New(1) description", 1, 1, 0); - - // Should end up with 2 rubric descriptions, (0) and (1) - - feedbackEditPage.clickSaveExistingQuestionButton(1); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionEditDescriptionSuccess.html"); - - ______TS("RUBRIC: move rubric column success"); - feedbackEditPage.clickEditQuestionButton(1); - String[] col0 = feedbackEditPage.getRubricColValues(1, 0); - String[] col1 = feedbackEditPage.getRubricColValues(1, 1); - String[] col2 = feedbackEditPage.getRubricColValues(1, 2); - String[] col3 = feedbackEditPage.getRubricColValues(1, 3); - - feedbackEditPage.verifyRubricColumnsMovability(1, new int[] {0, 1, 2, 3}); - feedbackEditPage.clickAddRubricColLink(1); // new column index 4 - - String[] col4 = feedbackEditPage.getRubricColValues(1, 4); - - feedbackEditPage.verifyRubricQuestion(1, new int[] {0, 1, 2, 3, 4}, col0, col1, col2, col3, col4); - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 4); - feedbackEditPage.verifyRubricQuestion(1, new int[] {0, 1, 2, 3}, col0, col1, col2, col3); - - // checking move column for new column and row - feedbackEditPage.clickAddRubricColLink(1); // new column index 5 - feedbackEditPage.clickAddRubricRowLink(1); // new row index 2 - feedbackEditPage.fillRubricSubQuestionBox("SubQn 2", 1, 2); - - col0 = new String[] {"Col 0 Choice", "Col 0, SubQn 0", "0.10", "Col 0, SubQn 1", "0.10", "Col 0, SubQn 2", "0.10"}; - col1 = new String[] {"Col 1 Choice", "Col 1, SubQn 0", "0.20", "Col 1, SubQn 1", "0.20", "Col 1, SubQn 2", "0.20"}; - col2 = new String[] {"Col 2 Choice", "Col 2, SubQn 0", "0.30", "Col 2, SubQn 1", "0.30", "Col 2, SubQn 2", "0.30"}; - col3 = new String[] {"Col 3 Choice", "Col 3, SubQn 0", "0.40", "Col 3, SubQn 1", "0.40", "Col 3, SubQn 2", "0.40"}; - String[] col5 = - new String[] {"Col 5 Choice", "Col 5, SubQn 0", "0.50", "Col 5, SubQn 1", "0.50", "Col 5, SubQn 2", "0.50"}; - int[] colIndexes = {0, 1, 2, 3, 5}; - - feedbackEditPage.fillAllRubricColumns(1, colIndexes, col0, col1, col2, col3, col5); - - // move last column to first - moveRubricColumn(1, colIndexes, 4, 0, col0, col1, col2, col3, col5); - // move second column to last - moveRubricColumn(1, colIndexes, 1, 4, col5, col0, col1, col2, col3); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionMoveColumnSuccess.html"); - - // check buttons for new rubric question - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RUBRIC"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Edit rubric question 2"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details about this new question"); - feedbackEditPage.clickAssignWeightsCheckboxForNewQuestion(); - feedbackEditPage.clickAddRubricColLink(-1); - feedbackEditPage.clickAddRubricRowLink(-1); - feedbackEditPage.fillRubricSubQuestionBox("SubQn 2", -1, 2); - - feedbackEditPage.fillAllRubricColumns(-1, new int[] {0, 1, 2, 3, 4}, col0, col1, col2, col3, col4); - - feedbackEditPage.verifyRubricQuestion(-1, new int[] {0, 1, 2, 3, 4}, col0, col1, col2, col3, col4); - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(-1, 4); - feedbackEditPage.clickAddRubricColLink(-1); - feedbackEditPage.fillRubricColumn(-1, 5, col5); - feedbackEditPage.verifyRubricQuestion(-1, new int[] {0, 1, 2, 3, 5}, col0, col1, col2, col3, col5); - - // move last column to first - moveRubricColumn(-1, colIndexes, 4, 0, col0, col1, col2, col3, col5); - // move second column to last - moveRubricColumn(-1, colIndexes, 1, 4, col5, col0, col1, col2, col3); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionMoveColumnNewQuestionSuccess.html"); - feedbackEditPage.clickDeleteQuestionLink(2); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - /** - * Moves a rubric column to the left/right. Accomplishes this by clicking move - * column left/right buttons and also verifies the rubric question after each move. - * @param qnNumber question number. - * @param colIndexes An array containing column indexes in the order displayed in the UI. - * @param from Index of {@code colIndexes} array which corresponds to the column which is to be moved. - * @param to Index of {@code colIndexes} array which corresponds to the location to which the column needs to be moved. - * @param columns Varargs parameter, where each parameter is {@code String[]} which denotes values - * of a rubric column. Column values must be given in the order displayed in the UI. - */ - private void moveRubricColumn(int qnNumber, int[] colIndexes, int from, int to, String[]... columns) { - assertEquals(colIndexes.length, columns.length); - assertTrue(from >= 0 && from < colIndexes.length); - assertTrue(to >= 0 && to < colIndexes.length); - - // This determines which column needs to be swapped and compared with the current column. - // Value 1 indicates column needs to be moved right. Swaps and comparisons happen accordingly. - // Value -1 indicates column needs to be moved left. Swaps and comparisons happen accordingly. - int offset = from < to ? 1 : -1; - int i = from; - - while (i != to) { - if (offset > 0) { - assertTrue(feedbackEditPage.moveRubricColRight(qnNumber, colIndexes[i])); - } else { - assertTrue(feedbackEditPage.moveRubricColLeft(qnNumber, colIndexes[i])); - } - - // swap current column with column - // to the left/right depending on offset - String[] temp = columns[i]; - columns[i] = columns[i + offset]; - columns[i + offset] = temp; - - feedbackEditPage.verifyRubricQuestion(qnNumber, colIndexes, columns); - i += offset; - } - } - - @Override - public void testDeleteQuestionAction() { - ______TS("RUBRIC: qn delete then cancel"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - ______TS("RUBRIC: qn delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - private void testInputJsValidationForRubricQuestion() { - // this tests whether the JS validation disallows empty rubric options - - ______TS("JS validation test"); - - // add a new question - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RUBRIC"); - - // start editing it - feedbackEditPage.fillQuestionTextBoxForNewQuestion("RUBRIC qn JS validation test"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.clickEditQuestionButton(1); - - // try to remove everything - feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 1); - feedbackEditPage.clickRemoveRubricRowLinkAndConfirm(1, 0); - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 3); - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 2); - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 1); - feedbackEditPage.clickRemoveRubricColLinkAndConfirm(1, 0); - - // TODO check if the rubric column and link is indeed empty - - // add something so that we know that the elements are still there - // and so that we don't get empty sub question error - feedbackEditPage.fillRubricSubQuestionBox("New sub-question text", 1, 0); - feedbackEditPage.fillRubricDescriptionBox("New(0) description", 1, 0, 0); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - "Too little choices for Rubric question. Minimum number of options is: 2"); - } - - private void testRubricWeightsFeature() throws Exception { - testRubricWeightsFeature_shouldToggleStateCorrectly(); - testRubricWeightsFeature_shouldHaveCorrectDefaultValue(); - testRubricWeightsFeature_newQuestion_shouldAddWeightsCorrectly(); - testRubricWeightsFeature_existingQuestion_shouldAddWeightsCorrectly(); - } - - private void testRubricWeightsFeature_shouldToggleStateCorrectly() { - - ______TS("Rubric: Weight cells are visible when assigneWeights checkbox is clicked?"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RUBRIC"); - - feedbackEditPage.clickAssignWeightsCheckboxForNewQuestion(); - // Check if the weight cells are visible or not. - assertTrue(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 0, 0).isDisplayed()); - assertTrue(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 0, 1).isDisplayed()); - assertTrue(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 1, 0).isDisplayed()); - assertTrue(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 1, 1).isDisplayed()); - - // Uncheck checkboxes for consistency among other tests, - // otherwise these settings will persist after cancelling the question form - // Uncheck the 'Choices are weighted' checkbox. - feedbackEditPage.clickAssignWeightsCheckboxForNewQuestion(); - // Check weight cells are hidden when checkbox is unchecked. - assertFalse(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 0, 0).isDisplayed()); - assertFalse(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 0, 1).isDisplayed()); - assertFalse(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 1, 0).isDisplayed()); - assertFalse(feedbackEditPage.getRubricWeightBox(NEW_QUESTION_INDEX, 1, 1).isDisplayed()); - - // Cancel question - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - private void testRubricWeightsFeature_shouldHaveCorrectDefaultValue() throws Exception { - - ______TS("Rubric: Check default weight values"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RUBRIC"); - feedbackEditPage.fillQuestionTextBox("Rubric weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickAssignWeightsCheckboxForNewQuestion(); - - // Fill choices and check corresponding weight values - feedbackEditPage.verifyFieldValue("rubricWeight--1-0-0", "0"); - feedbackEditPage.verifyFieldValue("rubricWeight--1-0-1", "0"); - feedbackEditPage.verifyFieldValue("rubricWeight--1-0-2", "0"); - feedbackEditPage.verifyFieldValue("rubricWeight--1-0-3", "0"); - feedbackEditPage.verifyFieldValue("rubricWeight--1-1-0", "0"); - feedbackEditPage.verifyFieldValue("rubricWeight--1-1-1", "0"); - feedbackEditPage.verifyFieldValue("rubricWeight--1-1-2", "0"); - feedbackEditPage.verifyFieldValue("rubricWeight--1-1-3", "0"); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - - // verify html page - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackRubricQuestionWeightAddSuccess.html"); - - // Delete the question - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - private void testRubricWeightsFeature_newQuestion_shouldAddWeightsCorrectly() throws Exception { - ______TS("Success: Add weights for default subQuestions and choices"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RUBRIC"); - feedbackEditPage.fillQuestionTextBox("Rubric weight feature", NEW_QUESTION_INDEX); - feedbackEditPage.fillQuestionDescription("More details", NEW_QUESTION_INDEX); - feedbackEditPage.clickAssignWeightsCheckboxForNewQuestion(); - - // Fill existing weight cells. - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.1", 0, 0); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.2", 0, 1); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.3", 0, 2); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.4", 0, 3); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.1", 1, 0); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.2", 1, 1); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.3", 1, 2); - feedbackEditPage.fillRubricWeightBoxForNewQuestion("0.4", 1, 3); - - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - FeedbackQuestionAttributes question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - assertNotNull(question); - - // Check that weights have been added correctly - FeedbackRubricQuestionDetails questionDetails = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); - List> weights = questionDetails.getRubricWeights(); - // Weight list should contain 2 list (one for each subquestion) containing 4 weights each. - assertEquals(2, weights.size()); - assertEquals(4, weights.get(0).size()); - assertEquals(4, weights.get(1).size()); - // Check weight values. - assertEquals(0.1, weights.get(0).get(0)); - assertEquals(0.2, weights.get(0).get(1)); - assertEquals(0.3, weights.get(0).get(2)); - assertEquals(0.4, weights.get(0).get(3)); - assertEquals(0.1, weights.get(1).get(0)); - assertEquals(0.2, weights.get(1).get(1)); - assertEquals(0.3, weights.get(1).get(2)); - assertEquals(0.4, weights.get(1).get(3)); - } - - private void testRubricWeightsFeature_existingQuestion_shouldAddWeightsCorrectly() throws Exception { - ______TS("Success: Add weights for subquestion added by 'Add Row' button"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddRubricRowLink(1); - feedbackEditPage.fillRubricSubQuestionBox("New(2) sub question", 1, 2); - - // Fill weight cells added with the new sub question - feedbackEditPage.fillRubricWeightBox("0.5", 1, 2, 0); - feedbackEditPage.fillRubricWeightBox("0.4", 1, 2, 1); - feedbackEditPage.fillRubricWeightBox("0.3", 1, 2, 2); - feedbackEditPage.fillRubricWeightBox("0.2", 1, 2, 3); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check that weights have been added successfully - FeedbackQuestionAttributes question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - FeedbackRubricQuestionDetails questionDetails = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); - List> weights = questionDetails.getRubricWeights(); - assertEquals(3, weights.size()); - assertEquals(4, weights.get(2).size()); - // Check weights for each cell - assertEquals(0.5, weights.get(2).get(0)); - assertEquals(0.4, weights.get(2).get(1)); - assertEquals(0.3, weights.get(2).get(2)); - assertEquals(0.2, weights.get(2).get(3)); - - ______TS("Success: Add weights for subquestion added by 'Add Column' button"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddRubricColLink(1); - feedbackEditPage.fillRubricChoiceBox("New(4) choice", 1, 4); - - // Fill weight cells added with the new sub question - feedbackEditPage.fillRubricWeightBox("1.0", 1, 0, 4); - feedbackEditPage.fillRubricWeightBox("1.5", 1, 1, 4); - feedbackEditPage.fillRubricWeightBox("2.0", 1, 2, 4); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - // Check that weights have been added successfully - question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - questionDetails = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); - weights = questionDetails.getRubricWeights(); - // All subquestions should have 5 cells attached after adding an additional column. - assertEquals(3, weights.size()); - assertEquals(5, weights.get(0).size()); - assertEquals(5, weights.get(1).size()); - assertEquals(5, weights.get(2).size()); - // Check weights for each cell - assertEquals(1.0, weights.get(0).get(4)); - assertEquals(1.5, weights.get(1).get(4)); - assertEquals(2.0, weights.get(2).get(4)); - - ______TS("Failure: Add weights for empty sub question"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.clickAddRubricRowLink(1); - feedbackEditPage.fillRubricSubQuestionBox(" ", 1, 3); // Empty sub question - - // Fill weight cells added with the new sub question - feedbackEditPage.fillRubricWeightBox("0", 1, 3, 0); - feedbackEditPage.fillRubricWeightBox("1", 1, 3, 1); - feedbackEditPage.fillRubricWeightBox("2", 1, 3, 2); - feedbackEditPage.fillRubricWeightBox("3", 1, 3, 3); - feedbackEditPage.fillRubricWeightBox("4", 1, 3, 4); - - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.FeedbackQuestion.RUBRIC_ERROR_EMPTY_SUB_QUESTION, - Const.FeedbackQuestion.RUBRIC_ERROR_INVALID_WEIGHT); - - // Check that weights for empty sub question have not been added. - question = BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1); - questionDetails = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); - weights = questionDetails.getRubricWeights(); - // The size of the weight list should remain same if adding weights for empty sub question fails. - assertEquals(3, weights.size()); - - // Delete the question - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - assertNull(BackDoor.getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - private InstructorFeedbackEditPage getFeedbackEditPage() { - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE).withUserId(instructorId) - .withCourseId(courseId).withSessionName(feedbackSessionName).withEnableSessionEditDetails(true); - return loginAdminToPageOld(feedbackPageLink, InstructorFeedbackEditPage.class); - } - - private FeedbackSubmitPage loginToInstructorFeedbackSubmitPage( - String instructorName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_SUBMISSION_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(editUrl, FeedbackSubmitPage.class); - } - - private FeedbackSubmitPage loginToStudentFeedbackSubmitPage( - String studentName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(editUrl, FeedbackSubmitPage.class); - } - - private StudentFeedbackResultsPage loginToStudentFeedbackResultsPage( - String studentName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.STUDENT_SESSION_RESULTS_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(editUrl, StudentFeedbackResultsPage.class); - } - - private InstructorFeedbackResultsPage loginToInstructorFeedbackResultsPageWithViewType( - String instructorName, String fsName, boolean needAjax, String viewType) { - AppUrl editUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_RESULTS_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - - if (needAjax) { - editUrl = editUrl.withParam(Const.ParamsNames.FEEDBACK_RESULTS_NEED_AJAX, String.valueOf(needAjax)); - } - - if (viewType != null) { - editUrl = editUrl.withParam(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, viewType); - } - - return loginAdminToPageOld(editUrl, InstructorFeedbackResultsPage.class); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorCourseDetailsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorCourseDetailsPageUiTest.java deleted file mode 100644 index 725fd79efb3..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorCourseDetailsPageUiTest.java +++ /dev/null @@ -1,349 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.io.IOException; - -import javax.mail.MessagingException; - -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.ThreadHelper; -import teammates.common.util.retry.RetryManager; -import teammates.common.util.retry.RetryableTaskReturnsThrows; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.EmailAccount; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorCourseDetailsPage; -import teammates.test.pageobjects.InstructorCourseStudentDetailsEditPage; -import teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage; -import teammates.test.pageobjects.InstructorStudentRecordsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_DETAILS_PAGE}. - */ -public class InstructorCourseDetailsPageUiTest extends BaseE2ETestCase { - private InstructorCourseDetailsPage detailsPage; - - private String instructorId; - private String courseId; - - @Override - protected void prepareTestData() { - // see beforeMethod() - } - - @BeforeMethod - public void beforeMethod() { - testData = loadDataBundle("/InstructorCourseDetailsPageUiTest.json"); - - // use both the student accounts injected for this test - - String student1GoogleId = TestProperties.TEST_STUDENT1_ACCOUNT; - String student1Email = student1GoogleId + "@gmail.com"; - String student2GoogleId = TestProperties.TEST_STUDENT2_ACCOUNT; - String student2Email = student2GoogleId + "@gmail.com"; - testData.accounts.get("Alice").googleId = student1GoogleId; - testData.accounts.get("Charlie").googleId = student2GoogleId; - testData.students.get("CCDetailsUiT.alice.tmms@CCDetailsUiT.CS2104").googleId = student1GoogleId; - testData.students.get("CCDetailsUiT.alice.tmms@CCDetailsUiT.CS2104").email = student1Email; - testData.students.get("charlie.tmms@CCDetailsUiT.CS2104").email = student2Email; - testData.students.get("CCDetailsUiT.alice.tmms@CCDetailsUiT.CS2103").googleId = student1GoogleId; - testData.students.get("CCDetailsUiT.alice.tmms@CCDetailsUiT.CS2103").email = student1Email; - testData.students.get("charlie.tmms@CCDetailsUiT.CS2103").email = student2Email; - - removeAndRestoreDataBundle(testData); - } - - @Test - public void allTests() throws Exception { - testContent(); - testTableSort(); - //No input validation required - testLinks(); - testDeleteAction(); - testDeleteAllAction(); - testSanitization(); - } - - @Test - public void testRemindAction() throws Exception { - instructorId = testData.instructors.get("CCDetailsUiT.instr").googleId; - courseId = testData.courses.get("CCDetailsUiT.CS2104").getId(); - detailsPage = getCourseDetailsPage(); - String courseName = testData.courses.get("CCDetailsUiT.CS2104").getName(); - // student2 is yet to register, student1 is already registered - StudentAttributes student1 = testData.students.get("CCDetailsUiT.alice.tmms@CCDetailsUiT.CS2104"); - EmailAccount student1EmailAccount = new EmailAccount(student1.email); - StudentAttributes student2 = testData.students.get("charlie.tmms@CCDetailsUiT.CS2104"); - EmailAccount student2EmailAccount = new EmailAccount(student2.email); - - boolean isEmailEnabled = !TestProperties.isDevServer(); - if (isEmailEnabled) { - // get user authenticated so that we can access emails of them - student1EmailAccount.getUserAuthenticated(); - student2EmailAccount.getUserAuthenticated(); - // mark all emails as read to start from a clean state - student1EmailAccount.markAllUnreadEmailAsRead(); - student2EmailAccount.markAllUnreadEmailAsRead(); - } - - ______TS("action: remind single student"); - - detailsPage.clickRemindStudentAndCancel(student2.name); - if (isEmailEnabled) { - assertStudentDoesNotReceiveReminder(courseName, courseId, student2EmailAccount); - } - - detailsPage.clickRemindStudentAndConfirm(student2.name); - if (isEmailEnabled) { - assertStudentHasReceivedReminder(courseName, courseId, student2EmailAccount); - assertNull("getting registration key of the same course again should not return any result" - + "as there should be only one reminder presented in the unread inbox", - student2EmailAccount.getRegistrationKeyFromUnreadEmails(courseName, courseId)); - } - detailsPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.COURSE_REMINDER_SENT_TO + student2.email); - - // Hiding of the 'Send invite' link is already covered by content test. - // (i.e., they contain cases of both hidden and visible 'Send invite' links. - - ______TS("action: remind all"); - - detailsPage.clickRemindAllAndCancel(); - if (isEmailEnabled) { - // verify that all students did not receive reminders - assertStudentDoesNotReceiveReminder(courseName, courseId, student1EmailAccount); - assertStudentDoesNotReceiveReminder(courseName, courseId, student2EmailAccount); - } - - detailsPage.clickRemindAllAndConfirm(); - if (isEmailEnabled) { - // verify an unregistered student received reminder - assertStudentHasReceivedReminder(courseName, courseId, student2EmailAccount); - // verify a registered student did not receive a reminder - assertStudentDoesNotReceiveReminder(courseName, courseId, student1EmailAccount); - } - - // verify if sort is preserved after sending invite - String patternString = "Joined{*}Joined{*}Yet to join{*}Yet to join"; - - detailsPage.sortByStatus().verifyTablePattern(0, 4, patternString); - detailsPage.clickRemindStudentAndConfirm(student2.name); - detailsPage.verifyTablePattern(0, 4, patternString); - - patternString = "Alice Betsy'\"{*}Benny Charles{*}Charlie Davis{*}Danny Engrid"; - detailsPage.sortByName().verifyTablePattern(0, 3, patternString); - detailsPage.clickRemindStudentAndConfirm(student2.name); - detailsPage.verifyTablePattern(0, 3, patternString); - - patternString = "Team 1'\"{*}Benny Charles{*}Charlie Davis{*}Danny Engrid"; - detailsPage.sortByName().verifyTablePattern(0, 3, patternString); - patternString = "Danny Engrid{*}Charlie Davis{*}Benny Charles{*}Alice Betsy"; - detailsPage.sortByName().verifyTablePattern(0, 3, patternString); - - patternString = "Team 1'\"", student.name); - assertEquals("Team 1'\"", student.team); - assertEquals(testData.students.get("registeredStudent").googleId, student.googleId); - assertEquals("CCSDEditUiT.jose.tmms@gmail.tmt", student.email); - assertEquals("This student's name is José Gómez'\"", student.comments); - - ______TS("edit action"); - - InstructorCourseDetailsPage detailsPage = - editPage.submitSuccessfully("New name", "New team", "newemail@gmail.tmt", "New comments"); - detailsPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.STUDENT_EDITED); - detailsPage.verifyIsCorrectPage(testData.courses.get("CCSDEditUiT.CS2104").getId()); - - // Verify data - student = BackDoor.getStudent(testData.courses.get("CCSDEditUiT.CS2104").getId(), - "newemail@gmail.tmt"); - assertEquals("New name", student.name); - assertEquals("New team", student.team); - assertEquals("newemail@gmail.tmt", student.email); - assertEquals("New comments", student.comments); - assertTrue(student.googleId.isEmpty()); // Due to Google ID reset - - // Verify adding the original student again does not overwrite the edited entity - BackDoor.createStudent(testData.students.get("registeredStudent")); - student = BackDoor.getStudent(testData.courses.get("CCSDEditUiT.CS2104").getId(), - "newemail@gmail.tmt"); - assertNotNull(student); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorCourseStudentDetailsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorCourseStudentDetailsPageUiTest.java deleted file mode 100644 index 5dfce62ee31..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorCourseStudentDetailsPageUiTest.java +++ /dev/null @@ -1,74 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.Test; - -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_COURSE_STUDENT_DETAILS_EDIT_PAGE}. - */ -public class InstructorCourseStudentDetailsPageUiTest extends BaseE2ETestCase { - - private String instructorId; - private String courseId; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/InstructorCourseStudentDetailsPageUiTest.json"); - removeAndRestoreDataBundle(testData); - instructorId = testData.instructors.get("CCSDetailsUiT.instr").googleId; - courseId = testData.courses.get("CCSDetailsUiT.CS2104").getId(); - } - - @Test - public void testAll() throws Exception { - - testContent(); - } - - private void testContent() throws Exception { - - ______TS("content: registered student"); - - InstructorCourseStudentDetailsViewPage viewPage = getCourseStudentDetailsPage("registeredStudent"); - - // This is the full HTML verification for Instructor Student Details Page, the rest can all be verifyMainHtml - viewPage.verifyHtml("/instructorCourseStudentDetailsRegistered.html"); - - ______TS("content: unregistered student"); - - viewPage = getCourseStudentDetailsPage("unregisteredStudent"); - viewPage.verifyHtmlMainContent("/instructorCourseStudentDetailsUnregistered.html"); - - ______TS("content: registered student with helper view"); - - // the helper here is configured to be able to view studentDetailsPage - instructorId = testData.instructors.get("CCSDetailsUiT.Helper").googleId; - - viewPage = getCourseStudentDetailsPage("registeredStudent"); - viewPage.verifyHtmlMainContent("/instructorCourseStudentDetailsRegisteredWithHelperView.html"); - - ______TS("content: registered student with attempted script and html injection"); - - instructorId = testData.instructors.get("instructor1OfTestingSanitizationCourse").googleId; - courseId = testData.courses.get("testingSanitizationCourse").getId(); - - viewPage = getCourseStudentDetailsPage("student1InTestingSanitizationCourse"); - viewPage.verifyHtmlMainContent("/instructorCourseStudentDetailsRegisteredWithAttemptedScriptInjection.html"); - - // TODO: add test for the comment box in this page - } - - private InstructorCourseStudentDetailsViewPage getCourseStudentDetailsPage(String studentStr) { - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_STUDENT_DETAILS_PAGE) - .withUserId(instructorId) - .withCourseId(courseId) - .withStudentEmail(testData.students.get(studentStr).email); - - return loginAdminToPageOld(viewPageUrl, InstructorCourseStudentDetailsViewPage.class); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorEditStudentFeedbackPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorEditStudentFeedbackPageUiTest.java deleted file mode 100644 index 8cba2c5ab22..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorEditStudentFeedbackPageUiTest.java +++ /dev/null @@ -1,206 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorEditStudentFeedbackPage; - -/** - * SUT: {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE}. - */ -public class InstructorEditStudentFeedbackPageUiTest extends BaseE2ETestCase { - - private InstructorEditStudentFeedbackPage submitPage; - - @Override - protected void prepareTestData() { - // test data is refreshed before each test case - } - - @BeforeMethod - protected void refreshTestData() { - testData = loadDataBundle("/InstructorEditStudentFeedbackPageTest.json"); - removeAndRestoreDataBundle(testData); - } - - @Test - public void testAddingEditingAndDeletingResponse() throws Exception { - testModerationHint(); - testEditResponse(); - testAddResponse(); - testDeleteResponse(); - } - - @Test - public void testAddingEditingAndDeletingFeedbackParticipantComments() { - testAddCommentsToQuestionsWithoutResponse(); - testAddCommentsToQuestionsWithResponses(); - testEditCommentsActionAfterAddingComments(); - testDeleteCommentsActionAfterEditingComments(); - } - - private void testModerationHint() throws Exception { - ______TS("verify moderation hint"); - - submitPage = loginToInstructorEditStudentFeedbackPage("IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", - "session1InIESFPTCourse"); - - submitPage.verifyModerationHeaderHtml("/instructorEditStudentFeedbackHint.html"); - - submitPage.clickModerationHintButton(); - assertTrue(submitPage.isModerationHintVisible()); - assertEquals("[Less]", submitPage.getModerationHintButtonText()); - - submitPage.clickModerationHintButton(); - assertFalse(submitPage.isModerationHintVisible()); - assertEquals("[More]", submitPage.getModerationHintButtonText()); - } - - private void testEditResponse() throws Exception { - ______TS("edit responses"); - - FeedbackQuestionAttributes fq = BackDoor.getFeedbackQuestion("IESFPTCourse", "First feedback session", 1); - FeedbackResponseAttributes fr = BackDoor.getFeedbackResponse(fq.getId(), - "student1InIESFPTCourse@gmail.tmt", - "student1InIESFPTCourse@gmail.tmt"); - - assertEquals("Student 1 self feedback.", fr.getResponseDetails().getAnswerString()); - - submitPage = loginToInstructorEditStudentFeedbackPage("IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", - "session1InIESFPTCourse"); - - // Full HTML verification already done in InstructorFeedbackSubmitPageUiTest - submitPage.verifyHtmlMainContent("/instructorEditStudentFeedbackPageOpen.html"); - - submitPage.fillResponseRichTextEditor(1, 0, "Good design"); - - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "2."); - submitPage.verifyAndCloseSuccessfulSubmissionModal("2."); - - fq = BackDoor.getFeedbackQuestion("IESFPTCourse", "First feedback session", 1); - - fr = BackDoor.getFeedbackResponse(fq.getId(), - "student1InIESFPTCourse@gmail.tmt", - "student1InIESFPTCourse@gmail.tmt"); - - assertEquals("

    Good design

    ", fr.getResponseDetails().getAnswerString()); - } - - private void testAddResponse() throws Exception { - ______TS("test new response"); - - submitPage.fillResponseTextBox(2, 0, "4"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED); - - FeedbackQuestionAttributes fq = BackDoor.getFeedbackQuestion("IESFPTCourse", "First feedback session", 2); - FeedbackResponseAttributes fr = BackDoor.getFeedbackResponse(fq.getId(), - "student1InIESFPTCourse@gmail.tmt", - "student1InIESFPTCourse@gmail.tmt"); - - assertEquals("4", fr.getResponseDetails().getAnswerString()); - - // Full HTML verification already done in InstructorFeedbackSubmitPageUiTest - submitPage.verifyHtmlMainContent("/instructorEditStudentFeedbackPageModified.html"); - submitPage.verifyAndCloseSuccessfulSubmissionModal(""); - } - - private void testDeleteResponse() { - ______TS("test delete response"); - - submitPage.fillResponseTextBox(2, 0, ""); - - submitPage.fillResponseTextBox(1, 0, ""); - submitPage.clickSubmitButton(); - - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "1, 2."); - submitPage.verifyAndCloseSuccessfulSubmissionModal("1, 2."); - - FeedbackQuestionAttributes fq = BackDoor.getFeedbackQuestion("IESFPTCourse", "First feedback session", 1); - FeedbackResponseAttributes fr = BackDoor.getFeedbackResponse(fq.getId(), - "student1InIESFPTCourse@gmail.tmt", - "student1InIESFPTCourse@gmail.tmt"); - assertNull(fr); - fq = BackDoor.getFeedbackQuestion("IESFPTCourse", "First feedback session", 2); - fr = BackDoor.getFeedbackResponse(fq.getId(), - "student1InIESFPTCourse@gmail.tmt", - "student1InIESFPTCourse@gmail.tmt"); - assertNull(fr); - } - - private void testAddCommentsToQuestionsWithoutResponse() { - ______TS("add comments on questions without responses: no effect"); - - submitPage = loginToInstructorEditStudentFeedbackPage( - "IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", "session1InIESFPTCourse"); - submitPage.waitForPageToLoad(); - - // Unselect the mcq choice to remove response - submitPage.chooseMcqOption(3, 0, "It's good"); - submitPage.addFeedbackParticipantComment("-3-0", "Comment without response"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("2, 3."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "2, 3."); - submitPage.verifyCommentRowMissing("-3-0"); - } - - private void testAddCommentsToQuestionsWithResponses() { - submitPage = loginToInstructorEditStudentFeedbackPage( - "IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", "session1InIESFPTCourse"); - submitPage.waitForPageToLoad(); - - submitPage.chooseMcqOption(3, 0, "It's good"); - submitPage.addFeedbackParticipantComment("-3-0", "New MCQ Comment 1"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("2."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "2."); - submitPage.verifyCommentRowContent("-3-0", "New MCQ Comment 1"); - } - - private void testEditCommentsActionAfterAddingComments() { - submitPage = loginToInstructorEditStudentFeedbackPage( - "IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", "session1InIESFPTCourse"); - submitPage.waitForPageToLoad(); - - submitPage.editFeedbackParticipantComment("-3-0", "Edited MCQ Comment 1"); - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("2."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "2."); - submitPage.verifyCommentRowContent("-3-0", "Edited MCQ Comment 1"); - } - - private void testDeleteCommentsActionAfterEditingComments() { - submitPage = loginToInstructorEditStudentFeedbackPage( - "IESFPTCourseinstr", "student1InIESFPTCourse@gmail.tmt", "session1InIESFPTCourse"); - submitPage.waitForPageToLoad(); - - submitPage.deleteFeedbackResponseComment("-3-0"); - submitPage.verifyCommentRowMissing("-0-3-0"); - } - - private InstructorEditStudentFeedbackPage loginToInstructorEditStudentFeedbackPage( - String instructorName, String moderatedStudentEmail, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()) - .withParam(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, moderatedStudentEmail); - - return loginAdminToPageOld(editUrl, InstructorEditStudentFeedbackPage.class); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackEditCopyUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackEditCopyUiTest.java deleted file mode 100644 index ed55e9b12c7..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackEditCopyUiTest.java +++ /dev/null @@ -1,109 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.openqa.selenium.By; -import org.testng.annotations.Test; - -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.pageobjects.InstructorFeedbackEditPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}. - */ -public class InstructorFeedbackEditCopyUiTest extends BaseE2ETestCase { - private String instructorId; - private String courseId; - private String feedbackSessionName; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/InstructorFeedbackEditCopyTest.json"); - removeAndRestoreDataBundle(testData); - instructorId = testData.accounts.get("instructorWithSessions").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - } - - @Test - public void allTests() throws Exception { - InstructorFeedbackEditPage feedbackEditPage = getFeedbackEditPage(); - - ______TS("Submit empty course list"); - feedbackEditPage.clickFsCopyButton(); - feedbackEditPage.getFsCopyToModal().waitForModalToLoad(); - - // Full HTML verification already done in InstructorFeedbackEditPageUiTest - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditCopyPage.html"); - - feedbackEditPage.getFsCopyToModal().clickSubmitButton(); - feedbackEditPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(feedbackEditPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible()); - feedbackEditPage.getFsCopyToModal().verifyStatusMessage(Const.StatusMessages.FEEDBACK_SESSION_COPY_NONESELECTED); - - feedbackEditPage.getFsCopyToModal().clickCloseButton(); - - ______TS("Copying fails due to fs with same name in course selected"); - feedbackEditPage.clickFsCopyButton(); - feedbackEditPage.getFsCopyToModal().waitForModalToLoad(); - feedbackEditPage.getFsCopyToModal().fillFormWithAllCoursesSelected(feedbackSessionName); - - feedbackEditPage.getFsCopyToModal().clickSubmitButton(); - feedbackEditPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(feedbackEditPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible()); - - feedbackEditPage.getFsCopyToModal() - .verifyStatusMessage( - String.format(Const.StatusMessages.FEEDBACK_SESSION_COPY_ALREADYEXISTS, - feedbackSessionName, - testData.courses.get("course").getId())); - - // Full HTML verification already done in InstructorFeedbackEditPageUiTest - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditCopyFail.html"); - - feedbackEditPage.getFsCopyToModal().clickCloseButton(); - - ______TS("Copying fails due to fs with invalid name"); - String invalidNameforFs = "Invalid name | for feedback session"; - feedbackEditPage.clickFsCopyButton(); - feedbackEditPage.getFsCopyToModal().waitForModalToLoad(); - feedbackEditPage.getFsCopyToModal().fillFormWithAllCoursesSelected(invalidNameforFs); - - feedbackEditPage.getFsCopyToModal().clickSubmitButton(); - - feedbackEditPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(feedbackEditPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible()); - feedbackEditPage.getFsCopyToModal().verifyStatusMessage( - "\"" + invalidNameforFs + "\" is not acceptable to TEAMMATES as a/an " - + "feedback session name because it contains invalid characters. " - + "A/An feedback session name must start with an alphanumeric character, " - + "and cannot contain any vertical bar (|) or percent sign (%)."); - - feedbackEditPage.getFsCopyToModal().clickCloseButton(); - - ______TS("Successful case"); - feedbackEditPage.clickFsCopyButton(); - feedbackEditPage.getFsCopyToModal().waitForModalToLoad(); - feedbackEditPage.getFsCopyToModal().fillFormWithAllCoursesSelected("New name!"); - - feedbackEditPage.getFsCopyToModal().clickSubmitButton(); - feedbackEditPage.waitForPageToLoad(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_COPIED); - feedbackEditPage.waitForElementPresence(By.id("table-sessions")); - - // Full HTML verification already done in InstructorFeedbackEditPageUiTest - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditCopySuccess.html"); - - } - - private InstructorFeedbackEditPage getFeedbackEditPage() { - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) - .withUserId(instructorId) - .withCourseId(courseId) - .withSessionName(feedbackSessionName) - .withEnableSessionEditDetails(true); - return loginAdminToPageOld(feedbackPageLink, InstructorFeedbackEditPage.class); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackEditPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackEditPageUiTest.java deleted file mode 100644 index 9ccfff8e419..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackEditPageUiTest.java +++ /dev/null @@ -1,1248 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.io.IOException; -import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.TimeHelper; -import teammates.common.util.retry.MaximumRetriesExceededException; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.AppPage; -import teammates.test.pageobjects.FeedbackSubmitPage; -import teammates.test.pageobjects.InstructorFeedbackEditPage; -import teammates.test.pageobjects.InstructorFeedbackSessionsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_EDIT_PAGE}. - */ -@Priority(-1) -public class InstructorFeedbackEditPageUiTest extends BaseE2ETestCase { - private InstructorFeedbackEditPage feedbackEditPage; - private String instructorId; - private String courseId; - private String feedbackSessionName; - /** This contains data for the feedback session to be edited during testing. */ - private FeedbackSessionAttributes editedSession; - - @Override - protected void prepareTestData() { - // see prepareData() - } - - @BeforeMethod - protected void prepareData() { - testData = loadDataBundle("/InstructorFeedbackEditPageUiTest.json"); - removeAndRestoreDataBundle(testData); - - editedSession = testData.feedbackSessions.get("openSession"); - editedSession.setGracePeriodMinutes(30); - editedSession.setSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING); - editedSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER); - editedSession.setInstructions("Please fill in the edited feedback session."); - editedSession.setEndTime(TimeHelper.parseInstant("2026-05-01 08:00 PM +0000")); - - instructorId = testData.accounts.get("instructorWithSessions").googleId; - courseId = testData.courses.get("course").getId(); - feedbackSessionName = testData.feedbackSessions.get("openSession").getFeedbackSessionName(); - - feedbackEditPage = getFeedbackEditPage(); - } - - @Test - public void allTests() throws Exception { - testContent(); - - testEditSessionAction(); - - testGeneralQuestionOperations(); - - testPreviewSessionAction(); - - testDoneEditingLink(); - - testDeleteSessionAction(); - - testSanitization(); - } - - @Test - public void testTemplateQuestionAdd() throws Exception { - testAddTemplateQuestionLink(); - - testAddTemplateQuestionAction(); - } - - private void testGeneralQuestionOperations() throws Exception { - testCancelAddingNewQuestion(); - testCancelEditQuestion(); - - testNewQuestionLink(); - testInputValidationForQuestion(); - testAddQuestionAction(); - - testEditQuestionLink(); - testEditQuestionAction(); - - testDuplicateQuestionAction(); - testCopyQuestion(); - - testChangeFeedbackGiver(); - testChangeFeedbackRecipient(); - testVisibilityOptionsCorrespondToFeedbackPath(); - testVisibilityOptionsUncheckedWhenHidden(); - - testEditQuestionNumberAction(); - - testAjaxOnVisibilityMessageButton(); - - testDeleteQuestionAction(2); - testEditWithEmptyQuestionTextThenDeleteQuestionAction(1); - testEditWithInvalidNumericalTextThenDeleteQuestionAction(); - - testEditNonExistentQuestion(); - - testResponseRate(); - } - - private void testContent() throws Exception { - - ______TS("fresh new page"); - - // This is the full HTML verification for Instructor Feedback Edit Page, the rest can all be verifyMainHtml - feedbackEditPage.verifyHtml("/instructorFeedbackEditEmpty.html"); - assertTrue(feedbackEditPage.verifyEditSessionBoxIsEnabled()); - - } - - private void testEditSessionLink() { - ______TS("edit session link"); - feedbackEditPage.clickEditSessionButton(); - assertTrue(feedbackEditPage.verifyEditSessionBoxIsEnabled()); - - } - - private void testEditSessionAction() throws Exception { - - ______TS("typical success case"); - - assertTrue(feedbackEditPage.areDatesOfPreviousCurrentAndNextMonthEnabled()); - - feedbackEditPage.clickManualPublishTimeButton(); - feedbackEditPage.clickDefaultVisibleTimeButton(); - - feedbackEditPage.editFeedbackSession(editedSession.getStartTimeLocal(), editedSession.getEndTimeLocal(), - editedSession.getInstructions(), editedSession.getGracePeriodMinutes()); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_EDITED); - assertTrue(feedbackEditPage.isElementInViewport(Const.ParamsNames.STATUS_MESSAGES_LIST)); - - FeedbackSessionAttributes savedSession = getFeedbackSessionWithRetry( - editedSession.getCourseId(), editedSession.getFeedbackSessionName()); - editedSession.setInstructions("

    " + editedSession.getInstructionsString() + "

    "); - assertEquals(editedSession.toString(), savedSession.toString()); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_EDITED); - feedbackEditPage.reloadPage(); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditSuccess.html"); - - ______TS("test two 'change' links' functionality to expand uncommon settings panels"); - - By uncommonSettingsSection = By.id("uncommonSettingsSection"); - - // test uncommon settings for 'send emails' - feedbackEditPage.clickEditUncommonSettingsSendEmailsButton(); - feedbackEditPage.verifyEditSessionBoxIsEnabled(); - feedbackEditPage.toggleClosingSessionEmailReminderCheckbox(); - feedbackEditPage.clickSaveSessionButton(); - - // The statement below is a 'dummy' but valid statement to wait for the data in back-end to be persistent - // TODO: to implement a more sophisticated method to wait for the persistence of data - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_EDITED); - - feedbackEditPage.reloadPage(); - // uncommon settings panel not in default will be automatically expanded - feedbackEditPage.verifyHtmlPart(uncommonSettingsSection, - "/instructorFeedbackEditUncommonSettingsSendEmails.html"); - - // test uncommon settings for 'session responses visibility' - feedbackEditPage.clickEditUncommonSettingsSessionResponsesVisibleButton(); - feedbackEditPage.verifyEditSessionBoxIsEnabled(); - feedbackEditPage.clickDefaultPublishTimeButton(); - feedbackEditPage.verifyHtmlPart(uncommonSettingsSection, - "/instructorFeedbackEditUncommonSettingsSessionVisibility.html"); - feedbackEditPage.clickSaveSessionButton(); - - // The statement below is a 'dummy' but valid statement to wait for the data in back-end to be persistent - // TODO: to implement a more sophisticated method to wait for the persistence of data - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_EDITED); - testEditSessionLink(); - - // test expanded uncommon settings section - feedbackEditPage.reloadPage(); - // uncommon settings panel not in default will be automatically expanded - feedbackEditPage.isElementVisible("sessionResponsesVisiblePanel"); - feedbackEditPage.isElementVisible("sendEmailsForPanel"); - - // Restore defaults - feedbackEditPage.clickManualPublishTimeButton(); - feedbackEditPage.toggleClosingSessionEmailReminderCheckbox(); - feedbackEditPage.clickSaveSessionButton(); - feedbackEditPage.reloadPage(); - - ______TS("test edit page not changed after manual publish"); - - // Do a backdoor 'manual' publish. - editedSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_NOW); - String status = BackDoor.editFeedbackSession(editedSession); - assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, status); - - feedbackEditPage = getFeedbackEditPage(); - - // Ensuring that the settings did not default back to original values after manual publishing - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditManuallyPublished.html"); - - // Restore defaults - - feedbackEditPage.clickEditUncommonSettingsSessionResponsesVisibleButton(); - feedbackEditPage.clickDefaultPublishTimeButton(); - feedbackEditPage.clickSaveSessionButton(); - - ______TS("test ambiguous date times"); - feedbackEditPage = getFeedbackEditPageOfSessionIndDstCourse(); - FeedbackSessionAttributes dstSession = testData.feedbackSessions.get("dstSession"); - - LocalDateTime overlapStartTime = TimeHelper.parseDateTimeFromSessionsForm("Sun, 05 Apr, 2015", "2", "0"); - LocalDateTime gapEndTime = TimeHelper.parseDateTimeFromSessionsForm("Sun, 01 Oct, 2017", "2", "0"); - - feedbackEditPage.editFeedbackSession(overlapStartTime, gapEndTime, - dstSession.getInstructions(), dstSession.getGracePeriodMinutes()); - - String overlapStartWarning = String.format(Const.StatusMessages.AMBIGUOUS_LOCAL_DATE_TIME_OVERLAP, - "start time", "Sun, 05 Apr 2015, 02:00 AM", "Sun, 05 Apr 2015, 02:00 AM AEDT (UTC+1100)", - "Sun, 05 Apr 2015, 02:00 AM AEST (UTC+1000)", "Sun, 05 Apr 2015, 02:00 AM AEDT (UTC+1100)"); - String gapEndWarning = String.format(Const.StatusMessages.AMBIGUOUS_LOCAL_DATE_TIME_GAP, - "end time", "Sun, 01 Oct 2017, 02:00 AM", "Sun, 01 Oct 2017, 03:00 AM AEDT (UTC+1100)"); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - overlapStartWarning, gapEndWarning, Const.StatusMessages.FEEDBACK_SESSION_EDITED); - - assertEquals("End time on form should be updated to 3am", - "3", feedbackEditPage.getFeedbackSessionEndTimeValue()); - - savedSession = getFeedbackSessionWithRetry(dstSession.getCourseId(), dstSession.getFeedbackSessionName()); - assertEquals("Saved end time should be 3am", 3, savedSession.getEndTimeLocal().getHour()); - - ______TS("test end time earlier than start time"); - feedbackEditPage = getFeedbackEditPage(); - editedSession.setInstructions("Made some changes"); - feedbackEditPage.editFeedbackSession(editedSession.getEndTimeLocal(), editedSession.getStartTimeLocal(), - editedSession.getInstructions(), editedSession.getGracePeriodMinutes()); - - String expectedString = "The end time for this feedback session cannot be earlier than the start time."; - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(expectedString); - } - - private void testNewQuestionLink() { - - ______TS("new question (frame) link"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - assertTrue(feedbackEditPage.verifyNewEssayQuestionFormIsDisplayed()); - assertTrue(feedbackEditPage.isMenuQnNumberVisible(-1)); - assertFalse(feedbackEditPage.isStaticQnNumberVisible(-1)); - feedbackEditPage.verifyVisibilityMessageContainsForNewQuestion( - "You can see your own feedback in the results page later on."); - feedbackEditPage.verifyVisibilityMessageContainsForNewQuestion( - "Instructors in this course can see your response, the name of the recipient, and your name."); - assertTrue("Visibility preview for new question should be displayed", - feedbackEditPage.verifyVisibilityMessageIsDisplayedForNewQuestion()); - } - - private void testInputValidationForQuestion() { - - ______TS("empty question text"); - - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); - - ______TS("empty number of max respondents field"); - - feedbackEditPage.fillQuestionTextBoxForNewQuestion("filled qn"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.fillNumOfEntitiesToGiveFeedbackToBoxForNewQuestion(""); - feedbackEditPage.clickCustomNumberOfRecipientsButton(); - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_QUESTION_NUMBEROFENTITIESINVALID); - - } - - private void testAddQuestionAction() throws Exception { - - ______TS("add question action success"); - - feedbackEditPage.clickMaxNumberOfRecipientsButton(); - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 1)); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackQuestionAddSuccess.html"); - } - - private void testAddTemplateQuestionLink() throws Exception { - - ______TS("add template question link"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.clickTemplateModalButton(); - - feedbackEditPage.verifyHtmlPart(By.id("addTemplateQuestionModal"), - "/instructorFeedbackTemplateQuestionExpandedModal.html"); - - assertFalse("Should not be able to submit when there is no question selected", - feedbackEditPage.isAddTemplateQuestionButtonEnabled()); - } - - private void testAddTemplateQuestionAction() throws Exception { - - ______TS("add template question action success"); - - // check if each question panel is expandable - feedbackEditPage.clickTemplateQuestionPanel(1); - assertTrue(feedbackEditPage.isTemplateQuestionPanelExpanded(1)); - assertFalse("Cannot click before selecting a question", - feedbackEditPage.isAddTemplateQuestionButtonEnabled()); - - feedbackEditPage.clickTemplateQuestionModalCheckBox(1); - assertTrue("Can click after selecting a question", - feedbackEditPage.isAddTemplateQuestionButtonEnabled()); - feedbackEditPage.clickAddTemplateQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 1)); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackTemplateQuestionAddSuccess.html"); - - ______TS("add multiple template questions success"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.clickTemplateModalButton(); - - feedbackEditPage.clickTemplateQuestionModalCheckBox(2); - feedbackEditPage.clickTemplateQuestionModalCheckBox(3); - feedbackEditPage.clickAddTemplateQuestionButton(); - - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_QUESTION_ADDED_MULTIPLE); - assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 3)); - } - - private void testEditQuestionLink() { - - ______TS("edit question link"); - assertTrue(feedbackEditPage.isStaticQnNumberVisible(1)); - assertFalse(feedbackEditPage.isMenuQnNumberVisible(1)); - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isQuestionEnabled(1)); - assertFalse(feedbackEditPage.isStaticQnNumberVisible(1)); - assertTrue(feedbackEditPage.isMenuQnNumberVisible(1)); - - } - - private void testEditQuestionAction() throws Exception { - - ______TS("edit question 1 to Team-to-Team"); - - feedbackEditPage.enableOtherVisibilityOptions(1); - feedbackEditPage.enableOtherFeedbackPathOptions(1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.TEAMS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.TEAMS, 1); - feedbackEditPage.clickCustomNumberOfRecipientsButton(); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackQuestionEditToTeamToTeam.html"); - - ______TS("test visibility options of question 1"); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.clickEditQuestionButton(1); - - //TODO: use simple element checks instead of html checks after adding names to the checkboxes - // in the edit page (follow todo in instructorsFeedbackEdit.js) - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackQuestionVisibilityOptions.html"); - - ______TS("test visibility preview of question 1"); - feedbackEditPage.enableOtherVisibilityOptions(1); - WebElement visibilityMessage = browser.driver.findElement(By.id("visibilityMessage-1")); - feedbackEditPage.waitForElementVisibility(visibilityMessage); - - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackQuestionVisibilityPreview.html"); - - ______TS("test new question (frame) link copies custom number of recipients option"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - assertTrue(feedbackEditPage.isCustomNumOfRecipientsChecked()); - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - //change back - feedbackEditPage.enableOtherVisibilityOptions(1); - feedbackEditPage.enableOtherFeedbackPathOptions(1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.SELF, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.clickMaxNumberOfRecipientsButton(); - feedbackEditPage.clickSaveExistingQuestionButton(1); - - ______TS("test new question (frame) link copies max number of recipients option"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - assertTrue(feedbackEditPage.isMaxNumOfRecipientsChecked()); - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - feedbackEditPage.waitForElementVisibility(browser.driver.findElement(By.id("questionTable--1"))); - feedbackEditPage.enableOtherVisibilityOptionsForNewQuestion(); - feedbackEditPage.clickResponseVisibilityCheckBoxForNewQuestion("RECEIVER_TEAM_MEMBERS"); - - feedbackEditPage.verifyVisibilityMessageContainsForNewQuestion( - "The recipient's team members can see your response, but not the name of the recipient, or your name."); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientTypeForNewQuestionAndWaitForVisibilityMessageToLoad("Instructors in the course"); - - feedbackEditPage.verifyVisibilityMessageDoesNotContainForNewQuestion( - "The recipient's team members can see your response, but not the name of the recipient, or your name."); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - - ______TS("add question 2 and edit it to giver's team members and giver"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("test visibility when choosing giver's team members and giver"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion( - "

    Description


     

    "); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectGiverToBeStudentsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.selectRecipientsToBeGiverTeamMembersAndGiverAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.clickMaxNumberOfRecipientsButton(); - feedbackEditPage.clickAddQuestionButton(); - - ______TS("test Recipient's Team Members row is hidden"); - feedbackEditPage.clickEditQuestionButton(2); - feedbackEditPage.enableOtherVisibilityOptions(2); - - // use getAttribute("textContent") instead of getText - // because of the row of Recipient's Team Members is not displayed - assertEquals("Recipient's Team Members", - feedbackEditPage.getVisibilityOptionTableRow(2, 4).getAttribute("textContent").trim()); - assertFalse(feedbackEditPage.getVisibilityOptionTableRow(2, 4).isDisplayed()); - - ______TS("test visibility preview of question 2"); - feedbackEditPage.verifyVisibilityMessageContains(2, "The receiving student can see your response, and your name."); - - feedbackEditPage.verifyVisibilityMessageContains(2, - "Instructors in this course can see your response, the name of the recipient, and your name."); - - feedbackEditPage.clickDeleteQuestionLink(2); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - private void testCancelAddingNewQuestion() { - ______TS("Cancelling the adding of a new question"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - - ______TS("Click cancel but click no to confirmation prompt"); - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertTrue(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); - - ______TS("Click cancel and click yes to confirmation prompt"); - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - assertFalse(feedbackEditPage.verifyNewMcqQuestionFormIsDisplayed()); - - ______TS("Make sure controls disabled by Team Contribution questions are re-enabled after cancelling"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("CONTRIB"); - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("NUMSCALE"); - assertTrue(feedbackEditPage.isAllFeedbackPathOptionsEnabledForNewQuestion()); - assertTrue(feedbackEditPage.isAllVisibilityOptionsEnabledForNewQuestion()); - - feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - } - - private void testCancelEditQuestion() { - ______TS("Canceling the edit of an existing question"); - int qnIndex = 1; - String qnTextOriginal = "mcq qn"; - - // Add 2 questions - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion(qnTextOriginal); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.fillMcqOptionForNewQuestion(0, "Choice 1"); - feedbackEditPage.fillMcqOptionForNewQuestion(1, "Choice 2"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("Question text for question number 2"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddQuestionButton(); - - // Enable edit mode before testing canceling - feedbackEditPage.clickEditQuestionButton(qnIndex); - - ______TS("Click cancel but click no to confirmation prompt"); - feedbackEditPage.clickDiscardChangesLink(qnIndex); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertTrue(feedbackEditPage.isDiscardChangesButtonVisible(qnIndex)); - assertTrue(feedbackEditPage.isQuestionEnabled(qnIndex)); - - ______TS("Click cancel and click yes to confirmation prompt"); - feedbackEditPage.fillQuestionTextBox("new edits to question text", qnIndex); - feedbackEditPage.fillQuestionDescription("more details", qnIndex); - String qnTextAfterEdit = feedbackEditPage.getQuestionBoxText(qnIndex); - assertFalse(qnTextOriginal.equals(qnTextAfterEdit)); - - feedbackEditPage.clickDiscardChangesLink(qnIndex); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - assertFalse(feedbackEditPage.isDiscardChangesButtonVisible(qnIndex)); - assertFalse(feedbackEditPage.isQuestionEnabled(qnIndex)); - assertFalse(feedbackEditPage.isSelectQuestionNumberEnabled(qnIndex)); - String qnTextAfterCancelEdit = feedbackEditPage.getQuestionBoxText(qnIndex); - assertEquals(qnTextOriginal, qnTextAfterCancelEdit); - - ______TS("Try cancelling changes to question number"); - qnIndex++; - feedbackEditPage.clickEditQuestionButton(qnIndex); - feedbackEditPage.selectQuestionNumber(qnIndex, 1); - feedbackEditPage.clickDiscardChangesLink(qnIndex); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - assertEquals(qnIndex, feedbackEditPage.getSelectedQuestionNumber(qnIndex)); - qnIndex--; - - ______TS("Try re-editing a question after cancelling, making sure that form controls still work"); - feedbackEditPage.clickEditQuestionButton(qnIndex); - assertTrue(feedbackEditPage.isSelectQuestionNumberEnabled(qnIndex)); - feedbackEditPage.enableOtherFeedbackPathOptions(qnIndex); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(qnIndex); - assertTrue(feedbackEditPage.isOptionForSelectingNumberOfEntitiesVisible(qnIndex)); - - // Delete both questions to reset the status for the following tests - feedbackEditPage.clickDeleteQuestionLink(qnIndex); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.clickDeleteQuestionLink(qnIndex); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - private void testEditQuestionNumberAction() throws MaximumRetriesExceededException { - ______TS("edit question number success"); - assertTrue(feedbackEditPage.isStaticQnNumberVisible(2)); - assertFalse(feedbackEditPage.isMenuQnNumberVisible(2)); - feedbackEditPage.clickEditQuestionButton(2); - assertTrue(feedbackEditPage.isMenuQnNumberVisible(2)); - assertFalse(feedbackEditPage.isStaticQnNumberVisible(2)); - feedbackEditPage.selectQuestionNumber(2, 1); - feedbackEditPage.clickSaveExistingQuestionButton(2); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_EDITED); - - ______TS("questions still editable even if questions numbers became inconsistent"); - - FeedbackQuestionAttributes firstQuestion = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 1); - assertEquals(1, firstQuestion.questionNumber); - - FeedbackQuestionAttributes secondQuestion = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 2); - assertEquals(2, secondQuestion.questionNumber); - int originalSecondQuestionNumber = secondQuestion.questionNumber; - - // edit so that both questions have the same question number - secondQuestion.questionNumber = firstQuestion.questionNumber; - BackDoor.editFeedbackQuestion(secondQuestion); - - // verify both can be edited - feedbackEditPage = getFeedbackEditPage(); - feedbackEditPage.clickEditQuestionButton(1); - assertTrue(feedbackEditPage.isQuestionEnabled(1)); - assertTrue(feedbackEditPage.isMenuQnNumberVisible(1)); - assertFalse(feedbackEditPage.isStaticQnNumberVisible(1)); - feedbackEditPage.clickEditQuestionButton(2); - assertTrue(feedbackEditPage.isQuestionEnabled(2)); - assertTrue(feedbackEditPage.isMenuQnNumberVisible(2)); - assertFalse(feedbackEditPage.isStaticQnNumberVisible(2)); - - // fix inconsistent state - secondQuestion.questionNumber = originalSecondQuestionNumber; - BackDoor.editFeedbackQuestion(secondQuestion); - feedbackEditPage = getFeedbackEditPage(); - } - - private void testDuplicateQuestionAction() throws Exception { - - ______TS("Success case: duplicate current question successfully"); - - assertTrue(feedbackEditPage.verifyDuplicateButtonIsDisplayed(1)); - feedbackEditPage.clickDuplicateQuestionLink(1); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DUPLICATED); - // Check that the duplicated question is added to the feedback session - // Content is not tested as it follows the same logic for copy question which is tested - assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 2)); - - // Remove the question duplicated to not affect other test cases - feedbackEditPage.clickDeleteQuestionLink(2); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - } - - private void testCopyQuestion() throws Exception { - - ______TS("Success case: copy questions successfully"); - - feedbackEditPage.clickCopyButton(); - - feedbackEditPage.waitForCopyTableToLoad(); - - assertFalse("Unable to submit when there are no questions selected", - feedbackEditPage.isCopySubmitButtonEnabled()); - feedbackEditPage.verifyHtmlPart(By.id("copyModal"), "/instructorFeedbackCopyQuestionModal.html"); - feedbackEditPage.clickCopyTableAtRow(0); - - assertTrue("Can click after selecting", feedbackEditPage.isCopySubmitButtonEnabled()); - - feedbackEditPage.clickCopySubmitButton(); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackCopyQuestionSuccess.html"); - - ______TS("Success case: copy multiple questions successfully"); - - int numQuestionEditForms = feedbackEditPage.getNumberOfQuestionEditForms(); - feedbackEditPage.clickCopyButton(); - - feedbackEditPage.waitForCopyTableToLoad(); - feedbackEditPage.clickCopyTableAtRow(0); - feedbackEditPage.clickCopyTableAtRow(1); - - feedbackEditPage.clickCopySubmitButton(); - - assertEquals(numQuestionEditForms + 2, feedbackEditPage.getNumberOfQuestionEditForms()); - - ______TS("No copiable questions"); - - feedbackEditPage = getFeedbackEditPageOfCourseWithoutQuestions(); - feedbackEditPage.clickCopyButton(); - - feedbackEditPage.waitForCopyErrorMessageToLoad(); - assertEquals("There are no questions to be copied.", - feedbackEditPage.getCopyErrorMessageText()); - - assertFalse("Should not be able to submit if there are no questions", - feedbackEditPage.isCopySubmitButtonEnabled()); - - ______TS("Fails gracefully with an error message"); - feedbackEditPage = getFeedbackEditPage(); - - feedbackEditPage.changeActionLinkOnCopyButton("INVALID URL"); - feedbackEditPage.clickCopyButton(); - - feedbackEditPage.waitForCopyErrorMessageToLoad(); - assertEquals("Error retrieving questions. Please close the dialog window and try again.", - feedbackEditPage.getCopyErrorMessageText()); - - assertFalse("Should not be able to submit if loading failed", - feedbackEditPage.isCopySubmitButtonEnabled()); - - // revert back to state expected by tests after this by deleting new copied questions - String questionId = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 4).getId(); - BackDoor.deleteFeedbackQuestion(questionId); - questionId = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 3).getId(); - BackDoor.deleteFeedbackQuestion(questionId); - - } - - private void testChangeFeedbackGiver() { - feedbackEditPage = getFeedbackEditPage(); - feedbackEditPage.clickQuestionEditForQuestion(1); - - ______TS("change giver to \"Students in this course\" from \"Me (Session creator)\""); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - assertTrue(feedbackEditPage.isAllRecipientOptionsDisplayed(1)); - - ______TS("change giver to \"Instructors in this course\" from \"Students in this course\""); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.INSTRUCTORS, 1); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.STUDENTS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.INSTRUCTORS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.TEAMS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM_MEMBERS, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed( - FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.NONE, 1)); - - ______TS("change giver to \"Teams in this course\" from \"Instructors in this course\""); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.TEAMS, 1); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.STUDENTS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.INSTRUCTORS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.TEAMS, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM_MEMBERS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed( - FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.NONE, 1)); - - ______TS("change giver to \"Me (Session creator)\" from \"Teams in this course\""); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.SELF, 1); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.STUDENTS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.INSTRUCTORS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.TEAMS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM_MEMBERS, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed( - FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.NONE, 1)); - - ______TS("change giver such that first visible recipient is selected"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM_MEMBERS, 1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.SELF, 1); - assertEquals("SELF", feedbackEditPage.getRecipientTypeForQuestion(1)); - - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.SELF, 1); - assertEquals("SELF", feedbackEditPage.getRecipientTypeForQuestion(1)); - - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM_MEMBERS, 1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.INSTRUCTORS, 1); - assertEquals("SELF", feedbackEditPage.getRecipientTypeForQuestion(1)); - - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.INSTRUCTORS, 1); - assertEquals("SELF", feedbackEditPage.getRecipientTypeForQuestion(1)); - - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM, 1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.TEAMS, 1); - assertEquals("SELF", feedbackEditPage.getRecipientTypeForQuestion(1)); - - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM_MEMBERS, 1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.TEAMS, 1); - assertEquals("SELF", feedbackEditPage.getRecipientTypeForQuestion(1)); - - ______TS("add new question"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - - assertEquals("TEAMS", feedbackEditPage.getGiverTypeForQuestion(1)); - assertEquals("SELF", feedbackEditPage.getRecipientTypeForQuestion(1)); - - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.STUDENTS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.INSTRUCTORS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.TEAMS, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM, 1)); - assertFalse(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.OWN_TEAM_MEMBERS, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed( - FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1)); - assertTrue(feedbackEditPage.isRecipientOptionDisplayed(FeedbackParticipantType.NONE, 1)); - } - - private void testChangeFeedbackRecipient() { - ______TS("click on Edit visibility then change recipient"); - - feedbackEditPage = getFeedbackEditPage(); - - assertTrue(feedbackEditPage.verifyVisibilityMessageIsDisplayed(1)); - assertFalse(feedbackEditPage.verifyVisibilityOptionsIsDisplayed(1)); - - feedbackEditPage.clickQuestionEditForQuestion(1); - feedbackEditPage.enableOtherVisibilityOptions(1); - feedbackEditPage.enableOtherFeedbackPathOptions(1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.TEAMS, 1); - - assertTrue(feedbackEditPage.verifyVisibilityMessageIsDisplayed(1)); - assertTrue(feedbackEditPage.verifyVisibilityOptionsIsDisplayed(1)); - } - - private void testVisibilityOptionsCorrespondToFeedbackPath() { - ______TS("Changing feedback path will enable/disable the corresponding visibility options"); - - feedbackEditPage = getFeedbackEditPage(); - - feedbackEditPage.clickQuestionEditForQuestion(1); - feedbackEditPage.enableOtherVisibilityOptions(1); - - ______TS("Default case: all options enabled"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.STUDENTS, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.RECEIVER, FeedbackParticipantType.OWN_TEAM_MEMBERS, - FeedbackParticipantType.RECEIVER_TEAM_MEMBERS, FeedbackParticipantType.STUDENTS, - FeedbackParticipantType.INSTRUCTORS), - 1); - - // testing recipientTypes - ______TS("Selecting SELF as recipient disables options for RECEVIER and RECEIVER_TEAM_MEMBERS"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.SELF, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.STUDENTS, - FeedbackParticipantType.INSTRUCTORS), - 1); - - ______TS("Selecting INSTRUCTORS as recipient disables option for RECEIVER_TEAM_MEMBERS"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.INSTRUCTORS, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.RECEIVER, FeedbackParticipantType.OWN_TEAM_MEMBERS, - FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS), - 1); - - ______TS("Selecting OWN_TEAM as recipient disables options for RECEIVER and RECEIVER_TEAM_MEMBERS"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.STUDENTS, - FeedbackParticipantType.INSTRUCTORS), - 1); - - ______TS("Selecting NONE as recipient disables options for RECEIVER and RECEIVER_TEAM_MEMBERS"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.NONE, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.STUDENTS, - FeedbackParticipantType.INSTRUCTORS), - 1); - - // testing giverTypes - ______TS("Selecting SELF as giver disables option for OWN_TEAM_MEMBERS"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.SELF, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.STUDENTS, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.RECEIVER, FeedbackParticipantType.RECEIVER_TEAM_MEMBERS, - FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS), - 1); - - // testing specific giverType-recipientType combinations - ______TS("Selecting SELF as giver and recipient further disables option for RECIPIENT_TEAM_MEMBERS"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.SELF, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.SELF, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS), - 1); - - ______TS("Selecting TEAMS as giver and OWN_TEAM_MEMBERS_INCLUDING_SELF as recipient further disables " - + "option for RECIPIENT"); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.TEAMS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1); - - assertEnabledVisibilityOptionsIncludesOnly( - Arrays.asList(FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS), - 1); - - } - - private void testSanitization() throws IOException { - ______TS("Test sanitization for edit page"); - - instructorId = testData.accounts.get("instructor1OfTestingSanitizationCourse").googleId; - FeedbackSessionAttributes session = testData.feedbackSessions.get("session1InTestingSanitizationCourse"); - courseId = session.getCourseId(); - feedbackSessionName = session.getFeedbackSessionName(); - - feedbackEditPage = getFeedbackEditPage(); - feedbackEditPage.verifyHtmlMainContent("/instructorFeedbackEditPageTestingSanitization.html"); - - ______TS("Test sanitization for copy question modal"); - - feedbackEditPage.clickCopyButton(); - feedbackEditPage.waitForCopyTableToLoad(); - feedbackEditPage.verifyHtmlPart(By.id("copyModal"), "/instructorFeedbackCopyQuestionModalTestingSanitization.html"); - } - - private void assertEnabledVisibilityOptionsIncludesOnly(List expectedTypes, - int questionNumber) { - Set expectedEnabledOptions = new HashSet<>(); - for (FeedbackParticipantType expectedType : expectedTypes) { - expectedEnabledOptions.add(expectedType.toString()); - } - - Set actualEnableOptions = new HashSet<>(); - WebElement optionsTable = browser.driver.findElement(By.id("visibilityOptions-" + questionNumber)); - List enabledRows = - optionsTable.findElements(By.cssSelector("tr:not([style='display: none;'])")); - // remove the header row - enabledRows.remove(0); - for (WebElement enabledRow : enabledRows) { - WebElement checkbox = enabledRow.findElement(By.cssSelector("input")); - actualEnableOptions.add(checkbox.getAttribute("value")); - } - - assertEquals(expectedEnabledOptions, actualEnableOptions); - } - - private void testVisibilityOptionsUncheckedWhenHidden() { - ______TS("Test visibility checkbox gets unchecked when hidden according to feedback path"); - feedbackEditPage = getFeedbackEditPage(); - - feedbackEditPage.clickQuestionEditForQuestion(1); - feedbackEditPage.enableOtherVisibilityOptions(1); - - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.STUDENTS, 1); - - feedbackEditPage.clickResponseVisibilityCheckBox("RECEIVER_TEAM_MEMBERS", 1); - - assertTrue("Expected checkbox to be checked", - feedbackEditPage.isCheckboxChecked("answerCheckbox", "RECEIVER_TEAM_MEMBERS", 1)); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM, 1); - - assertFalse("Expected checkbox to not be checked", - feedbackEditPage.isCheckboxChecked("answerCheckbox", "RECEIVER_TEAM_MEMBERS", 1)); - - ______TS("Test other checkboxes retain their state (only visibility checkboxes affected)"); - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("RANK_OPTIONS"); - feedbackEditPage.tickDuplicatesAllowedCheckboxForNewQuestion(); - feedbackEditPage.clickVisibilityDropdownForNewQuestionAndWaitForVisibilityMessageToLoad( - "ANONYMOUS_TO_RECIPIENT_AND_INSTRUCTORS"); - assertTrue("Expected checkbox to remain checked", - feedbackEditPage.isRankDuplicatesAllowedCheckedForNewQuestion()); - } - - private void testAjaxOnVisibilityMessageButton() { - ______TS("Test visibility message corresponds to visibility options"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.enableOtherFeedbackPathOptions(1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.enableOtherVisibilityOptions(1); - feedbackEditPage.clickGiverNameVisibilityCheckBox("STUDENTS", 1); - feedbackEditPage.verifyVisibilityMessageContains(1, - "Other students in the course can see your response, and your name, but not the name of the recipient"); - - ______TS("Test visibility message corresponds to visibility options: going from Others to a predefined option"); - feedbackEditPage.enableOtherFeedbackPathOptions(1); - feedbackEditPage.selectGiverToBe(FeedbackParticipantType.STUDENTS, 1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.OWN_TEAM_MEMBERS_INCLUDING_SELF, 1); - feedbackEditPage.clickGiverNameVisibilityCheckBox("RECEIVER", 1); - feedbackEditPage.clickGiverNameVisibilityCheckBox("OWN_TEAM_MEMBERS", 1); - feedbackEditPage.clickGiverNameVisibilityCheckBox("STUDENTS", 1); - feedbackEditPage.clickVisibilityDropdownAndWaitForVisibilityMessageToLoad("VISIBLE_TO_INSTRUCTORS_ONLY", 1); - feedbackEditPage.verifyVisibilityMessageDoesNotContain(1, "The receiving student"); - - ______TS("Failure case: ajax on clicking visibility message button"); - - feedbackEditPage.changeQuestionTypeInForm(1, "InvalidQuestionType"); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.enableOtherVisibilityOptions(1); - feedbackEditPage.waitForAjaxErrorOnVisibilityMessageButton(1); - } - - private void testDeleteQuestionAction(int qnNumber) throws MaximumRetriesExceededException { - - ______TS("qn " + qnNumber + " delete then cancel"); - - feedbackEditPage.clickDeleteQuestionLink(qnNumber); - feedbackEditPage.waitForConfirmationModalAndClickCancel(); - assertNotNull(getFeedbackQuestionWithRetry(courseId, feedbackSessionName, qnNumber)); - - ______TS("qn " + qnNumber + " delete then accept"); - - feedbackEditPage.clickDeleteQuestionLink(qnNumber); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(getFeedbackQuestion(courseId, feedbackSessionName, qnNumber)); - } - - private void testEditWithEmptyQuestionTextThenDeleteQuestionAction(int qnNumber) - throws MaximumRetriesExceededException { - ______TS("qn " + qnNumber + " edit the question with invalid input then delete question"); - - feedbackEditPage.clickEditQuestionButton(qnNumber); - feedbackEditPage.fillQuestionTextBox("", qnNumber); - feedbackEditPage.clickSaveExistingQuestionButton(qnNumber); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_TEXTINVALID); - - feedbackEditPage.clickDeleteQuestionLink(qnNumber); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(getFeedbackQuestion(courseId, feedbackSessionName, qnNumber)); - } - - private void testEditWithInvalidNumericalTextThenDeleteQuestionAction() - throws MaximumRetriesExceededException { - ______TS("qn 1 edit the question with invalid input without saving then delete question"); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("NUMSCALE"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("filled qn"); - feedbackEditPage.clickAddQuestionButton(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_ADDED); - - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillMinNumScaleBox("", 1); - feedbackEditPage.fillMaxNumScaleBox("", 1); - feedbackEditPage.fillStepNumScaleBox("", 1); - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - feedbackEditPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_QUESTION_DELETED); - assertNull(getFeedbackQuestion(courseId, feedbackSessionName, 1)); - } - - private void testEditNonExistentQuestion() throws MaximumRetriesExceededException { - - ______TS("test editing a non-existent question"); - - // Create a new question and save - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("new question"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddQuestionButton(); - - // Delete the new question through the backdoor so that it still appears in the browser - String questionId = getFeedbackQuestionWithRetry(courseId, feedbackSessionName, 1).getId(); - String status = BackDoor.deleteFeedbackQuestion(questionId); - assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, status); - - // Edit the deleted question and save - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.fillQuestionTextBox("non-existent question", 1); - feedbackEditPage.fillQuestionDescription("more details", 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - - AppUrl expectedRedirectUrl = createUrl("/entityNotFoundPage.jsp"); - - assertTrue(browser.driver.getCurrentUrl().contains(expectedRedirectUrl.toAbsoluteString())); - - // Restore feedbackEditPage - feedbackEditPage = getFeedbackEditPage(); - } - - private void testResponseRate() { - - // Create a new question and save - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("new question"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.clickAddQuestionButton(); - - // Create response for the new question - FeedbackResponseAttributes feedbackResponse = - FeedbackResponseAttributes.builder("1", "tmms.test@gmail.tmt", "alice.b.tmms@gmail.tmt") - .withCourseId(courseId) - .withFeedbackSessionName(feedbackSessionName) - .withGiverSection(Const.DEFAULT_SECTION) - .withRecipientSection(Const.DEFAULT_SECTION) - .withResponseDetails(new FeedbackTextResponseDetails("Response from instructor to Alice")) - .build(); - BackDoor.createFeedbackResponse(feedbackResponse); - - ______TS("check response rate before editing question"); - - InstructorFeedbackSessionsPage feedbacksPage = navigateToInstructorFeedbackSessionsPage(); - feedbacksPage.waitForAjaxLoaderGifToDisappear(); - - feedbacksPage.clickViewResponseLink(courseId, feedbackSessionName); - feedbacksPage.verifyResponseValue("1 / 1", courseId, feedbackSessionName); - - ______TS("check warning is displayed while editing visibility options of question with existing response"); - - // Change the feedback path of the question and save - feedbackEditPage = getFeedbackEditPage(); - assertTrue(feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1)); - feedbackEditPage.clickEditQuestionButton(1); - feedbackEditPage.enableOtherFeedbackPathOptions(1); - feedbackEditPage.selectRecipientToBe(FeedbackParticipantType.TEAMS, 1); - feedbackEditPage.clickSaveExistingQuestionButton(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - - ______TS("check no warning displayed while editing visibility options of question without responses"); - - assertFalse(feedbackEditPage.isAlertClassEnabledForVisibilityOptions(1)); - - ______TS("check response rate after editing question"); - - feedbacksPage = navigateToInstructorFeedbackSessionsPage(); - feedbacksPage.waitForAjaxLoaderGifToDisappear(); - - feedbacksPage.clickViewResponseLink(courseId, feedbackSessionName); - feedbacksPage.verifyResponseValue("0 / 1", courseId, feedbackSessionName); - // Delete the question - feedbackEditPage = getFeedbackEditPage(); - feedbackEditPage.clickDeleteQuestionLink(1); - feedbackEditPage.waitForConfirmationModalAndClickOk(); - } - - private InstructorFeedbackSessionsPage navigateToInstructorFeedbackSessionsPage() { - - AppUrl feedbacksPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSIONS_PAGE).withUserId(instructorId); - InstructorFeedbackSessionsPage feedbacksPage = - AppPage.getNewPageInstance(browser, feedbacksPageUrl, InstructorFeedbackSessionsPage.class); - feedbacksPage.waitForPageToLoad(); - return feedbacksPage; - } - - private void testPreviewSessionAction() throws Exception { - - // add questions for previewing - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - assertTrue(feedbackEditPage.verifyNewEssayQuestionFormIsDisplayed()); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("question for me"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - assertTrue(feedbackEditPage.verifyNewEssayQuestionFormIsDisplayed()); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("question for students"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectGiverToBeStudentsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - assertTrue(feedbackEditPage.verifyNewEssayQuestionFormIsDisplayed()); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("question for instructors"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectGiverToBeInstructorsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.clickAddQuestionButton(); - - feedbackEditPage.clickNewQuestionButton(); - feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("TEXT"); - assertTrue(feedbackEditPage.verifyNewEssayQuestionFormIsDisplayed()); - feedbackEditPage.fillQuestionTextBoxForNewQuestion("question for students to instructors"); - feedbackEditPage.fillQuestionDescriptionForNewQuestion("more details"); - feedbackEditPage.enableOtherFeedbackPathOptionsForNewQuestion(); - feedbackEditPage.selectGiverToBeStudentsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.selectRecipientsToBeInstructorsAndWaitForVisibilityMessageToLoad(); - feedbackEditPage.clickAddQuestionButton(); - - ______TS("preview as instructor"); - - feedbackEditPage.waitForElementPresence(By.id("button_preview_instructor")); - FeedbackSubmitPage previewPage = feedbackEditPage.clickPreviewAsInstructorButton(); - previewPage.verifyHtmlMainContent("/instructorFeedbackSubmitPagePreview.html"); - previewPage.closeCurrentWindowAndSwitchToParentWindow(); - - ______TS("preview as student"); - - feedbackEditPage.waitForElementPresence(By.id("button_preview_student")); - previewPage = feedbackEditPage.clickPreviewAsStudentButton(); - previewPage.verifyHtmlMainContent("/studentFeedbackSubmitPagePreview.html"); - previewPage.closeCurrentWindowAndSwitchToParentWindow(); - - } - - private void testDoneEditingLink() { - InstructorFeedbackSessionsPage feedbackPage = feedbackEditPage.clickDoneEditingLink(); - - ______TS("Compare URLs"); - - String expectedRedirectUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSIONS_PAGE) - .withUserId(instructorId) - .withCourseId(courseId) - .withSessionName(feedbackSessionName) - .toAbsoluteString(); - assertEquals(expectedRedirectUrl, feedbackPage.getPageUrl()); - - ______TS("Check for highlight on last modified row"); - - feedbackPage.waitForAjaxLoaderGifToDisappear(); - String idOfModifiedSession = "session0"; - String idOfModifiedSession2 = "session1"; - assertTrue(feedbackPage.isContainingCssClass(By.id(idOfModifiedSession), "warning")); - assertFalse(feedbackPage.isContainingCssClass(By.id(idOfModifiedSession2), "warning")); - - // restore feedbackeditpage - feedbackEditPage = getFeedbackEditPage(); - } - - private void testDeleteSessionAction() throws MaximumRetriesExceededException { - - ______TS("session delete"); - - // check redirect to main feedback page - InstructorFeedbackSessionsPage feedbackPage = feedbackEditPage.deleteSession(); - assertTrue(feedbackPage.getTextsForAllStatusMessagesToUser() - .contains(Const.StatusMessages.FEEDBACK_SESSION_MOVED_TO_RECYCLE_BIN)); - - assertNotNull(BackDoor.getFeedbackSessionFromRecycleBin(courseId, feedbackSessionName)); - } - - private InstructorFeedbackEditPage getFeedbackEditPage() { - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) - .withUserId(instructorId) - .withCourseId(courseId) - .withSessionName(feedbackSessionName) - .withEnableSessionEditDetails(true); - return loginAdminToPageOld(feedbackPageLink, InstructorFeedbackEditPage.class); - } - - private InstructorFeedbackEditPage getFeedbackEditPageOfCourseWithoutQuestions() { - String instructor = testData.instructors.get("teammates.test.instructor3").googleId; - String courseWithoutQuestion = testData.courses.get("course2").getId(); - String sessionWithoutQuestions = testData.feedbackSessions.get("openSession3") - .getFeedbackSessionName(); - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) - .withUserId(instructor) - .withCourseId(courseWithoutQuestion) - .withSessionName(sessionWithoutQuestions) - .withEnableSessionEditDetails(true); - return loginAdminToPageOld(feedbackPageLink, InstructorFeedbackEditPage.class); - } - - private InstructorFeedbackEditPage getFeedbackEditPageOfSessionIndDstCourse() { - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_EDIT_PAGE) - .withUserId(testData.instructors.get("instructorOfDstCourse").googleId) - .withCourseId(testData.courses.get("courseWithDstTimeZone").getId()) - .withSessionName(testData.feedbackSessions.get("dstSession").getFeedbackSessionName()) - .withEnableSessionEditDetails(true); - return loginAdminToPageOld(feedbackPageLink, InstructorFeedbackEditPage.class); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackResultsPageResponseCommentUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackResultsPageResponseCommentUiTest.java deleted file mode 100644 index a26b9943c40..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackResultsPageResponseCommentUiTest.java +++ /dev/null @@ -1,313 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.pageobjects.InstructorFeedbackResultsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_RESULTS_PAGE}, - * specifically for feedback response comments. - */ -public class InstructorFeedbackResultsPageResponseCommentUiTest extends BaseE2ETestCase { - - @Override - protected void prepareTestData() { - // see prepareData() - } - - @BeforeMethod - public void prepareData() { - testData = loadDataBundle("/InstructorFeedbackResultsPageResponseCommentUiTest.json"); - removeAndRestoreDataBundle(testData); - } - - @Test - public void testFeedbackResponseCommentActionsForQuestionsView() { - InstructorFeedbackResultsPage resultsPage; - - ______TS("Question view: Failure case: add an empty feedback response comment using comment modal"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - resultsPage.displayByQuestion(); - resultsPage.loadResultQuestionPanel(1); - - addEmptyCommentToResponseAndCheckStatusMessage("-2-1-1", resultsPage); - - ______TS("Question view: Typical case: add new feedback response comments using comment modal"); - - addCommentToValidResponseAndVerify("-2-1-1", resultsPage); - addCommentToValidResponseAndVerify("-3-1-1", resultsPage); - - ______TS("Question view: Typical case: edit an existing feedback response comment using comment modal"); - - editFirstCommentOnResponseAndVerify("-2-1-1", "edited test comment", resultsPage); - - ______TS("Question view: Typical case: edit comment created by different instructors using comment modal"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr2", "Open Session"); - resultsPage.displayByQuestion(); - resultsPage.loadResultQuestionPanel(2); - - editFirstCommentAndVisibilityAndVerify("-1-1-2", "Comment edited by different instructor", - resultsPage); - - ______TS("Question view: Typical case: delete existing feedback response comments using comment modal"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - resultsPage.displayByQuestion(); - resultsPage.loadResultQuestionPanel(1); - - deleteFirstCommentAndVerify("-2-1-1", resultsPage); - deleteFirstCommentAndVerify("-3-1-1", resultsPage); - - ______TS("Question view: Typical case: add edit and delete successively"); - - addEditAndDeleteTypicalCommentAndVerify("-2-1-1", resultsPage); - } - - @Test - public void testFeedbackResponseCommentActionsForGqrView() { - InstructorFeedbackResultsPage resultsPage; - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - - ______TS("GQR view: Failure case: add empty feedback response comment using comment modal"); - - resultsPage.displayByGiverQuestionRecipient(); - resultsPage.loadResultSectionPanel(1, 2); - addEmptyCommentToResponseAndCheckStatusMessage("-2-0-1", resultsPage); - - ______TS("GQR view: Typical case: add new feedback response comments using comment modal"); - addCommentToValidResponseAndVerify("-2-0-1", resultsPage); - addCommentToValidResponseAndVerify("-9-0-1", resultsPage); - - ______TS("GQR view: Typical case: edit an existing feedback response comment using comment modal"); - editFirstCommentOnResponseAndVerify("-2-0-1", "edited test comment", resultsPage); - - ______TS("GQR view: Typical case: edit comment created by different instructors using comment modal"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr2", "Open Session"); - resultsPage.displayByGiverQuestionRecipient(); - resultsPage.loadResultSectionPanel(0, 1); - - editFirstCommentOnResponseAndVerify("-2-0-1", "Comment edited by different instructor", - resultsPage); - - ______TS("GQR view: Typical case: delete existing feedback response comments using comment modal"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - resultsPage.displayByGiverQuestionRecipient(); - resultsPage.loadResultSectionPanel(1, 2); - - deleteFirstCommentAndVerify("-2-0-1", resultsPage); - deleteFirstCommentAndVerify("-9-0-1", resultsPage); - - ______TS("GQR view: Typical case: add edit and delete successively"); - - addEditAndDeleteTypicalCommentAndVerify("-2-0-1", resultsPage); - } - - @Test - public void testFeedbackResponseCommentActionsForRqgView() { - InstructorFeedbackResultsPage resultsPage; - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - - ______TS("RQG view: Failure case: add empty feedback response comment using comment modal"); - - resultsPage.displayByRecipientQuestionGiver(); - resultsPage.loadResultSectionPanel(1, 2); - addEmptyCommentToResponseAndCheckStatusMessage("-0-8-1", resultsPage); - - ______TS("RQG view: Typical case: add new feedback response comments using comment modal"); - addCommentToValidResponseAndVerify("-0-8-1", resultsPage); - addCommentToValidResponseAndVerify("-0-0-7", resultsPage); - - ______TS("RQG view: Typical case: edit an existing feedback response comment using comment modal"); - editFirstCommentOnResponseAndVerify("-0-8-1", "edited test comment", resultsPage); - - ______TS("RQG view: Typical case: edit comment created by different instructors using comment modal"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr2", "Open Session"); - resultsPage.displayByRecipientQuestionGiver(); - resultsPage.loadResultSectionPanel(0, 1); - - editFirstCommentOnResponseAndVerify("-0-8-1", "Comment edited by different instructor", - resultsPage); - - ______TS("RQG view: Typical case: delete existing feedback response comments using comment modal"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - resultsPage.displayByRecipientQuestionGiver(); - resultsPage.loadResultSectionPanel(1, 2); - - deleteFirstCommentAndVerify("-0-8-1", resultsPage); - deleteFirstCommentAndVerify("-0-0-7", resultsPage); - - ______TS("RQG view: Typical case: add edit and delete successively"); - - addEditAndDeleteTypicalCommentAndVerify("-0-8-1", resultsPage); - } - - @Test - public void testFeedbackResponseCommentActionsForRgqView() throws Exception { - InstructorFeedbackResultsPage resultsPage; - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - - ______TS("RGQ view: Failure case: add empty feedback response comment"); - - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.addFeedbackResponseComment("showResponseCommentAddForm-0-0-1-1", ""); - resultsPage.waitForCommentFormErrorMessageEquals("-0-0-1-1", Const.StatusMessages.FEEDBACK_RESPONSE_COMMENT_EMPTY); - - ______TS("RGQ view: Typical case: add new feedback response comments"); - - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.addFeedbackResponseComment("showResponseCommentAddForm-0-0-1-1", "test comment 1"); - resultsPage.addFeedbackResponseComment("showResponseCommentAddForm-0-0-1-1", "test comment 2"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-1-0-1-1", "test comment 1", "Teammates Test"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-1-0-1-2", "test comment 2", "Teammates Test"); - - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAddComment.html"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-0-1-1-1", "test comment 1", "Teammates Test"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-0-1-1-2", "test comment 2", "Teammates Test"); - - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.addFeedbackResponseComment("showResponseCommentAddForm-1-1-1-1", "test comment 3"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-1-1-1-1-1", "test comment 3", "Teammates Test"); - - ______TS("RGQ view: Typical case: edit existing feedback response comment"); - - resultsPage.editFeedbackResponseCommentInOpenedCommentModal("-1-1-1-1-1", "edited test comment"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-1-1-1-1-1", - "edited test comment", "Teammates Test"); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsEditComment.html"); - - ______TS("RGQ view: Typical case: edit comment created by different instructor"); - - resultsPage.editFeedbackResponseCommentInOpenedCommentModal("-1-0-1-1-1", "Comment edited by different instructor"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-1-0-1-1-1", - "Comment edited by different instructor", "Teammates Test"); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsEditCommentByDifferentInstructor.html"); - - ______TS("RGQ view: Typical case: delete existing feedback response comment"); - - resultsPage.deleteFeedbackResponseCommentInline("-1-1-1-1-1"); - resultsPage.verifyCommentRowMissing("-1-1-1-1-1"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-0-1-1-2", "test comment 2", "Teammates Test"); - - ______TS("RGQ view: Typical case: add edit and delete successively"); - - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.addFeedbackResponseComment("showResponseCommentAddForm-0-0-1-1", "successive action comment"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-1-0-1-3", - "successive action comment", "Teammates Test"); - - resultsPage.editFeedbackResponseCommentInOpenedCommentModal("-0-1-0-1-3", "edited successive action comment"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-1-0-1-3", "edited successive action comment", - "Teammates Test"); - resultsPage.clickVisibilityOptionForResponseCommentAndSave("responseCommentRow-0-1-0-1-3", 1); - - resultsPage.deleteFeedbackResponseCommentInline("-0-1-0-1-3"); - resultsPage.verifyCommentRowMissing("-0-0-1-1-3"); - - resultsPage = loginToInstructorFeedbackResultsPage("IFRResponseCommentUiT.instr", "Open Session"); - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded("-0-0-1-1-2", "test comment 2", "Teammates Test"); - resultsPage.verifyCommentRowMissing("-0-0-1-1-3"); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsDeleteComment.html"); - } - - private InstructorFeedbackResultsPage loginToInstructorFeedbackResultsPage(String instructorName, String fsName) { - AppUrl resultsUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_RESULTS_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(resultsUrl, InstructorFeedbackResultsPage.class); - } - - private void addEmptyCommentToResponseAndCheckStatusMessage(String commentModelId, - InstructorFeedbackResultsPage resultsPage) { - // TODO: `clickCommentModalButton` should wait for modal to open before returning - resultsPage.clickCommentModalButton(commentModelId); - resultsPage.addFeedbackResponseCommentInCommentModal("showResponseCommentAddForm" + commentModelId, ""); - // TODO: all instances of this should do an immediate check instead of waiting for the error message - resultsPage.waitForCommentFormErrorMessageEquals(commentModelId, - Const.StatusMessages.FEEDBACK_RESPONSE_COMMENT_EMPTY); - resultsPage.closeCommentModal(commentModelId); - } - - // Add first comment to response - private void addCommentToValidResponseAndVerify(String commentModelId, InstructorFeedbackResultsPage resultsPage) { - String commentId = commentModelId + "-1"; - resultsPage.clickCommentModalButton(commentModelId); - // TODO: Wait for comment to be added before returning - resultsPage.addFeedbackResponseCommentInCommentModal("showResponseCommentAddForm" + commentModelId, - "test comment 1"); - // TODO: all instances of this should do an immediate check instead of waiting for the comment to be added. - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded(commentId, "test comment 1", "Teammates Test"); - resultsPage.closeCommentModal(commentModelId); - } - - private void editFirstCommentOnResponseAndVerify(String commentModelId, String commentText, - InstructorFeedbackResultsPage resultsPage) { - String commentId = commentModelId + "-1"; - resultsPage.clickCommentModalButton(commentModelId); - resultsPage.editFeedbackResponseCommentInOpenedCommentModal(commentId, commentText); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded(commentId, commentText, "Teammates Test"); - resultsPage.closeCommentModal(commentModelId); - } - - private void editFirstCommentAndVisibilityAndVerify(String commentModelId, String commentText, - InstructorFeedbackResultsPage resultsPage) { - String commentId = commentModelId + "-1"; - resultsPage.clickCommentModalButton(commentModelId); - resultsPage.editFeedbackResponseCommentInOpenedCommentModal(commentId, commentText); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded(commentId, commentText, "Teammates Test"); - resultsPage.clickVisibilityOptionForResponseCommentAndSave("responseCommentRow" + commentId, 1); - resultsPage.closeCommentModal(commentModelId); - } - - private void deleteFirstCommentAndVerify(String commentModelId, InstructorFeedbackResultsPage resultsPage) { - String commentId = commentModelId + "-1"; - resultsPage.clickCommentModalButton(commentModelId); - resultsPage.deleteFeedbackResponseCommentInModal(commentId); - resultsPage.verifyCommentRowMissing(commentId); - resultsPage.closeCommentModal(commentModelId); - } - - private void addEditAndDeleteTypicalCommentAndVerify(String commentModelId, - InstructorFeedbackResultsPage resultsPage) { - String commentId = commentModelId + "-1"; - resultsPage.clickCommentModalButton(commentModelId); - resultsPage.addFeedbackResponseCommentInCommentModal("showResponseCommentAddForm" + commentModelId, - "successive action comment"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded(commentId, "successive action comment", "Teammates Test"); - - resultsPage.editFeedbackResponseCommentInOpenedCommentModal(commentId, "edited successive action comment"); - resultsPage.waitAndVerifyForFeedbackResponseCommentAdded(commentId, "edited successive action comment", - "Teammates Test"); - resultsPage.clickVisibilityOptionForResponseCommentAndSave("responseCommentRow" + commentId, 1); - - resultsPage.deleteFeedbackResponseCommentInModal(commentId); - resultsPage.closeCommentModal(commentModelId); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackResultsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackResultsPageUiTest.java deleted file mode 100644 index 0f358f286ac..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackResultsPageUiTest.java +++ /dev/null @@ -1,721 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.io.File; - -import org.openqa.selenium.By; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.JsonUtils; -import teammates.common.util.SanitizationHelper; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.driver.FileHelper; -import teammates.test.pageobjects.InstructorFeedbackEditPage; -import teammates.test.pageobjects.InstructorFeedbackResultsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_RESULTS_PAGE}. - */ -@Priority(-1) -public class InstructorFeedbackResultsPageUiTest extends BaseE2ETestCase { - - private InstructorFeedbackResultsPage resultsPage; - - @Override - protected void prepareTestData() { - // the actual test data is refreshed before each test method - } - - @BeforeMethod - public void refreshTestData() { - testData = loadDataBundle("/InstructorFeedbackResultsPageUiTest.json"); - removeAndRestoreDataBundle(testData); - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); - } - - @Test - public void testHtmlContent() throws Exception { - testContent(); - testModerateResponsesButton(); - } - - @Test - public void testFrontEndActions() throws Exception { - testSortAction(); - testFilterAction(); - testPanelsCollapseExpand(); - testShowStats(); - testRemindAllAction(); - } - - private void testContent() throws Exception { - - ______TS("Typical case: large session with no sections"); - - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", - "Session with no sections", true, "question"); - resultsPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESULTS_QUESTIONVIEWWARNING); - - ______TS("Typical case: standard session results"); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - // This is the full HTML verification for Instructor Feedback Results Page, the rest can all be verifyMainHtml - resultsPage.verifyHtml("/instructorFeedbackResultsPageOpen.html"); - - ______TS("Typical case: standard session results: helper view"); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.helper1", "Open Session"); - resultsPage.loadResultQuestionPanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageOpenViewForHelperOne.html"); - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.helper2", "Open Session"); - resultsPage.loadResultQuestionPanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageOpenViewForHelperTwo.html"); - - ______TS("Typical case: empty session"); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Empty Session"); - resultsPage.loadResultQuestionPanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageEmpty.html"); - - } - - @Test - public void testExceptionalCases() throws Exception { - ______TS("Case where more than 1 question with same question number"); - // results page should be able to load incorrect data and still display it gracefully - - FeedbackQuestionAttributes firstQuestion = testData.feedbackQuestions.get("qn1InSession4"); - assertEquals(1, firstQuestion.questionNumber); - FeedbackQuestionAttributes firstQuestionFromDatastore = - BackDoor.getFeedbackQuestion(firstQuestion.courseId, - firstQuestion.feedbackSessionName, - firstQuestion.questionNumber); - - FeedbackQuestionAttributes secondQuestion = testData.feedbackQuestions.get("qn2InSession4"); - assertEquals(2, secondQuestion.questionNumber); - // need to retrieve question from datastore to get its questionId - FeedbackQuestionAttributes secondQuestionFromDatastore = - BackDoor.getFeedbackQuestion(secondQuestion.courseId, - secondQuestion.feedbackSessionName, - secondQuestion.questionNumber); - assertEquals(secondQuestion, secondQuestionFromDatastore); - // make both questions have the same question number - secondQuestionFromDatastore.questionNumber = 1; - BackDoor.editFeedbackQuestion(secondQuestionFromDatastore); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Session with errors"); - resultsPage.loadResultQuestionPanel(1); - resultsPage.loadResultQuestionPanel(2); - // compare html for each question panel - // to verify that the right responses are showing for each question - By firstQuestionPanelResponses = By.xpath("//div[contains(@class,'panel')][.//input[@name='questionid'][@value='" - + firstQuestionFromDatastore.getId() + "']]" - + "//div[contains(@class, 'table-responsive')]"); - resultsPage.verifyHtmlPart(firstQuestionPanelResponses, - "/instructorFeedbackResultsDuplicateQuestionNumberPanel1.html"); - - By secondQuestionPanelResponses = By.xpath("//div[contains(@class,'panel')][.//input[@name='questionid'][@value='" - + secondQuestionFromDatastore.getId() + "']]" - + "//div[contains(@class, 'table-responsive')]"); - resultsPage.verifyHtmlPart(secondQuestionPanelResponses, - "/instructorFeedbackResultsDuplicateQuestionNumberPanel2.html"); - - ______TS("Results with sanitized data"); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.SanitizedTeam.instr", - "Session with sanitized data"); - resultsPage.loadResultQuestionPanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageWithSanitizedData.html"); - - ______TS("Results with sanitized data with comments : giver > recipient > question"); - - resultsPage.displayByGiverRecipientQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsPageGQRWithSanitizedData.html"); - } - - private void testModerateResponsesButton() { - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); - resultsPage.displayByQuestion(); - resultsPage.loadResultQuestionPanel(2); - resultsPage.loadResultQuestionPanel(4); - - ______TS("Typical case: test moderate responses button for individual response (including no response)"); - - verifyModerateResponsesButton(2, "CFResultsUiT.alice.b@gmail.tmt", "CFResultsUiT.benny.c@gmail.tmt", - "CFResultsUiT.fred.g@gmail.tmt", "CFResultsUiT.charlie.d@gmail.tmt", - "CFResultsUiT.danny.e@gmail.tmt", "drop.out@gmail.tmt", - "extra.guy@gmail.tmt", "CFResultsUiT.emily.f@gmail.tmt"); - - ______TS("Typical case: test moderate responses button for team response"); - - verifyModerateResponsesButton(4, "Team 1'\""); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Session with Instructors as Givers"); - resultsPage.displayByQuestion(); - resultsPage.loadResultQuestionPanel(1); - - ______TS("Typical case: test moderate responses button for instructors as givers"); - verifyModerateResponsesButton(1, "CFResultsUiT.instr@gmail.tmt", "CFResultsUiT.instr@gmail.tmt", - "CFResultsUiT.instr@gmail.tmt"); - - } - - private void testSortAction() throws Exception { - - ______TS("Typical case: test sort by giver > recipient > question"); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Open Session"); - resultsPage.displayByGiverRecipientQuestion(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortGiverRecipientQuestionTeam.html"); - - String additionalInfoId = "section-1-giver-1-recipient-1"; - int qnNumber = 8; - verifyQuestionAdditionalInfoExpand(qnNumber, additionalInfoId); - verifyQuestionAdditionalInfoCollapse(qnNumber, additionalInfoId); - - ______TS("test sort by recipient > giver > question"); - - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortRecipientGiverQuestionTeam.html"); - - additionalInfoId = "section-1-giver-1-recipient-0"; - qnNumber = 8; - verifyQuestionAdditionalInfoExpand(qnNumber, additionalInfoId); - verifyQuestionAdditionalInfoCollapse(qnNumber, additionalInfoId); - - ______TS("test sort by giver > question > recipient"); - - resultsPage.displayByGiverQuestionRecipient(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortGiverQuestionRecipientTeam.html"); - - ______TS("test sort by recipient > question > giver"); - - resultsPage.displayByRecipientQuestionGiver(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortRecipientQuestionGiverTeam.html"); - - // Do not sort by team - resultsPage.clickGroupByTeam(); - - ______TS("test order in giver > recipient > question team"); - - resultsPage.displayByGiverRecipientQuestion(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortGiverRecipientQuestion.html"); - - ______TS("test order in recipient > giver > question team"); - - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortRecipientGiverQuestion.html"); - - ______TS("test order in giver > question > recipient team"); - - resultsPage.displayByGiverQuestionRecipient(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortGiverQuestionRecipient.html"); - - ______TS("test order in recipient > question > giver team"); - - resultsPage.displayByRecipientQuestionGiver(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortRecipientQuestionGiver.html"); - - ______TS("test sort by question"); - - // By question - resultsPage.displayByQuestion(); - resultsPage.loadResultQuestionPanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortQuestionTeam.html"); - - additionalInfoId = ""; - qnNumber = 8; - verifyQuestionAdditionalInfoExpand(qnNumber, additionalInfoId); - verifyQuestionAdditionalInfoCollapse(qnNumber, additionalInfoId); - - ______TS("Typical case: test in-table sort"); - - verifySortingOrder(By.id("button_sortFeedback"), - "1 Response to Danny.", - "2 Response to Benny.", - "3 Response to Emily.", - "4 Response to Charlie."); - - verifySortingOrder(By.id("button_sortFromName"), - "Alice Betsy", - "Benny Charles", - "Benny Charles", - "Charlie Dávis"); - - verifySortingOrder(By.id("button_sortFromTeam"), - "Team 1", - "Team 1", - "Team 2", - "Team 2"); - - verifySortingOrder(By.id("button_sortToName"), - "Benny Charles", - "Charlie Dávis", - "Danny Engrid", - "Emily"); - - // TODO: Test sorting fully instead of partially. - verifySortingOrder(By.id("button_sortToTeam"), - SanitizationHelper.sanitizeForHtmlTag("Team 1'\"{*}Team 1'\""), - SanitizationHelper.sanitizeForHtmlTag("Team 1'\"{*}Team 2"), - SanitizationHelper.sanitizeForHtmlTag("Team 1'\"{*}Team 2"), - "Team 2{*}Team 3"); - - } - - @Test - public void testVisibilityOptions() throws Exception { - ______TS("test sort by giver > recipient > question for second session"); - - resultsPage = loginToInstructorFeedbackResultsPage("CFResultsUiT.instr", "Unpublished Session"); - resultsPage.displayByGiverRecipientQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestionTeam.html"); - - ______TS("test sort by recipient > giver > question for second session"); - - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestionTeam.html"); - - ______TS("test sort by giver > question > recipient for second session"); - - resultsPage.displayByGiverQuestionRecipient(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipientTeam.html"); - - ______TS("test sort by recipient > question > giver for second session"); - - resultsPage.displayByRecipientQuestionGiver(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiverTeam.html"); - - // Do not sort by team - resultsPage.clickGroupByTeam(); - - ______TS("test order in giver > recipient > question team for second session"); - - resultsPage.displayByGiverRecipientQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestion.html"); - ______TS("test order in recipient > giver > question team for second session"); - - resultsPage.displayByRecipientGiverQuestion(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestion.html"); - - ______TS("test order in giver > question > recipient team for second session"); - - resultsPage.displayByGiverQuestionRecipient(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipient.html"); - - ______TS("test order in recipient > question > giver team for second session"); - - resultsPage.displayByRecipientQuestionGiver(); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiver.html"); - - ______TS("test sort by question for second session"); - resultsPage.displayByQuestion(); - resultsPage.loadResultQuestionPanel(2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionQuestionTeam.html"); - - ______TS("filter by section A"); - - resultsPage.filterResponsesForSection("Section A"); - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsSortSecondSessionFilteredBySectionATeam.html"); - } - - @Test - public void testViewPhotoAndAjaxForLargeScaledSession() throws Exception { - - // Mouseover actions do not work on Selenium-Chrome - if ("chrome".equals(TestProperties.BROWSER)) { - return; - } - - uploadPhotoForStudent(testData.students.get("Alice").googleId); - - ______TS("Typical case: ajax for view by questions"); - - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", - "Open Session", true, "question"); - - resultsPage.loadResultLargeScalePanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAjaxByQuestion.html"); - - ______TS("Failure case: Ajax error"); - - // Change fs name so that the ajax request will fail - resultsPage.changeFsNameInAjaxLoadResponsesForm(1, "invalidFsName"); - resultsPage.clickElementById("panelHeading-3"); - resultsPage.waitForAjaxError(1); - - resultsPage.changeFsNameInNoResponsePanelForm("InvalidFsName"); - resultsPage.clickElementById("panelHeading-12"); - resultsPage.waitForAjaxErrorOnNoResponsePanel(); - - ______TS("Typical case: test view photo for view by questions"); - - resultsPage.removeNavBar(); - resultsPage.hoverClickAndViewGiverPhotoOnTableCell( - 0, 0, "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - resultsPage.hoverClickAndViewRecipientPhotoOnTableCell(0, 0, Const.SystemParams.DEFAULT_PROFILE_PICTURE_PATH); - - ______TS("Typical case: ajax for view by question for helper 1"); - - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.helper1", - "Open Session", true, "question"); - - resultsPage.loadResultLargeScalePanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAjaxByQuestionViewForHelperOne.html"); - - ______TS("Typical case: ajax for view by question for helper2"); - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.helper2", - "Open Session", true, "question"); - - resultsPage.loadResultLargeScalePanel(1); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAjaxByQuestionViewForHelperTwo.html"); - - ______TS("Typical case: ajax for view by giver > recipient > question"); - - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Open Session", true, - "giver-recipient-question"); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAjaxByGRQ.html"); - - ______TS("Typical case: test view photo for view by giver > recipient > question"); - - resultsPage.removeNavBar(); - resultsPage.hoverClickAndViewStudentPhotoOnHeading("1-1", - "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - resultsPage.hoverAndViewStudentPhotoOnBody("1-1", - "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - resultsPage.hoverClickAndViewStudentPhotoOnHeading("1-2", Const.SystemParams.DEFAULT_PROFILE_PICTURE_PATH); - - ______TS("Typical case: ajax for view by giver > question > recipient"); - - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Open Session", true, - "giver-question-recipient"); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAjaxByGQR.html"); - - ______TS("Typical case: test view photo for view by giver > question > recipient"); - - resultsPage.removeNavBar(); - resultsPage.hoverClickAndViewStudentPhotoOnHeading("1-1", - "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - resultsPage.clickViewPhotoLink("1-2", Const.SystemParams.DEFAULT_PROFILE_PICTURE_PATH); - - ______TS("Typical case: ajax for view by recipient > question > giver"); - - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Open Session", true, - "recipient-question-giver"); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAjaxByRQG.html"); - - ______TS("Typical case: test view photo for view by recipient > question > giver"); - - resultsPage.removeNavBar(); - resultsPage.hoverClickAndViewStudentPhotoOnHeading("1-1", - "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - resultsPage.clickViewPhotoLink("1-2", "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - - ______TS("Typical case: ajax for view by recipient > giver > question"); - - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Open Session", true, - "recipient-giver-question"); - resultsPage.loadResultSectionPanel(1, 2); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsAjaxByRGQ.html"); - - ______TS("Typical case: test view photo for view by recipient > giver > question"); - - resultsPage.removeNavBar(); - resultsPage.hoverClickAndViewStudentPhotoOnHeading("1-1", - "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - resultsPage.hoverAndViewStudentPhotoOnBody("1-1", - "studentProfilePic?studentemail={*}&courseid={*}&user=CFResultsUiT.instr"); - resultsPage.hoverClickAndViewStudentPhotoOnHeading("1-2", Const.SystemParams.DEFAULT_PROFILE_PICTURE_PATH); - } - - @Test - public void testViewNoSpecificSection() { - ______TS("No Specific Section shown for recipient > question > giver with General Feedback"); - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Open Session", true, - "recipient-question-giver"); - assertTrue(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - - ______TS("No Specific Section shown for recipient > giver > recipient with Feedback to Instructor"); - resultsPage.displayByRecipientGiverQuestion(); - assertTrue(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - - ______TS("No Specific Section shown giver > question > recipient with Feedback from Instructor"); - resultsPage.displayByGiverQuestionRecipient(); - assertTrue(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - - ______TS("No Specific Section shown for recipient > question > giver with Feedback to Instructor"); - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Unpublished Session", - true, "recipient-question-giver"); - assertTrue(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - - ______TS("No Specific Section not shown for recipient > question > giver with no General Feedback"); - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", - "Session with sanitized data", true, "recipient-question-giver"); - assertFalse(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - - ______TS("No Specific Section not shown for giver > question > recipient with no Feedback from Instructor"); - resultsPage.displayByGiverQuestionRecipient(); - assertFalse(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - - ______TS("No Specific Section shown for giver > question > recipient with student in No Specific Section"); - resultsPage = loginToInstructorFeedbackResultsPageWithViewType("CFResultsUiT.instr", "Session with no sections", - true, "giver-question-recipient"); - assertTrue(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - - ______TS("No Specific Section shown for recipient > question > giver with student in No Specific Section"); - resultsPage.displayByRecipientQuestionGiver(); - assertTrue(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - } - - private void testFilterAction() throws Exception { - - ______TS("Typical case: filter by section A"); - - resultsPage.filterResponsesForSection("Section A"); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsFilteredBySectionA.html"); - - ______TS("Typical case: filter by section B, no responses"); - - resultsPage.filterResponsesForSection("Section B"); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsFilteredBySectionB.html"); - - ______TS("Typical case: filter by 'No specific section'"); - - resultsPage.filterResponsesForSection(Const.NO_SPECIFIC_SECTION); - resultsPage.verifyHtmlMainContent("/instructorFeedbackResultsFilteredByNoSection.html"); - - ______TS("Verify that 'No specific section' has a section panel on a non-question view"); - resultsPage.displayByRecipientGiverQuestion(); - assertTrue(resultsPage.isSectionPanelExist(Const.NO_SPECIFIC_SECTION)); - assertFalse(resultsPage.isSectionPanelExist("Section A")); - - resultsPage.displayByQuestion(); - resultsPage.filterResponsesForAllSections(); - } - - private void testPanelsCollapseExpand() { - - ______TS("Test that 'Collapse Student' button is working"); - resultsPage.clickGroupByTeam(); - resultsPage.displayByGiverRecipientQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.waitForElementPresence(By.id("collapse-panels-button-team-0")); - assertEquals("Collapse Students", resultsPage.instructorPanelCollapseStudentsButton.getText()); - resultsPage.clickInstructorPanelCollapseStudentsButton(); - resultsPage.waitForInstructorPanelStudentPanelsToCollapse(); - assertEquals("Expand Students", resultsPage.instructorPanelCollapseStudentsButton.getText()); - resultsPage.verifySpecifiedPanelIdsAreCollapsed(new String[] { "0-2", "0-3", "0-4" }); - - resultsPage.clickGroupByTeam(); - - resultsPage.displayByGiverRecipientQuestion(); - resultsPage.loadResultSectionPanel(0, 1); - resultsPage.clickSectionCollapseStudentsButton(); - resultsPage.waitForSectionStudentPanelsToCollapse(); - - resultsPage.displayByQuestion(); - - ______TS("Typical case: panels expand/collapse"); - - assertEquals("Expand All Questions", resultsPage.collapseExpandButton.getText()); - assertEquals("Expand all panels. You can also click on the panel heading to toggle each one individually.", - resultsPage.collapseExpandButton.getAttribute("data-original-title")); - resultsPage.verifyResultsHidden(); - - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - assertEquals("Collapse All Questions", resultsPage.collapseExpandButton.getText()); - assertEquals("Collapse all panels. You can also click on the panel heading to toggle each one individually.", - resultsPage.collapseExpandButton.getAttribute("data-original-title")); - resultsPage.verifyResultsVisible(); - - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToCollapse(); - assertEquals("Expand All Questions", resultsPage.collapseExpandButton.getText()); - assertEquals("Expand all panels. You can also click on the panel heading to toggle each one individually.", - resultsPage.collapseExpandButton.getAttribute("data-original-title")); - resultsPage.verifyResultsHidden(); - } - - private void testShowStats() { - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - - ______TS("Typical case: show stats"); - - assertEquals(resultsPage.showStatsCheckbox.getAttribute("checked"), "true"); - assertTrue(resultsPage.verifyAllStatsVisibility()); - - resultsPage.clickShowStats(); - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - assertNull(resultsPage.showStatsCheckbox.getAttribute("checked")); - assertFalse(resultsPage.verifyAllStatsVisibility()); - - resultsPage.clickShowStats(); - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - assertEquals(resultsPage.showStatsCheckbox.getAttribute("checked"), "true"); - assertTrue(resultsPage.verifyAllStatsVisibility()); - - } - - private void testRemindAllAction() { - - ______TS("Typical case: remind all: click on cancel"); - - resultsPage.clickRemindAllButtonAndWaitForFormToLoad(); - resultsPage.cancelRemindAllForm(); - - ______TS("Typical case: remind all: click on remind with no students selected"); - - resultsPage.clickRemindAllButtonAndWaitForFormToLoad(); - resultsPage.deselectUsersInRemindAllForm(); - resultsPage.clickRemindButtonInModal(); - resultsPage.waitForAjaxLoaderGifToDisappear(); - resultsPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_SESSION_REMINDERSEMPTYRECIPIENT); - - ______TS("Typical case: remind all: click on remind with students selected"); - - resultsPage.clickRemindAllButtonAndWaitForFormToLoad(); - resultsPage.clickRemindButtonInModal(); - resultsPage.waitForAjaxLoaderGifToDisappear(); - resultsPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); - } - - @Test - public void testIndicateMissingResponses() { - - ______TS("Typical case: Hide Missing Responses"); - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - assertTrue(resultsPage.indicateMissingResponsesCheckbox.isSelected()); - assertFalse(resultsPage.verifyMissingResponsesVisibility()); - - resultsPage.clickIndicateMissingResponses(); - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - assertFalse(resultsPage.indicateMissingResponsesCheckbox.isSelected()); - assertTrue(resultsPage.verifyMissingResponsesVisibility()); - - resultsPage.clickIndicateMissingResponses(); - resultsPage.clickCollapseExpandButtonAndWaitForPanelsToExpand(); - assertTrue(resultsPage.indicateMissingResponsesCheckbox.isSelected()); - assertFalse(resultsPage.verifyMissingResponsesVisibility()); - } - - @Test - public void testLink() { - ______TS("action: test that edit link leads to correct edit page"); - - InstructorFeedbackEditPage editPage = resultsPage.clickEditLink(); - editPage.verifyContains("Edit Feedback Session"); - assertEquals("CFResultsUiT.CS2104", editPage.getCourseId()); - assertEquals("First Session", editPage.getFeedbackSessionName()); - } - - private void uploadPhotoForStudent(String googleId) throws Exception { - File picture = new File("src/test/resources/images/profile_pic_updated.png"); - String pictureData = JsonUtils.toJson(FileHelper.readFileAsBytes(picture.getAbsolutePath())); - assertEquals("Unable to upload profile picture", "[BACKDOOR_STATUS_SUCCESS]", - BackDoor.uploadAndUpdateStudentProfilePicture(googleId, pictureData)); - } - - private InstructorFeedbackResultsPage loginToInstructorFeedbackResultsPage(String instructorName, String fsName) { - AppUrl resultsUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_RESULTS_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(resultsUrl, InstructorFeedbackResultsPage.class); - } - - private InstructorFeedbackResultsPage - loginToInstructorFeedbackResultsPageWithViewType(String instructorName, String fsName, - boolean needAjax, String viewType) { - AppUrl resultsUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_RESULTS_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - - if (needAjax) { - resultsUrl = resultsUrl.withParam(Const.ParamsNames.FEEDBACK_RESULTS_NEED_AJAX, - String.valueOf(needAjax)); - } - - if (viewType != null) { - resultsUrl = resultsUrl.withParam(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE, viewType); - } - - InstructorFeedbackResultsPage resultsPage = - loginAdminToPageOld(resultsUrl, InstructorFeedbackResultsPage.class); - - if (needAjax) { - resultsPage.waitForPageStructureToLoad(); - } else { - resultsPage.waitForPageToLoad(); - } - - return resultsPage; - } - - private void verifySortingOrder(By sortIcon, String... values) { - // check if the rows match the given order of values - resultsPage.click(sortIcon); - StringBuilder searchString = new StringBuilder(); - for (String value : values) { - searchString.append(value).append("{*}"); - } - resultsPage.verifyContains(searchString.toString()); - - // click the sort icon again and check for the reverse order - resultsPage.click(sortIcon); - searchString.setLength(0); - for (int i = values.length; i > 0; i--) { - searchString.append(values[i - 1]).append("{*}"); - } - resultsPage.verifyContains(searchString.toString()); - } - - private void verifyModerateResponsesButton(int qnNumber, String... emails) { - for (int i = 1; i <= emails.length; i++) { - resultsPage.verifyModerateResponseButtonBelongsTo( - resultsPage.getModerateResponseButtonInQuestionView(qnNumber, i), emails[i - 1]); - } - } - - private void verifyQuestionAdditionalInfoCollapse(int qnNumber, String additionalInfoId) { - resultsPage.clickQuestionAdditionalInfoButton(qnNumber, additionalInfoId); - assertFalse(resultsPage.isQuestionAdditionalInfoVisible(qnNumber, additionalInfoId)); - assertEquals("[more]", resultsPage.getQuestionAdditionalInfoButtonText(qnNumber, additionalInfoId)); - } - - private void verifyQuestionAdditionalInfoExpand(int qnNumber, String additionalInfoId) { - resultsPage.clickQuestionAdditionalInfoButton(qnNumber, additionalInfoId); - assertTrue(resultsPage.isQuestionAdditionalInfoVisible(qnNumber, additionalInfoId)); - assertEquals("[less]", resultsPage.getQuestionAdditionalInfoButtonText(qnNumber, additionalInfoId)); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackSessionsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackSessionsPageUiTest.java deleted file mode 100644 index 6888a311077..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackSessionsPageUiTest.java +++ /dev/null @@ -1,1128 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.time.Duration; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.Month; -import java.time.ZoneId; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; - -import org.openqa.selenium.By; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.FieldValidator; -import teammates.common.util.TimeHelper; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.test.driver.AssertHelper; -import teammates.test.driver.BackDoor; -import teammates.test.driver.StringHelperExtension; -import teammates.test.pageobjects.FeedbackSubmitPage; -import teammates.test.pageobjects.InstructorFeedbackEditPage; -import teammates.test.pageobjects.InstructorFeedbackResultsPage; -import teammates.test.pageobjects.InstructorFeedbackSessionsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSIONS_PAGE}. - */ -@Priority(-1) -public class InstructorFeedbackSessionsPageUiTest extends BaseE2ETestCase { - private InstructorFeedbackSessionsPage feedbackPage; - private String idOfInstructorWithSessions; - private CourseAttributes course; - /** This contains data for the new feedback session to be created during testing. */ - private FeedbackSessionAttributes newSession; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/InstructorFeedbackSessionsPageUiTest.json"); - course = testData.courses.get("anotherCourse"); - - newSession = FeedbackSessionAttributes - .builder("New Session ##", course.getId()) - .withCreatorEmail("teammates.test1@gmail.tmt") - .withStartTime(TimeHelper.parseInstant("2035-04-01 9:59 PM +0000")) - .withEndTime(TimeHelper.parseInstant("2035-04-30 8:00 PM +0000")) - .withSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING) - .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) - .withGracePeriod(Duration.ZERO) - .withInstructions("Please fill in the new feedback session.") - .withTimeZone(course.getTimeZone()) - .withIsClosingEmailEnabled(true) - .withIsPublishedEmailEnabled(true) - .build(); - - // the actual test data is refreshed before each test method - } - - @BeforeMethod - public void refreshTestData() { - testData = loadDataBundle("/InstructorFeedbackSessionsPageUiTest.json"); - removeAndRestoreDataBundle(testData); - idOfInstructorWithSessions = testData.accounts.get("instructorWithSessions").googleId; - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - } - - @Test - public void testLinks() { - testResponseRateLink(); - testViewResultsLink(); - testEditLink(); - testSubmitLink(); - } - - @Test - public void testButtons() { - testCopySessionModalButtons(); - } - - @Test - public void testMiscellaneous() throws Exception { - testAjaxErrorForLoadingSessionList(); - testValidationReload(); - testJScripts(); - } - - @Test - public void testCopyActions() throws Exception { - testCopyFromAction(); - testCopyToAction(); - } - - @Test - public void testAddDeleteActions() throws Exception { - testAddAction(); - testMoveToRecycleBinAction(); - } - - @Test - public void testRemindPublishActions() throws Exception { - testRemindActions(); - testPublishAndResendLinkAction(); - testUnpublishAction(); - } - - @Test - public void testRecycleBinActions() throws Exception { - testRestoreAction(); - testRestoreAllAction(); - testDeleteAction(); - testDeleteAllAction(); - } - - @Test - public void testContent() throws Exception { - - ______TS("no courses"); - - feedbackPage = getFeedbackPageForInstructor(testData.accounts.get("instructorWithoutCourses").googleId); - - // This is the full HTML verification for Instructor Feedbacks Page, the rest can all be verifyMainHtml - feedbackPage.verifyHtml("/instructorFeedbackEmptyAll.html"); - - ______TS("no sessions"); - - feedbackPage = getFeedbackPageForInstructor(testData.accounts.get("instructorWithoutSessions").googleId); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackEmptySession.html"); - - ______TS("typical case with helper view"); - - String helperId = testData.accounts.get("helperWithSessions").googleId; - - feedbackPage = getFeedbackPageForInstructor(helperId); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackAllSessionTypesWithHelperView.html"); - - ______TS("typical case, sort by name"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.verifyHtmlMainContent("/instructorFeedbackAllSessionTypes.html"); - - feedbackPage.sortByName().verifyTablePattern( - 0, 1, "Awaiting Session #{*}First Session #1{*}Manual Session #1{*}Open Session #"); - feedbackPage.sortByName().verifyTablePattern( - 0, 1, "Open Session #{*}Manual Session #1{*}First Session #1{*}Awaiting Session #"); - - ______TS("sort by course id"); - - feedbackPage.sortById().verifyTablePattern( - 0, 0, "CFeedbackUiT.CS1101{*}CFeedbackUiT.CS1101{*}CFeedbackUiT.CS2104{*}CFeedbackUiT.CS2104"); - feedbackPage.sortById().verifyTablePattern( - 0, 0, "CFeedbackUiT.CS2104{*}CFeedbackUiT.CS2104{*}CFeedbackUiT.CS1101{*}CFeedbackUiT.CS1101"); - - } - - private void testAddAction() throws Exception { - - // TODO: possibly remove some of the test cases below in the future - ______TS("ui test case: test two 'change' links for uncommon settings section"); - - By uncommonSettingsSection = By.id("uncommonSettingsSection"); - - feedbackPage.clickEditUncommonSettingsSendEmailsButton(); - feedbackPage.verifyHtmlPart(uncommonSettingsSection, - "/instructorFeedbackUncommonSettingsSendEmails.html"); - feedbackPage.clickEditUncommonSettingsSessionResponsesVisibleButton(); - feedbackPage.verifyHtmlPart(uncommonSettingsSection, - "/instructorFeedbackUncommonSettings.html"); - - feedbackPage.reloadPage(); - - feedbackPage.clickEditUncommonSettingsSessionResponsesVisibleButton(); - feedbackPage.verifyHtmlPart(uncommonSettingsSection, - "/instructorFeedbackUncommonSettingsSessionResponsesVisibility.html"); - feedbackPage.clickEditUncommonSettingsSendEmailsButton(); - feedbackPage.verifyHtmlPart(uncommonSettingsSection, - "/instructorFeedbackUncommonSettings.html"); - - ______TS("success case: defaults: visible when open, manual publish"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.selectSessionType("session with my own questions"); - - feedbackPage.clickEditUncommonSettingsButtons(); - - feedbackPage.clickManualPublishTimeButton(); - - String instructions = newSession.getInstructions(); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getEndTimeLocal(), newSession.getStartTimeLocal(), null, null, - instructions, newSession.getGracePeriodMinutes()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_SESSION_END_TIME_EARLIER_THAN_START_TIME); - assertEquals(getMockedTinyMceContent(instructions), feedbackPage.getInstructions()); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), null, null, - instructions, newSession.getGracePeriodMinutes()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_ADDED); - - FeedbackSessionAttributes savedSession = - BackDoor.getFeedbackSession(newSession.getCourseId(), newSession.getFeedbackSessionName()); - - newSession.setInstructions(getMockedTinyMceContent(instructions)); - assertEquals(newSession.toString(), savedSession.toString()); - newSession.setInstructions(instructions); - - // Check that we are redirected to the edit page. - feedbackPage.verifyHtmlMainContent("/instructorFeedbackAddSuccess.html"); - - ______TS("success case: Add a Team Peer Evaluation Session(template session)"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.clickEditUncommonSettingsButtons(); - feedbackPage.clickManualPublishTimeButton(); - - feedbackPage.selectSessionType("session using template: team peer evaluation"); - - String templateSessionName = "Team Peer Evaluation Session"; - feedbackPage.addFeedbackSession( - templateSessionName, newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_ADDED); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackTeamPeerEvalTemplateAddSuccess.html"); - //TODO: check that the questions created match. Maybe do that in action test. - - //Remove added session to prevent state leaks. - assertEquals("[BACKDOOR_STATUS_SUCCESS]", - BackDoor.deleteFeedbackSession(templateSessionName, newSession.getCourseId())); - - ______TS("success case: Add a session with DST time zone and gap start time"); - - course.setTimeZone(ZoneId.of("Pacific/Apia")); - BackDoor.editCourse(course); - - String dstSessionName = "DST Session"; - LocalDateTime gapStart = TimeHelper.parseDateTimeFromSessionsForm("Fri, 30 Dec, 2011", "7", "0"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.addFeedbackSession( - dstSessionName, newSession.getCourseId(), - gapStart, newSession.getEndTimeLocal(), null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - String gapWarning = String.format(Const.StatusMessages.AMBIGUOUS_LOCAL_DATE_TIME_GAP, - "start time", "Fri, 30 Dec 2011, 07:00 AM", "Sat, 31 Dec 2011, 07:00 AM WSDT (UTC+1400)"); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(gapWarning, Const.StatusMessages.FEEDBACK_SESSION_ADDED); - - assertEquals("[BACKDOOR_STATUS_SUCCESS]", - BackDoor.deleteFeedbackSession(dstSessionName, newSession.getCourseId())); - - course.setTimeZone(newSession.getTimeZone()); - BackDoor.editCourse(course); - - ______TS("failure case: session exists already"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_EXISTS); - - ______TS("success case: boundary length name, only results email"); - - CourseAttributes otherCourse = testData.courses.get("course"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.clickEditUncommonSettingsButtons(); - - newSession.setFeedbackSessionName("Session of characters12345678000000000"); - newSession.setCourseId(otherCourse.getId()); - newSession.setTimeZone(otherCourse.getTimeZone()); - newSession.setStartTime(TimeHelper.parseInstant("2035-05-01 6:00 AM +0000")); - newSession.setEndTime(newSession.getStartTime()); - newSession.setSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING); - newSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER); - - newSession.setClosingEmailEnabled(false); - newSession.setPublishedEmailEnabled(true); - - // disable emails for opening and closing - feedbackPage.toggleSendOpenEmailCheckbox(); - feedbackPage.toggleSendClosingEmailCheckbox(); - - // fill in defaults - newSession.setInstructions(getMockedTinyMceContent("Please answer all the given questions.")); - newSession.setGracePeriodMinutes(15); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - savedSession = BackDoor.getFeedbackSession(newSession.getCourseId(), newSession.getFeedbackSessionName()); - assertEquals(newSession.toString(), savedSession.toString()); - // set back to default course - newSession.setCourseId(course.getId()); - newSession.setTimeZone(course.getTimeZone()); - - ______TS("success case: closed session, custom session visible time, publish follows visible," - + " only open email, empty instructions"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.clickEditUncommonSettingsButtons(); - feedbackPage.clickCustomVisibleTimeButton(); - feedbackPage.clickDefaultPublishTimeButton(); - - newSession.setFeedbackSessionName("Allow Early Viewing Session #"); - - newSession.setStartTime(TimeHelper.parseInstant("2008-05-01 6:00 AM +0000")); - newSession.setEndTime(newSession.getStartTime()); - newSession.setGracePeriodMinutes(30); - - newSession.setSessionVisibleFromTime(TimeHelper.parseInstant("2008-03-01 3:00 PM +0000")); - newSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_VISIBLE); - - newSession.setInstructions(""); - - newSession.setClosingEmailEnabled(false); - newSession.setPublishedEmailEnabled(false); - - // toggle emails for closing and results - feedbackPage.toggleSendClosingEmailCheckbox(); - feedbackPage.toggleSendPublishedEmailCheckbox(); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), - newSession.getSessionVisibleFromTimeLocal(), null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - savedSession = BackDoor.getFeedbackSession(newSession.getCourseId(), newSession.getFeedbackSessionName()); - assertEquals(newSession.toString(), savedSession.toString()); - - ______TS("success case: open session, session visible atopen, responses hidden, open and close emails, " - + "special char instructions"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.clickEditUncommonSettingsButtons(); - feedbackPage.clickDefaultVisibleTimeButton(); - feedbackPage.clickManualPublishTimeButton(); - - instructions = "cannot see responses$^/\\=?"; - - newSession.setFeedbackSessionName("responses cant be seen my students 1 #"); - // start time in past - newSession.setStartTime(TimeHelper.parseInstant("2012-05-01 2:00 AM +0000")); - newSession.setEndTime(TimeHelper.parseInstant("2037-12-11 9:59 PM +0000")); - newSession.setSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING); - newSession.setResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER); - newSession.setGracePeriodMinutes(25); - newSession.setInstructions(getMockedTinyMceContent(instructions)); - newSession.setPublishedEmailEnabled(false); - newSession.setClosingEmailEnabled(true); - - // enable emails for closing - feedbackPage.toggleSendPublishedEmailCheckbox(); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - savedSession = BackDoor.getFeedbackSession(newSession.getCourseId(), newSession.getFeedbackSessionName()); - newSession.sanitizeForSaving(); - - assertEquals(newSession.toString(), savedSession.toString()); - - ______TS("success case: custom publish time, very looong instructions (~ 500 words)"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.clickEditUncommonSettingsButtons(); - feedbackPage.clickDefaultVisibleTimeButton(); - feedbackPage.clickCustomPublishTimeButton(); - newSession.setFeedbackSessionName("Long Instruction Test ##"); - newSession.setStartTime(TimeHelper.parseInstant("2012-05-01 8:00 AM +0000")); - newSession.setEndTime(TimeHelper.parseInstant("2012-09-01 11:00 PM +0000")); - newSession.setSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING); - // visible from time is in future, hence the year. - newSession.setResultsVisibleFromTime(TimeHelper.parseInstant("2035-09-01 11:00 PM +0000")); - newSession.setGracePeriodMinutes(5); - - newSession.setInstructions(StringHelperExtension.generateStringOfLength(3000)); - newSession.setPublishedEmailEnabled(true); - newSession.setClosingEmailEnabled(true); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), - null, newSession.getResultsVisibleFromTimeLocal(), - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - savedSession = BackDoor.getFeedbackSession(newSession.getCourseId(), newSession.getFeedbackSessionName()); - newSession.sanitizeForSaving(); - newSession.setInstructions(getMockedTinyMceContent(newSession.getInstructionsString())); - assertEquals(newSession.toString(), savedSession.toString()); - - ______TS("failure case: invalid input: (end < start < visible) and (publish < visible)"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.clickEditUncommonSettingsButtons(); - feedbackPage.clickCustomVisibleTimeButton(); - feedbackPage.clickCustomPublishTimeButton(); - - newSession.setFeedbackSessionName("invalid publish time #"); - newSession.setStartTime(TimeHelper.parseInstant("2012-05-01 12:00 PM +0000")); - newSession.setEndTime(TimeHelper.parseInstant("2012-05-01 8:00 AM +0000")); - - newSession.setSessionVisibleFromTime(TimeHelper.parseInstant("2012-05-01 2:00 PM +0000")); - newSession.setResultsVisibleFromTime(TimeHelper.parseInstant("2012-04-30 11:00 PM +0000")); - newSession.setGracePeriodMinutes(30); - newSession.setInstructions("Test instructions"); - - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), - newSession.getSessionVisibleFromTimeLocal(), newSession.getResultsVisibleFromTimeLocal(), - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - List expectedStatusStrings = new ArrayList<>(); - expectedStatusStrings.add(String.format( - FieldValidator.TIME_FRAME_ERROR_MESSAGE, - FieldValidator.RESULTS_VISIBLE_TIME_FIELD_NAME, - FieldValidator.SESSION_VISIBLE_TIME_FIELD_NAME)); - - expectedStatusStrings.add(String.format( - FieldValidator.TIME_FRAME_ERROR_MESSAGE, - FieldValidator.SESSION_START_TIME_FIELD_NAME, - FieldValidator.SESSION_VISIBLE_TIME_FIELD_NAME)); - - expectedStatusStrings.add(String.format( - FieldValidator.TIME_FRAME_ERROR_MESSAGE, - FieldValidator.SESSION_END_TIME_FIELD_NAME, - FieldValidator.SESSION_START_TIME_FIELD_NAME)); - - AssertHelper.assertContains(expectedStatusStrings, feedbackPage.getTextsForAllStatusMessagesToUser().get(0)); - - ______TS("failure case: invalid input (session name)"); - - //feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - newSession.setFeedbackSessionName("bad name %% #"); - newSession.setEndTime(Const.TIME_REPRESENTS_LATER); - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals( - getPopulatedErrorMessage(FieldValidator.INVALID_NAME_ERROR_MESSAGE, "bad name %% #", - FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME, FieldValidator.REASON_CONTAINS_INVALID_CHAR)); - - } - - /** - * Returns the mocked HTML content set by TinyMCE. Note: This is a basic mock that only adds paragraph tags to the - * content, which simulates TinyMCE's behavior for plain strings. TinyMCE's more complicated behavior for other scenarios - * is not mocked. - */ - private String getMockedTinyMceContent(String content) { - return "

    " + content + "

    "; - } - - private void testCopyFromAction() throws Exception { - - ______TS("Success case: copy successfully a previous session"); - feedbackPage.copyFeedbackSession("New Session ## (Copied)", newSession.getCourseId()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_COPIED); - // Check that we are redirected to the edit page. - feedbackPage.verifyHtmlMainContent("/instructorFeedbackCopySuccess.html"); - - ______TS("Success case: copy successfully a previous session with trimmed name"); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.copyFeedbackSession(" New Session ## Trimmed (Copied) ", newSession.getCourseId()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_COPIED); - // Check that we are redirected to the edit page. - feedbackPage.verifyHtmlMainContent("/instructorFeedbackCopyTrimmedSuccess.html"); - - ______TS("Failure case: copy fail since the feedback session name is the same with existing one"); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.copyFeedbackSession("New Session ## (Copied)", newSession.getCourseId()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals( - "A feedback session by this name already exists under this course"); - - feedbackPage.reloadPage(); - - ______TS("Failure case: copy fail since the feedback session name is blank"); - - feedbackPage.copyFeedbackSession("", newSession.getCourseId()); - assertTrue(feedbackPage.isElementVisible("copyModalForm")); - assertTrue(feedbackPage.isElementHasClass("modalCopiedSessionName", "text-box-error")); - - ______TS("Failure case: copy fail since the feedback session name starts with ("); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.copyFeedbackSession("(New Session ##)", newSession.getCourseId()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals( - "\"(New Session ##)\" is not acceptable to TEAMMATES as a/an feedback session name because " - + "it starts with a non-alphanumeric character. " - + "A/An feedback session name must start with an alphanumeric character, " - + "and cannot contain any vertical bar (|) or percent sign (%)."); - - feedbackPage.goToPreviousPage(InstructorFeedbackSessionsPage.class); - } - - private void testCopyToAction() { - String feedbackSessionName = "Open Session #"; - String courseId = newSession.getCourseId(); - - ______TS("Submit empty course list: Feedbacks Page"); - - feedbackPage.clickFsCopyButton(courseId, feedbackSessionName); - feedbackPage.getFsCopyToModal().waitForModalToLoad(); - feedbackPage.getFsCopyToModal().clickSubmitButton(); - feedbackPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(feedbackPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible()); - feedbackPage.getFsCopyToModal().verifyStatusMessage(Const.StatusMessages.FEEDBACK_SESSION_COPY_NONESELECTED); - - // Go back to previous page because 'copy feedback session' redirects to the 'FeedbackEdit' page. - feedbackPage.goToPreviousPage(InstructorFeedbackSessionsPage.class); - - ______TS("Copying fails due to fs with same name in course selected: Feedbacks Page"); - - feedbackPage.clickFsCopyButton(courseId, feedbackSessionName); - feedbackPage.getFsCopyToModal().waitForModalToLoad(); - feedbackPage.getFsCopyToModal().fillFormWithAllCoursesSelected(feedbackSessionName); - - feedbackPage.getFsCopyToModal().clickSubmitButton(); - - String error = String.format(Const.StatusMessages.FEEDBACK_SESSION_COPY_ALREADYEXISTS, - feedbackSessionName, courseId); - - feedbackPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(feedbackPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible()); - feedbackPage.getFsCopyToModal().verifyStatusMessage(error); - - feedbackPage.getFsCopyToModal().clickCloseButton(); - - ______TS("Copying fails due to fs with invalid name: Feedbacks Page"); - - feedbackPage.clickFsCopyButton(courseId, feedbackSessionName); - feedbackPage.getFsCopyToModal().waitForModalToLoad(); - feedbackPage.getFsCopyToModal().fillFormWithAllCoursesSelected("Invalid name | for feedback session"); - - feedbackPage.getFsCopyToModal().clickSubmitButton(); - - feedbackPage.getFsCopyToModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(feedbackPage.getFsCopyToModal().isFormSubmissionStatusMessageVisible()); - feedbackPage.getFsCopyToModal().verifyStatusMessage( - "\"Invalid name | for feedback session\" is not acceptable to TEAMMATES as a/an " - + "feedback session name because it contains invalid characters. " - + "A/An feedback session name must start with an alphanumeric character, " - + "and cannot contain any vertical bar (|) or percent sign (%)."); - - feedbackPage.getFsCopyToModal().clickCloseButton(); - - ______TS("Successful case: Feedbacks Page"); - - feedbackPage.clickFsCopyButton(courseId, feedbackSessionName); - feedbackPage.getFsCopyToModal().waitForModalToLoad(); - feedbackPage.getFsCopyToModal().fillFormWithAllCoursesSelected("New name!"); - - feedbackPage.getFsCopyToModal().clickSubmitButton(); - - feedbackPage.waitForPageToLoad(); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_COPIED); - - feedbackPage.goToPreviousPage(InstructorFeedbackSessionsPage.class); - } - - private void testMoveToRecycleBinAction() throws Exception { - - String courseId = newSession.getCourseId(); - String sessionName = "Long Instruction Test ##"; - - // refresh page - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions) - .moveSessionToRecycleBin(courseId, sessionName); - - assertTrue(feedbackPage.getTextsForAllStatusMessagesToUser() - .contains(Const.StatusMessages.FEEDBACK_SESSION_MOVED_TO_RECYCLE_BIN)); - assertNotNull("session should be in recycle bin", - BackDoor.getFeedbackSessionFromRecycleBin(courseId, sessionName)); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackMoveToRecycleBinSuccessful.html"); - - } - - private void testRestoreAction() throws Exception { - - String instructorId = testData.accounts.get("instructorWithCS2105").googleId; - feedbackPage = getFeedbackPageForInstructor(instructorId); - feedbackPage.verifyHtmlMainContent("/instructorOfCS2105WithMultipleSoftDeletedSessions.html"); - FeedbackSessionAttributes session1OfCS2105 = testData.feedbackSessions.get("session1OfCS2105"); - assertTrue(session1OfCS2105.isSessionDeleted()); - - feedbackPage = getFeedbackPageForInstructor(instructorId); - feedbackPage.restoreSession(session1OfCS2105.getCourseId(), session1OfCS2105.getFeedbackSessionName()); - session1OfCS2105.resetDeletedTime(); - - assertTrue(feedbackPage.getTextsForAllStatusMessagesToUser() - .contains(Const.StatusMessages.FEEDBACK_SESSION_RESTORED)); - assertNotNull(BackDoor.getFeedbackSession(session1OfCS2105.getCourseId(), - session1OfCS2105.getFeedbackSessionName())); - assertFalse(session1OfCS2105.isSessionDeleted()); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackRestoreSuccessful.html"); - - } - - private void testRestoreAllAction() throws Exception { - - FeedbackSessionAttributes session2OfCS2105 = testData.feedbackSessions.get("session2OfCS2105"); - FeedbackSessionAttributes session3OfCS2105 = testData.feedbackSessions.get("session3OfCS2105"); - assertTrue(session2OfCS2105.isSessionDeleted()); - assertTrue(session3OfCS2105.isSessionDeleted()); - - feedbackPage.restoreAllSessions(); - session2OfCS2105.resetDeletedTime(); - session3OfCS2105.resetDeletedTime(); - - assertTrue(feedbackPage.getTextsForAllStatusMessagesToUser() - .contains(Const.StatusMessages.FEEDBACK_SESSION_ALL_RESTORED)); - assertNotNull(BackDoor.getFeedbackSession(session2OfCS2105.getCourseId(), - session2OfCS2105.getFeedbackSessionName())); - assertNotNull(BackDoor.getFeedbackSession(session3OfCS2105.getCourseId(), - session3OfCS2105.getFeedbackSessionName())); - assertFalse(session2OfCS2105.isSessionDeleted()); - assertFalse(session3OfCS2105.isSessionDeleted()); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackRestoreAllSuccessful.html"); - - } - - private void testDeleteAction() throws Exception { - - String instructorId = testData.accounts.get("instructorWithCS2106").googleId; - feedbackPage = getFeedbackPageForInstructor(instructorId); - feedbackPage.verifyHtmlMainContent("/instructorOfCS2106WithMultipleSoftDeletedSessions.html"); - FeedbackSessionAttributes session1OfCS2106 = testData.feedbackSessions.get("session1OfCS2106"); - assertTrue(session1OfCS2106.isSessionDeleted()); - - // Delete and cancel - feedbackPage.deleteSessionAndCancel(session1OfCS2106.getCourseId(), session1OfCS2106.getFeedbackSessionName()); - - assertNotNull(BackDoor.getFeedbackSessionFromRecycleBin(session1OfCS2106.getCourseId(), - session1OfCS2106.getFeedbackSessionName())); - - // Delete and confirm - feedbackPage = getFeedbackPageForInstructor(instructorId); - feedbackPage.deleteSessionAndConfirm(session1OfCS2106.getCourseId(), session1OfCS2106.getFeedbackSessionName()); - - assertNull(BackDoor.getFeedbackSession(session1OfCS2106.getCourseId(), session1OfCS2106.getFeedbackSessionName())); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackDeleteSuccessful.html"); - - } - - private void testDeleteAllAction() throws Exception { - - String instructorId = testData.accounts.get("instructorWithCS2106").googleId; - FeedbackSessionAttributes session2OfCS2106 = testData.feedbackSessions.get("session2OfCS2106"); - FeedbackSessionAttributes session3OfCS2106 = testData.feedbackSessions.get("session3OfCS2106"); - assertTrue(session2OfCS2106.isSessionDeleted()); - assertTrue(session3OfCS2106.isSessionDeleted()); - - // Delete all and cancel - feedbackPage.deleteAllSessionsAndCancel(); - - assertNotNull(BackDoor.getFeedbackSessionFromRecycleBin(session2OfCS2106.getCourseId(), - session2OfCS2106.getFeedbackSessionName())); - assertNotNull(BackDoor.getFeedbackSessionFromRecycleBin(session3OfCS2106.getCourseId(), - session3OfCS2106.getFeedbackSessionName())); - - // Delete all and confirm - feedbackPage = getFeedbackPageForInstructor(instructorId); - feedbackPage.deleteAllSessionsAndConfirm(); - - assertNull(BackDoor.getFeedbackSession(session2OfCS2106.getCourseId(), session2OfCS2106.getFeedbackSessionName())); - assertNull(BackDoor.getFeedbackSession(session3OfCS2106.getCourseId(), session3OfCS2106.getFeedbackSessionName())); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackDeleteAllSuccessful.html"); - - } - - private void testRemindActions() { - //TODO implement this - } - - private void testPublishAndResendLinkAction() throws Exception { - // refresh page - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - ______TS("MANUAL: publish link clickable"); - - String courseId = testData.feedbackSessions.get("manualSession").getCourseId(); - String sessionName = testData.feedbackSessions.get("manualSession").getFeedbackSessionName(); - - feedbackPage.clickAndCancel(feedbackPage.getPublishLink(courseId, sessionName)); - assertFalse(BackDoor.getFeedbackSession(courseId, sessionName).isPublished()); - - // Test that the resend published link button doesn't exist - assertFalse(feedbackPage.checkIfResendPublishedEmailButtonExists(courseId, sessionName)); - - feedbackPage.clickAndConfirm(feedbackPage.getPublishLink(courseId, sessionName)); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_PUBLISHED); - assertTrue(BackDoor.getFeedbackSession(courseId, sessionName).isPublished()); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackPublishSuccessful.html"); - - ______TS("PUBLISHED: publish link hidden"); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.verifyPublishLinkHidden(courseId, sessionName); - - ______TS("resend link action: PUBLISHED feedback session"); - // Test that the resend published link button exists - assertTrue(feedbackPage.checkIfResendPublishedEmailButtonExists(courseId, sessionName)); - - // Test that the resend published link button can be clicked and the form can be cancelled - feedbackPage.clickResendPublishedEmailLink(courseId, sessionName); - feedbackPage.cancelResendPublishedEmailForm(); - - // Test the status message when the form is submitted with empty recipient list - feedbackPage.clickResendPublishedEmailLink(courseId, sessionName); - feedbackPage.waitForAjaxLoaderGifToDisappear(); - feedbackPage.submitResendPublishedEmailForm(); - feedbackPage.waitForPageToLoad(); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_SESSION_RESEND_EMAIL_EMPTY_RECIPIENT); - - // Test the status message when the form is submitted with a recipient list - feedbackPage.clickResendPublishedEmailLink(courseId, sessionName); - feedbackPage.waitForAjaxLoaderGifToDisappear(); - feedbackPage.fillResendPublishedEmailForm(); - feedbackPage.submitResendPublishedEmailForm(); - feedbackPage.waitForPageToLoad(); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_SESSION_RESEND_EMAIL_EMPTY_RECIPIENT); - } - - private void testUnpublishAction() throws Exception { - // refresh page - - String courseId = testData.feedbackSessions.get("publishedSession").getCourseId(); - String sessionName = testData.feedbackSessions.get("publishedSession").getFeedbackSessionName(); - feedbackPage.verifyPublishLinkHidden(courseId, sessionName); - - ______TS("MANUAL: unpublish link clickable"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - courseId = testData.feedbackSessions.get("manualSession").getCourseId(); - sessionName = testData.feedbackSessions.get("manualSession").getFeedbackSessionName(); - - feedbackPage.clickAndCancel(feedbackPage.getUnpublishLink(courseId, sessionName)); - assertTrue(BackDoor.getFeedbackSession(courseId, sessionName).isPublished()); - - feedbackPage.clickAndConfirm(feedbackPage.getUnpublishLink(courseId, sessionName)); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_UNPUBLISHED); - assertFalse(BackDoor.getFeedbackSession(courseId, sessionName).isPublished()); - feedbackPage.verifyHtmlMainContent("/instructorFeedbackUnpublishSuccessful.html"); - - ______TS("PUBLISHED: unpublish link hidden"); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - feedbackPage.verifyUnpublishLinkHidden(courseId, sessionName); - - } - - private void testAjaxErrorForLoadingSessionList() { - feedbackPage.changeUserIdInAjaxForSessionsForm("InvalidUserId"); - feedbackPage.reloadSessionsList(); - feedbackPage.waitForAjaxLoaderGifToDisappear(); - assertTrue(feedbackPage.getTextsForAllStatusMessagesToUser().get(0).contains("Failed to load sessions.")); - } - - private void testJScripts() { - feedbackPage = getFeedbackPageForInstructor(testData.accounts.get("instructorWithoutCourses").googleId); - LocalDate defaultStartDate = LocalDate.now(); - - testSessionViewableTable(); - testDatePickerScripts(defaultStartDate); - } - - private void testSessionViewableTable() { - - ______TS("all 4 datetime elements enabled when custom is selected"); - feedbackPage.clickEditUncommonSettingsButtons(); - feedbackPage.clickCustomPublishTimeButton(); - feedbackPage.clickCustomVisibleTimeButton(); - - assertTrue(feedbackPage.isEnabled(By.id("visibledate"))); - assertTrue(feedbackPage.isEnabled(By.id("visibletime"))); - assertTrue(feedbackPage.isEnabled(By.id("publishdate"))); - assertTrue(feedbackPage.isEnabled(By.id("publishtime"))); - - ______TS("all 4 datetime elements disabled when custom is deselected"); - - feedbackPage.clickDefaultPublishTimeButton(); - feedbackPage.clickDefaultVisibleTimeButton(); - - assertTrue(feedbackPage.isDisabled(By.id("visibledate"))); - assertTrue(feedbackPage.isDisabled(By.id("visibletime"))); - assertTrue(feedbackPage.isDisabled(By.id("publishdate"))); - assertTrue(feedbackPage.isDisabled(By.id("publishtime"))); - } - - private void testDatePickerScripts(LocalDate defaultStartDate) { - - feedbackPage.clickCustomVisibleTimeButton(); - feedbackPage.clickCustomPublishTimeButton(); - - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEE MMM dd yyyy"); - - ______TS("validate visible date range before editing start date"); - - String maxValueOfVisibleDate = feedbackPage.getMaxDateOf(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE); - - assertEquals(formatter.format(defaultStartDate), maxValueOfVisibleDate); - - ______TS("changing visible date to start date does not affect visible time if start time is not earlier"); - - feedbackPage.setStartTime(24); - feedbackPage.setVisibleTime(1); - String lateStartTime = feedbackPage.getStartTime(); - String earlyVisibleTime = feedbackPage.getVisibleTime(); - assertTrue(Integer.parseInt(lateStartTime) >= Integer.parseInt(earlyVisibleTime)); - - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, defaultStartDate); - assertTrue(Integer.parseInt(feedbackPage.getStartTime()) >= Integer.parseInt(feedbackPage.getVisibleTime())); - - ______TS("changing visible date to start date affects visible time if start time is earlier"); - - feedbackPage.setStartTime(1); - feedbackPage.setVisibleTime(24); - String earlyStartTime = feedbackPage.getStartTime(); - String lateVisibleTime = feedbackPage.getVisibleTime(); - assertTrue(Integer.parseInt(earlyStartTime) < Integer.parseInt(lateVisibleTime)); - - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, defaultStartDate); - assertEquals(feedbackPage.getStartTime(), feedbackPage.getVisibleTime()); - - // setup various dates for later test cases - LocalDate initialDateTime = LocalDate.of(2014, Month.APRIL, 16); - - // fill in default values for later test cases - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, initialDateTime); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, initialDateTime); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_ENDDATE, initialDateTime); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, initialDateTime); - - ______TS("increasing start date does not affect end date value"); - - LocalDate increasedStartDate = initialDateTime.plusMonths(1); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, increasedStartDate); - - String valueOfEndDate = feedbackPage.getValueOfDate(Const.ParamsNames.FEEDBACK_SESSION_ENDDATE); - assertEquals(formatter.format(initialDateTime), valueOfEndDate); - - ______TS("decreasing start date affects visible time, end date range and publish date range"); - - LocalDate decreasedStartDate = initialDateTime.minusDays(5); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, decreasedStartDate); - - String valueOfVisibleDate = feedbackPage.getValueOfDate(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE); - assertEquals(formatter.format(decreasedStartDate), valueOfVisibleDate); - - maxValueOfVisibleDate = feedbackPage.getMaxDateOf(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE); - assertEquals(formatter.format(decreasedStartDate), maxValueOfVisibleDate); - - String minValueOfPublishDate = feedbackPage.getMinDateOf(Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE); - assertEquals(formatter.format(decreasedStartDate), minValueOfPublishDate); - - ______TS("decreasing end date does not affect start time or visible time"); - LocalDate decreasedEndDate = initialDateTime.minusMonths(2); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_ENDDATE, decreasedEndDate); - - String valueOfStartDate = feedbackPage.getValueOfDate(Const.ParamsNames.FEEDBACK_SESSION_STARTDATE); - assertEquals(formatter.format(decreasedStartDate), valueOfStartDate); - - valueOfVisibleDate = feedbackPage.getValueOfDate(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE); - assertEquals(formatter.format(decreasedStartDate), valueOfVisibleDate); - - maxValueOfVisibleDate = feedbackPage.getMaxDateOf(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE); - assertEquals(formatter.format(decreasedStartDate), maxValueOfVisibleDate); - - minValueOfPublishDate = feedbackPage.getMinDateOf(Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE); - assertEquals(formatter.format(decreasedStartDate), minValueOfPublishDate); - - ______TS("changing visible date affects publish date range"); - - LocalDate changedVisibleDate = LocalDate.of(2014, Month.FEBRUARY, 10); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, changedVisibleDate); - - String valueOfPublishDate = feedbackPage.getMinDateOf(Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE); - assertEquals(formatter.format(changedVisibleDate), valueOfPublishDate); - - ______TS("changing publish date affects visible date range publishTime < startTime"); - - LocalDate changedPublishDate = LocalDate.of(2014, Month.FEBRUARY, 19); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, changedPublishDate); - - valueOfVisibleDate = feedbackPage.getMaxDateOf(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE); - assertEquals(formatter.format(changedPublishDate), valueOfVisibleDate); - - ______TS("changing publish date does not affect visible date range publishTime > startTime"); - - decreasedStartDate = LocalDate.of(2014, Month.JANUARY, 19); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, decreasedStartDate); - - changedPublishDate = LocalDate.of(2014, Month.FEBRUARY, 21); - feedbackPage.fillTimeValueForDatePickerTest(Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, changedPublishDate); - - //check if maxDate is start time and not publish time - maxValueOfVisibleDate = feedbackPage.getMaxDateOf(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE); - assertEquals(formatter.format(decreasedStartDate), maxValueOfVisibleDate); - } - - private void testResponseRateLink() { - ______TS("test response rate link clickable"); - - feedbackPage.clickViewResponseLink("CFeedbackUiT.CS2104", "First Session #1"); - feedbackPage.verifyResponseValue("0 / 0", "CFeedbackUiT.CS2104", "First Session #1"); - } - - private void testViewResultsLink() { - InstructorFeedbackResultsPage feedbackResultsPage; - FeedbackSessionAttributes fsa; - - ______TS("view results clickable not creator, open session"); - - fsa = testData.feedbackSessions.get("openSession"); - - feedbackResultsPage = feedbackPage.loadViewResultsLink(fsa.getCourseId(), fsa.getFeedbackSessionName()); - assertTrue(feedbackResultsPage.isCorrectPage(fsa.getCourseId(), fsa.getFeedbackSessionName())); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - ______TS("view results clickable creator, closed session"); - - fsa = testData.feedbackSessions.get("manualSession"); - - feedbackResultsPage = feedbackPage.loadViewResultsLink(fsa.getCourseId(), fsa.getFeedbackSessionName()); - assertTrue(feedbackResultsPage.isCorrectPage(fsa.getCourseId(), fsa.getFeedbackSessionName())); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - } - - private void testEditLink() { - InstructorFeedbackEditPage feedbackResultsPage; - FeedbackSessionAttributes fsa; - - ______TS("edit link clickable when creator"); - - fsa = testData.feedbackSessions.get("manualSession"); - - feedbackResultsPage = feedbackPage.loadEditLink(fsa.getCourseId(), fsa.getFeedbackSessionName()); - assertTrue(feedbackResultsPage.isCorrectPage(fsa.getCourseId(), fsa.getFeedbackSessionName())); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - } - - private void testSubmitLink() { - - FeedbackSubmitPage feedbackResultsPage; - FeedbackSessionAttributes fsa; - - ______TS("submit link clickable when visible"); - - fsa = testData.feedbackSessions.get("awaitingSession"); - - feedbackResultsPage = feedbackPage.loadSubmitLink(fsa.getCourseId(), fsa.getFeedbackSessionName()); - assertTrue(feedbackResultsPage.isCorrectPage(fsa.getCourseId(), fsa.getFeedbackSessionName())); - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - } - - private void testCopySessionModalButtons() { - feedbackPage.copyFeedbackSessionTestButtons("Session 1", newSession.getCourseId()); - - assertFalse(feedbackPage.isCopySubmitButtonEnabled()); - - ______TS("click on a row"); - - feedbackPage.clickCopyTableAtRow(0); - assertTrue(feedbackPage.isRowSelected(0)); - assertTrue(feedbackPage.isRadioButtonChecked(0)); - assertTrue(feedbackPage.isCopySubmitButtonEnabled()); - - // row -> row - ______TS("click on another row"); - - feedbackPage.clickCopyTableAtRow(3); - assertTrue(feedbackPage.isRowSelected(3)); - assertTrue(feedbackPage.isRadioButtonChecked(3)); - assertFalse(feedbackPage.isRowSelected(0)); - assertFalse(feedbackPage.isRadioButtonChecked(0)); - assertTrue(feedbackPage.isCopySubmitButtonEnabled()); - - // row -> radio - ______TS("click on a radio button"); - - feedbackPage.clickCopyTableRadioButtonAtRow(2); - assertTrue(feedbackPage.isRowSelected(2)); - assertTrue(feedbackPage.isRadioButtonChecked(2)); - assertFalse(feedbackPage.isRowSelected(3)); - assertFalse(feedbackPage.isRadioButtonChecked(3)); - assertTrue(feedbackPage.isCopySubmitButtonEnabled()); - - // radio -> radio - ______TS("click on another radio button"); - - feedbackPage.clickCopyTableRadioButtonAtRow(1); - assertTrue(feedbackPage.isRowSelected(1)); - assertTrue(feedbackPage.isRadioButtonChecked(1)); - assertFalse(feedbackPage.isRowSelected(2)); - assertFalse(feedbackPage.isRadioButtonChecked(2)); - assertTrue(feedbackPage.isCopySubmitButtonEnabled()); - - // radio -> row - ______TS("click on a row"); - - feedbackPage.clickCopyTableAtRow(3); - assertTrue(feedbackPage.isRowSelected(3)); - assertTrue(feedbackPage.isRadioButtonChecked(3)); - assertFalse(feedbackPage.isRowSelected(1)); - assertFalse(feedbackPage.isRadioButtonChecked(1)); - assertTrue(feedbackPage.isCopySubmitButtonEnabled()); - - // row -> radio (same row) - ______TS("click on a radio button of the same row"); - - feedbackPage.clickCopyTableRadioButtonAtRow(3); - assertTrue(feedbackPage.isRowSelected(3)); - assertTrue(feedbackPage.isRadioButtonChecked(3)); - assertTrue(feedbackPage.isCopySubmitButtonEnabled()); - - // refresh page - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.copyFeedbackSessionTestButtons("Session 1", newSession.getCourseId()); - - assertFalse(feedbackPage.isCopySubmitButtonEnabled()); - - ______TS("click on a radio button after page refresh"); - - feedbackPage.clickCopyTableRadioButtonAtRow(3); - assertTrue(feedbackPage.isRowSelected(3)); - assertTrue(feedbackPage.isRadioButtonChecked(3)); - assertTrue(feedbackPage.isCopySubmitButtonEnabled()); - } - - private void testValidationReload() throws Exception { - - ______TS("form fields do not reset on form validation failure when session type is STANDARD"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.selectSessionType("session with my own questions"); - String templateSessionName = "!Invalid name"; - feedbackPage.addFeedbackSession( - templateSessionName, newSession.getCourseId(), - TimeHelper.parseDateTimeFromSessionsForm("Sun, 01 Apr, 2035", "22", "00"), - TimeHelper.parseDateTimeFromSessionsForm("Mon, 30 Apr, 2035", "22", "00"), - null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - assertEquals("STANDARD", feedbackPage.getSessionType()); - assertEquals("22", feedbackPage.getStartTime()); - assertEquals("22", feedbackPage.getEndTime()); - - ______TS("form fields do not reset on form validation failure when session type is TEAMEVALUATION"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - feedbackPage.selectSessionType("session using template: team peer evaluation"); - templateSessionName = "!Invalid name"; - feedbackPage.addFeedbackSession( - templateSessionName, newSession.getCourseId(), - TimeHelper.parseDateTimeFromSessionsForm("Sun, 01 Apr, 2035", "10", "00"), - TimeHelper.parseDateTimeFromSessionsForm("Mon, 30 Apr, 2035", "22", "00"), - null, null, - newSession.getInstructions(), newSession.getGracePeriodMinutes()); - - assertEquals("TEAMEVALUATION", feedbackPage.getSessionType()); - assertEquals("10", feedbackPage.getStartTime()); - assertEquals("22", feedbackPage.getEndTime()); - - ______TS("failure case: test that advanced options are still available after input is rejected"); - - feedbackPage = getFeedbackPageForInstructor(idOfInstructorWithSessions); - - newSession.setFeedbackSessionName(""); - newSession.setEndTime(Const.TIME_REPRESENTS_LATER); - feedbackPage.clickEditUncommonSettingsButtons(); - feedbackPage.clickCustomPublishTimeButton(); - newSession.setResultsVisibleFromTime(TimeHelper.parseInstant("2035-09-01 11:00 PM +0000")); - feedbackPage.addFeedbackSession( - newSession.getFeedbackSessionName(), newSession.getCourseId(), - newSession.getStartTimeLocal(), newSession.getEndTimeLocal(), null, - newSession.getResultsVisibleFromTimeLocal(), - newSession.getInstructions(), - newSession.getGracePeriodMinutes()); - feedbackPage.waitForTextsForAllStatusMessagesToUserEquals( - getPopulatedEmptyStringErrorMessage( - FieldValidator.SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE_EMPTY_STRING_FOR_SESSION_NAME, - FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME, - FieldValidator.FEEDBACK_SESSION_NAME_MAX_LENGTH)); - assertTrue(feedbackPage.isVisible(By.id("timeFramePanel"))); - assertTrue(feedbackPage.isVisible(By.id("responsesVisibleFromColumn"))); - assertTrue(feedbackPage.isVisible(By.id("instructionsRow"))); - } - - private InstructorFeedbackSessionsPage getFeedbackPageForInstructor(String instructorId) { - AppUrl feedbackPageLink = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSIONS_PAGE).withUserId(instructorId); - InstructorFeedbackSessionsPage page = loginAdminToPageOld(feedbackPageLink, InstructorFeedbackSessionsPage.class); - page.waitForElementPresence(By.id("table-sessions")); - return page; - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackSubmitPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackSubmitPageUiTest.java deleted file mode 100644 index 8b4cfb6acbc..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorFeedbackSubmitPageUiTest.java +++ /dev/null @@ -1,930 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.datatransfer.questions.FeedbackConstantSumResponseDetails; -import teammates.common.datatransfer.questions.FeedbackMsqResponseDetails; -import teammates.common.datatransfer.questions.FeedbackNumericalScaleResponseDetails; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.FeedbackSubmitPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SESSION_SUBMISSION_PAGE}. - */ -public class InstructorFeedbackSubmitPageUiTest extends BaseE2ETestCase { - private FeedbackSubmitPage submitPage; - - @Override - protected void prepareTestData() { - // test data is refreshed before each test case - } - - @BeforeMethod - protected void refreshTestData() { - testData = loadDataBundle("/InstructorFeedbackSubmitPageUiTest.json"); - removeAndRestoreDataBundle(testData); - } - - @Test - public void testAll() throws Exception { - testContent(); - testClosedSessionSubmitAction(); - testSubmitAction(); - testModifyData(); - // No links to test - testQuestionTypesSubmitAction(); - } - - @Test - public void testAddingEditingAndDeletingFeedbackParticipantComments() { - testAddCommentsToQuestionsWithoutResponses(); - testAddCommentsToQuestionsWithResponses(); - testEditCommentsActionAfterAddingComments(); - testDeleteCommentsActionAfterEditingComments(); - } - - private void testContent() throws Exception { - ______TS("Awaiting session"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Awaiting Session"); - - // This is the full HTML verification for Instructor Feedback Submit Page, the rest can all be verifyMainHtml - submitPage.verifyHtml("/instructorFeedbackSubmitPageAwaiting.html"); - - ______TS("Open session"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageOpen.html"); - - ______TS("Open session with helper view"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr2", "Open Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageOpenWithHelperView.html"); - - ______TS("Grace period session"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Grace Period Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageGracePeriod.html"); - - ______TS("Closed session"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Closed Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageClosed.html"); - - ______TS("Empty session"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Empty Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageEmpty.html"); - } - - private void testClosedSessionSubmitAction() { - ______TS("test submitting for closed session"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Closed Session"); - - assertFalse(submitPage.isElementEnabled("response_submit_button")); - } - - private void testSubmitAction() throws Exception { - ______TS("create new responses"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - assertTrue(submitPage.isConfirmationEmailBoxTicked()); - - submitPage.fillResponseRichTextEditor(1, 0, "Test Self Feedback"); - submitPage.selectRecipient(2, 0, "Alice Betsy'\""); - submitPage.fillResponseRichTextEditor(2, 0, "Response to Alice."); - submitPage.selectRecipient(2, 1, "Drop out"); - submitPage.fillResponseRichTextEditor(2, 1, "Response to student who is going to drop out."); - submitPage.selectRecipient(2, 2, "Extra guy"); - submitPage.fillResponseRichTextEditor(2, 2, "Response to extra guy."); - submitPage.fillResponseTextBox(13, 0, "1"); - submitPage.fillResponseTextBox(18, 0, "100"); - submitPage.fillResponseTextBox(18, 1, "100"); - submitPage.fillResponseTextBox(18, 2, "100"); - submitPage.fillResponseTextBox(19, 0, 0, "70"); - submitPage.fillResponseTextBox(19, 0, 1, "30"); - - // Test partial response for question - submitPage.fillResponseRichTextEditor(4, 1, "Feedback to Instructor 3"); - submitPage.selectRecipient(6, 0, "Teammates Test2"); - submitPage.chooseMcqOption(6, 0, "Algo"); - submitPage.selectRecipient(8, 0, "Teammates Test2"); - submitPage.toggleMsqOption(8, 0, "UI"); - submitPage.toggleMsqOption(8, 0, "Design"); - - // Just check that some of the responses persisted. - FeedbackQuestionAttributes fq = - BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 2); - FeedbackQuestionAttributes fqPartial = - BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 6); - FeedbackQuestionAttributes fqMcq = - BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 8); - FeedbackQuestionAttributes fqMsq = - BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 10); - FeedbackQuestionAttributes fqNumscale = - BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 15); - FeedbackQuestionAttributes fqConstSumRecipient = - BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 20); - FeedbackQuestionAttributes fqConstSumOption = - BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 21); - - assertNull(BackDoor.getFeedbackResponse( - fq.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.alice.b@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse( - fqPartial.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr2@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse( - fqMcq.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr2@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse( - fqMsq.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr2@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse( - fqNumscale.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse( - fqConstSumRecipient.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse( - fqConstSumOption.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr@gmail.tmt")); - - submitPage.submitWithoutConfirmationEmail(); - - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "3, 5, 7, 9, 10, 11, 12, 14, " - + "15, 16, 17, 20, 21, 22, 23."); - - assertNotNull(BackDoor.getFeedbackResponse( - fq.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.alice.b@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse( - fqPartial.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr3@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse( - fqMcq.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr2@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse( - fqMsq.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr2@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse( - fqNumscale.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse( - fqConstSumOption.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr@gmail.tmt")); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPagePartiallyFilled.html"); - - ______TS("edit existing response"); - - // Test editing an existing response + fill up rest of responses at the same time - String editedResponse = "Edited response to Alice."; - submitPage.fillResponseRichTextEditor(2, 0, editedResponse); - submitPage.fillResponseRichTextEditor(3, 0, "Feedback to instructors"); - submitPage.fillResponseRichTextEditor(4, 1, "Feedback to instructor 2."); - submitPage.fillResponseRichTextEditor(4, 2, "Feedback to instructor 4."); - submitPage.fillResponseRichTextEditor(4, 3, "Feedback to instructor 5."); - - submitPage.chooseMcqOption(5, 0, "UI"); - submitPage.chooseMcqOption(6, 0, "UI"); // Changed from "Algo" to "UI" - submitPage.selectRecipient(6, 1, "Teammates Test3"); - submitPage.chooseMcqOption(6, 1, "UI"); - submitPage.selectRecipient(6, 2, "Teammates Test4"); - submitPage.chooseMcqOption(6, 2, "UI"); - - // Click on "None of the above", the option will be deselected when another option is clicked - submitPage.toggleMsqOption(7, 0, ""); - submitPage.toggleMsqOption(7, 0, "UI"); - submitPage.toggleMsqOption(7, 0, "Algo"); - submitPage.toggleMsqOption(7, 0, "Design"); - submitPage.toggleMsqOption(8, 0, "UI"); - submitPage.toggleMsqOption(8, 0, "Algo"); - submitPage.toggleMsqOption(8, 0, "Design"); - submitPage.selectRecipient(8, 1, "Teammates Test3"); - submitPage.toggleMsqOption(8, 1, "Design"); - submitPage.selectRecipient(8, 2, "Teammates Test4"); - submitPage.toggleMsqOption(8, 2, "UI"); - - submitPage.chooseMcqOption(9, 0, "Drop out (Team 2)"); - submitPage.toggleMsqOption(10, 0, "Alice Betsy'\" (Team 1'\")"); - submitPage.toggleMsqOption(10, 0, "Benny Charles (Team 1'\")"); - submitPage.toggleMsqOption(10, 0, "Charlie Davis (Team 2)"); - submitPage.toggleMsqOption(10, 0, "Extra guy (Team 2)"); - - submitPage.chooseMcqOption(11, 0, "Team 2"); - submitPage.toggleMsqOption(12, 0, "Team 1'\""); - submitPage.toggleMsqOption(12, 0, "Team 3"); - - submitPage.fillResponseTextBox(13, 0, "5"); - submitPage.selectRecipient(14, 0, "Teammates Test2"); - submitPage.fillResponseTextBox(14, 0, "1.5"); - submitPage.selectRecipient(14, 1, "Teammates Test3"); - submitPage.fillResponseTextBox(14, 1, "2"); - submitPage.selectRecipient(14, 2, "Teammates Test4"); - submitPage.fillResponseTextBox(14, 2, "3.5"); - - submitPage.chooseMcqOption(15, 0, "Teammates Test2"); - submitPage.toggleMsqOption(16, 0, "Teammates Test"); - submitPage.toggleMsqOption(16, 0, "Teammates Test3"); - - // Just check the edited responses, and two new response. - assertNull(BackDoor.getFeedbackResponse(fq.getId(), "IFSubmitUiT.instr@gmail.tmt", "Team 2")); - assertNull(BackDoor.getFeedbackResponse(fqConstSumOption.getId(), - "IFSubmitUiT.instr@gmail.tmt", "Team 1'\"")); - assertNull(BackDoor.getFeedbackResponse(fqConstSumOption.getId(), - "IFSubmitUiT.instr@gmail.tmt", "Team 2")); - assertNull(BackDoor.getFeedbackResponse(fqConstSumOption.getId(), - "IFSubmitUiT.instr@gmail.tmt", "Team 3")); - - // checks that "" can be submitted and other choices reset when "" is clicked - submitPage.toggleMsqOption(17, 0, "Team 3"); - submitPage.toggleMsqOption(17, 0, ""); - - assertFalse(submitPage.isConfirmationEmailBoxTicked()); - submitPage.submitWithoutConfirmationEmail(); - - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "20, 21, 22, 23."); - assertEquals("

    " + editedResponse + "

    ", - BackDoor.getFeedbackResponse( - fq.getId(), "IFSubmitUiT.instr@gmail.tmt", - "IFSubmitUiT.alice.b@gmail.tmt").getResponseDetails().getAnswerString()); - - fq = BackDoor.getFeedbackQuestion("IFSubmitUiT.CS2104", "First Session", 7); - assertNotNull(BackDoor.getFeedbackResponse( - fq.getId(), "IFSubmitUiT.instr@gmail.tmt", "IFSubmitUiT.instr@gmail.tmt")); - assertEquals("UI", - BackDoor.getFeedbackResponse( - fqMcq.getId(), "IFSubmitUiT.instr@gmail.tmt", - "IFSubmitUiT.instr2@gmail.tmt").getResponseDetails().getAnswerString()); - - FeedbackMsqResponseDetails frMsq = - (FeedbackMsqResponseDetails) BackDoor.getFeedbackResponse( - fqMsq.getId(), "IFSubmitUiT.instr@gmail.tmt", - "IFSubmitUiT.instr2@gmail.tmt").getResponseDetails(); - - assertFalse(frMsq.getAnswers().contains("UI")); - assertTrue(frMsq.getAnswers().contains("Algo")); - assertFalse(frMsq.getAnswers().contains("Design")); - - FeedbackNumericalScaleResponseDetails frNumscale = - (FeedbackNumericalScaleResponseDetails) BackDoor.getFeedbackResponse( - fqNumscale.getId(), "IFSubmitUiT.instr@gmail.tmt", - "IFSubmitUiT.instr@gmail.tmt").getResponseDetails(); - - assertEquals("5", frNumscale.getAnswerString()); - - FeedbackConstantSumResponseDetails frConstSum = - (FeedbackConstantSumResponseDetails) BackDoor.getFeedbackResponse( - fqConstSumOption.getId(), "IFSubmitUiT.instr@gmail.tmt", - "IFSubmitUiT.instr@gmail.tmt").getResponseDetails(); - - assertEquals("70, 30", frConstSum.getAnswerString()); - - FeedbackConstantSumResponseDetails frConstSum0 = - (FeedbackConstantSumResponseDetails) BackDoor.getFeedbackResponse( - fqConstSumRecipient.getId(), "IFSubmitUiT.instr@gmail.tmt", - "Team 1'\"").getResponseDetails(); - - assertEquals("100", frConstSum0.getAnswerString()); - - FeedbackConstantSumResponseDetails frConstSum1 = - (FeedbackConstantSumResponseDetails) BackDoor.getFeedbackResponse( - fqConstSumRecipient.getId(), "IFSubmitUiT.instr@gmail.tmt", "Team 2").getResponseDetails(); - - assertEquals("100", frConstSum1.getAnswerString()); - - FeedbackConstantSumResponseDetails frConstSum2 = - (FeedbackConstantSumResponseDetails) BackDoor.getFeedbackResponse( - fqConstSumRecipient.getId(), "IFSubmitUiT.instr@gmail.tmt", "Team 3").getResponseDetails(); - - assertEquals("100", frConstSum2.getAnswerString()); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageFullyFilled.html"); - } - - private void testAddCommentsToQuestionsWithoutResponses() { - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.waitForPageToLoad(); - - submitPage.addFeedbackParticipantComment("-5-0", "Comment without response"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, " - + "11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23."); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.waitForPageToLoad(); - submitPage.verifyCommentRowMissing("-5-0"); - } - - private void testAddCommentsToQuestionsWithResponses() { - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.waitForPageToLoad(); - - submitPage.selectRecipient(6, 0, "Teammates Test2"); - submitPage.chooseMcqOption(6, 0, "Algo"); - submitPage.selectRecipient(6, 1, "Teammates Test3"); - submitPage.chooseMcqOption(6, 1, "UI"); - submitPage.selectRecipient(6, 2, "Teammates Test4"); - submitPage.chooseMcqOption(6, 2, "UI"); - submitPage.chooseMcqOption(9, 0, "Drop out (Team 2)"); - - submitPage.addFeedbackParticipantComment("-6-0", "New MCQ Comment 1"); - submitPage.addFeedbackParticipantComment("-6-1", "New MCQ Comment 2"); - submitPage.addFeedbackParticipantComment("-9-0", "New MCQ Comment 3"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS - + "1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23."); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.waitForPageToLoad(); - submitPage.verifyCommentRowContent("-6-0", "New MCQ Comment 1"); - submitPage.verifyCommentRowContent("-6-1", "New MCQ Comment 2"); - submitPage.verifyCommentRowContent("-9-0", "New MCQ Comment 3"); - - } - - private void testEditCommentsActionAfterAddingComments() { - ______TS("edit comments on responses and verify added comments action"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.waitForPageToLoad(); - - submitPage.editFeedbackParticipantComment("-6-0", "Edited MCQ Comment 1"); - submitPage.editFeedbackParticipantComment("-6-1", "Edited MCQ Comment 2"); - submitPage.editFeedbackParticipantComment("-9-0", "Edited MCQ Comment 3"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS - + "1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23."); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.waitForPageToLoad(); - submitPage.verifyCommentRowContent("-6-0", "Edited MCQ Comment 1"); - submitPage.verifyCommentRowContent("-6-1", "Edited MCQ Comment 2"); - submitPage.verifyCommentRowContent("-9-0", "Edited MCQ Comment 3"); - } - - private void testDeleteCommentsActionAfterEditingComments() { - ______TS("delete comments on responses and verify edited comments action"); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.waitForPageToLoad(); - - // mcq questions comments - submitPage.deleteFeedbackResponseComment("-6-0"); - submitPage.verifyCommentRowMissing("-6-0"); - submitPage.deleteFeedbackResponseComment("-6-1"); - submitPage.verifyCommentRowMissing("-6-1"); - submitPage.deleteFeedbackResponseComment("-9-0"); - submitPage.verifyCommentRowMissing("-9-0"); - } - - /** - * Tests the behavior of different question types. - * Test response validation on client side as well, if any. - */ - private void testQuestionTypesSubmitAction() { - ______TS("test submit actions for different question types."); - - testEssaySubmitAction(); - testMcqSubmitAction(); - testMsqSubmitAction(); - testNumScaleSubmitAction(); - testConstSumSubmitAction(); - testContribSubmitAction(); - } - - private void testEssaySubmitAction() { - ______TS("test submit actions for essay question."); - - // Nothing much to test for input validation. - // Test fields are disabled when session is closed. - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Closed Session"); - submitPage.waitForAndDismissAlertModal(); - - // Test input disabled - int qnNumber = 1; - int responseNumber = 0; - - assertTrue(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - - // Test that the recipient selection is disabled and not visible - assertFalse(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - } - - private void testMcqSubmitAction() { - ______TS("test submit actions for mcq."); - - // Test input disabled - int qnNumber = 2; - int responseNumber = 0; - - assertTrue(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - - // Test that the recipient selection is disabled and not visible - assertFalse(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - } - - private void testMsqSubmitAction() { - ______TS("test submit actions for msq."); - - // Test input disabled - int qnNumber = 3; - int responseNumber = 0; - - assertTrue(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - - // Test that the recipient selection is disabled and not visible - assertFalse(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - } - - private void testNumScaleSubmitAction() { - ______TS("test submit actions for numscale questions."); - - // Test input disabled - int qnNumber = 4; - int responseNumber = 0; - - assertTrue(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - - // Test that the recipient selection is disabled and not visible - assertFalse(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - - // Test input entered are valid numbers for the question. - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - - qnNumber = 14; - responseNumber = 0; - - // 1 decimal allowed, not a valid response - submitPage.fillResponseTextBox(qnNumber, responseNumber, "2.5"); - assertEquals("2.5", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - - // > 3 decimals allowed but still not a valid response - submitPage.fillResponseTextBox(qnNumber, responseNumber, "1.123456"); - assertEquals("1.123456", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - - // users not allowed to type letters but if somehow in, not a valid response - submitPage.fillResponseTextBox(qnNumber, responseNumber, "ABCD"); - assertEquals("", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - - // if < minimum, textbox will be set to minimum - submitPage.fillResponseTextBox(qnNumber, responseNumber, "0"); - assertEquals("1", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - - /* Note: Negative will be tested properly on Chrome or Safari but not on Firefox, - * In the Firefox version that we are using for tests, Firefox does not allow for - * the negative sign to be input so the test below is passing since trying to input - * -1 will result in 1 being input. - */ - submitPage.fillResponseTextBox(qnNumber, responseNumber, "-1"); - assertEquals("1", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - - /* However, if we test -1.23, on Chrome and Safari it will be changed to 1 but on - * Firefox it will be 1.23 and not the expected 1. Tests are disabled until - * the Firefox version that we use for testing allows for this so that - * developers will not randomly pass or fail depending on browser used for testing - */ - // submitPage.fillResponseTextBox(qnNumber, responseNumber, "-1.23"); - // assertEquals("1", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - - // if > maximum, int or with decimals, textbox will be set to maximum - submitPage.fillResponseTextBox(qnNumber, responseNumber, "6"); - assertEquals("5", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - - submitPage.fillResponseTextBox(qnNumber, responseNumber, "6.78"); - assertEquals("5", submitPage.getResponseTextBoxValue(qnNumber, responseNumber)); - } - - private void testConstSumSubmitAction() { - ______TS("test submit actions for constsum questions."); - - // Test input disabled - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Closed Session"); - submitPage.waitForAndDismissAlertModal(); - - int qnNumber = 5; - int responseNumber = 0; - - assertTrue(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - - // Test that the recipient selection is disabled and not visible - assertFalse(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - - // Test instructions displayed for filling the form - qnNumber = 18; - assertEquals("Total points distributed should add up to 400.", - submitPage.getConstSumInstruction(qnNumber)); - - qnNumber = 19; - assertEquals("Total points distributed should add up to 100.", - submitPage.getConstSumInstruction(qnNumber)); - - qnNumber = 20; - assertEquals("Total points distributed should add up to 400.\n" - + "Every recipient should be allocated different number of points.", - submitPage.getConstSumInstruction(qnNumber)); - - qnNumber = 21; - assertEquals("Total points distributed should add up to 100.\n" - + "Every option should be allocated different number of points.", - submitPage.getConstSumInstruction(qnNumber)); - - qnNumber = 22; - assertEquals("Total points distributed should add up to 400.\n" - + "At least one recipient should be allocated different number of points.", - submitPage.getConstSumInstruction(qnNumber)); - - qnNumber = 23; - assertEquals("Total points distributed should add up to 100.\n" - + "At least one option should be allocated different number of points.", - submitPage.getConstSumInstruction(qnNumber)); - - // Test messages for const sum (to recipient) qn without restriction - qnNumber = 18; - - submitPage.fillResponseTextBox(qnNumber, 0, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 1, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 2, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 3, 0, ""); - assertEquals("", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "110"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "110"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "110"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "110"); - assertEquals("Actual total is 440! Remove the extra 40 points allocated.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "0"); - assertEquals("Actual total is 330! Distribute the remaining 70 points.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - "Please fix the error(s) for distribution question(s) 18." - + " To skip a distribution question, leave the boxes blank."); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "100"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "100"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "100"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "100"); - assertEquals("All points distributed!", submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "9, 20, 21, 22, 23."); - - // Test messages for const sum (to option) qn without restriction - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - qnNumber = 19; - - submitPage.fillResponseTextBox(qnNumber, 0, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 0, 1, ""); - assertEquals("", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "80"); - submitPage.fillResponseTextBox(qnNumber, 0, 1, "30"); - assertEquals("Actual total is 110! Remove the extra 10 points allocated.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, ""); - assertEquals("Actual total is 30! Distribute the remaining 70 points.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - "Please fix the error(s) for distribution question(s) 19." - + " To skip a distribution question, leave the boxes blank."); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "70"); - submitPage.fillResponseTextBox(qnNumber, 0, 1, "30"); - assertEquals("All points distributed!", submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "9, 20, 21, 22, 23."); - - // Test messages for const sum (to recipient) qn with uneven distribution - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - qnNumber = 20; - - submitPage.fillResponseTextBox(qnNumber, 0, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 1, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 2, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 3, 0, ""); - assertEquals("", submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "80"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "120"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "100"); - assertEquals("Actual total is 300! Distribute the remaining 100 points.\n" - + "All allocated points are different!", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "100"); - assertEquals("Actual total is 320! Distribute the remaining 80 points.\n" - + "Multiple recipients are given same points! eg. 100.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "110"); - assertEquals("Actual total is 330! Distribute the remaining 70 points.\n" - + "All allocated points are different!", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "400"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "400"); - assertEquals("Actual total is 900! Remove the extra 500 points allocated.\n" - + "Multiple recipients are given same points! eg. 400.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 1, 0, "410"); - assertEquals("Actual total is 910! Remove the extra 510 points allocated.\n" - + "All allocated points are different!", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "50"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "50"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "200"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "100"); - assertEquals("All points distributed!\n" - + "Multiple recipients are given same points! eg. 50.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - "Please fix the error(s) for distribution question(s) 20." - + " To skip a distribution question, leave the boxes blank."); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "50"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "90"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "160"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "100"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "9, 21, 22, 23."); - - // Test messages for const sum (to options) qn with uneven distribution - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - qnNumber = 21; - - submitPage.fillResponseTextBox(qnNumber, 0, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 0, 1, ""); - submitPage.fillResponseTextBox(qnNumber, 0, 2, ""); - assertEquals("", submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "25"); - submitPage.fillResponseTextBox(qnNumber, 0, 1, "40"); - submitPage.fillResponseTextBox(qnNumber, 0, 2, "25"); - assertEquals("Actual total is 90! Distribute the remaining 10 points.\n" - + "Multiple options are given same points! eg. 25.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "30"); - assertEquals("Actual total is 95! Distribute the remaining 5 points.\n" - + "All allocated points are different!", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 2, "40"); - assertEquals("Actual total is 110! Remove the extra 10 points allocated.\n" - + "Multiple options are given same points! eg. 40.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 2, "60"); - assertEquals("Actual total is 130! Remove the extra 30 points allocated.\n" - + "All allocated points are different!", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - "Please fix the error(s) for distribution question(s) 21." - + " To skip a distribution question, leave the boxes blank."); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "10"); - submitPage.fillResponseTextBox(qnNumber, 0, 1, "30"); - assertEquals("All points distributed!\n" - + "All allocated points are different!", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "9, 22, 23."); - - // Test messages for const sum (to recipients) qn with uneven distribution for at least some recipients - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - qnNumber = 22; - - submitPage.fillResponseTextBox(qnNumber, 0, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 1, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 2, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 3, 0, ""); - assertEquals("", submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "95"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "95"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "95"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "95"); - assertEquals("Actual total is 380! Distribute the remaining 20 points.\n" - + "All recipients are given 95 points. " - + "Please allocate different points to at least one recipient.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 3, 0, "100"); - assertEquals("Actual total is 385! Distribute the remaining 15 points.\n" - + "At least one recipient has been allocated different number of points.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "105"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "105"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "105"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "105"); - assertEquals("Actual total is 420! Remove the extra 20 points allocated.\n" - + "All recipients are given 105 points. " - + "Please allocate different points to at least one recipient.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 3, 0, "110"); - assertEquals("Actual total is 425! Remove the extra 25 points allocated.\n" - + "At least one recipient has been allocated different number of points.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "100"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "100"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "100"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "100"); - assertEquals("All points distributed!\n" - + "All recipients are given 100 points. " - + "Please allocate different points to at least one recipient.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - "Please fix the error(s) for distribution question(s) 22." - + " To skip a distribution question, leave the boxes blank."); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "110"); - submitPage.fillResponseTextBox(qnNumber, 1, 0, "120"); - submitPage.fillResponseTextBox(qnNumber, 2, 0, "130"); - submitPage.fillResponseTextBox(qnNumber, 3, 0, "40"); - assertEquals("All points distributed!\n" - + "At least one recipient has been allocated different number of points.", - submitPage.getConstSumMessage(qnNumber, 3)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "9, 23."); - - // Test messages for const sum (to options) qn with uneven distribution for at least some options - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - qnNumber = 23; - - submitPage.fillResponseTextBox(qnNumber, 0, 0, ""); - submitPage.fillResponseTextBox(qnNumber, 0, 1, ""); - submitPage.fillResponseTextBox(qnNumber, 0, 2, ""); - assertEquals("", submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "25"); - submitPage.fillResponseTextBox(qnNumber, 0, 1, "25"); - submitPage.fillResponseTextBox(qnNumber, 0, 2, "25"); - assertEquals("Actual total is 75! Distribute the remaining 25 points.\n" - + "All options are given 25 points. " - + "Please allocate different points to at least one option.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 1, "40"); - assertEquals("Actual total is 90! Distribute the remaining 10 points.\n" - + "At least one option has been allocated different number of points.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "40"); - submitPage.fillResponseTextBox(qnNumber, 0, 2, "40"); - assertEquals("Actual total is 120! Remove the extra 20 points allocated.\n" - + "All options are given 40 points. " - + "Please allocate different points to at least one option.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.fillResponseTextBox(qnNumber, 0, 0, "30"); - assertEquals("Actual total is 110! Remove the extra 10 points allocated.\n" - + "At least one option has been allocated different number of points.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - "Please fix the error(s) for distribution question(s) 23." - + " To skip a distribution question, leave the boxes blank."); - - submitPage.fillResponseTextBox(qnNumber, 0, 1, "20"); - submitPage.fillResponseTextBox(qnNumber, 0, 2, "50"); - assertEquals("All points distributed!\n" - + "At least one option has been allocated different number of points.", - submitPage.getConstSumMessage(qnNumber, 0)); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "9."); - } - - private void testContribSubmitAction() { - ______TS("test submit actions for contribution questions."); - - // No tests from instructor since contribution questions are only from students to own team members. - // Test by logging in as student instead. - - // Test input disabled - submitPage = loginToStudentFeedbackSubmitPage("Danny", "Closed Session"); - - int qnNumber = 1; - int responseNumber = 0; - - submitPage.waitForAndDismissAlertModal(); - assertTrue(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber)); - - // Test that the recipient selection is disabled and not visible - assertFalse(submitPage.isNamedElementVisible(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - assertFalse(submitPage.isNamedElementEnabled(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" - + qnNumber + "-" + responseNumber)); - } - - private void testModifyData() throws Exception { - ______TS("modify data"); - - // Next, we edit some student data to cover editing of students after creating the responses. - - // move one student out of Team 2 into a new team, should not cause the existing response to disappear - StudentAttributes extraGuy = testData.students.get("ExtraGuy"); - moveToTeam(extraGuy, "New Team"); - - // delete one student, should remove (hide on page render; not deleted) the response made to him, - // and change the number of options in the recipient dropdown list. - StudentAttributes dropOutGuy = testData.students.get("DropOut"); - String backDoorOperationStatus = BackDoor.deleteStudent(dropOutGuy.course, dropOutGuy.email); - assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, backDoorOperationStatus); - - submitPage = loginToInstructorFeedbackSubmitPage("IFSubmitUiT.instr", "Open Session"); - submitPage.verifyHtmlMainContent("/instructorFeedbackSubmitPageModified.html"); - } - - private FeedbackSubmitPage loginToInstructorFeedbackSubmitPage(String instructorName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_SUBMISSION_PAGE) - .withUserId(testData.instructors.get(instructorName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(editUrl, FeedbackSubmitPage.class); - } - - private FeedbackSubmitPage loginToStudentFeedbackSubmitPage( - String studentName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSION_SUBMISSION_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(editUrl, FeedbackSubmitPage.class); - } - - private void moveToTeam(StudentAttributes student, String newTeam) { - String backDoorOperationStatus; - student.team = newTeam; - backDoorOperationStatus = BackDoor.editStudent(student.email, student); - assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, backDoorOperationStatus); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorHelpPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorHelpPageUiTest.java deleted file mode 100644 index 7b1e545aa9c..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorHelpPageUiTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.openqa.selenium.By; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.pageobjects.AppPage; -import teammates.test.pageobjects.InstructorHelpPage; - -/** - * SUT: {@link InstructorHelpPage}. - */ -public class InstructorHelpPageUiTest extends BaseE2ETestCase { - private static final By SEARCH_RESULTS = By.id("searchResults"); - private InstructorHelpPage helpPage; - - @Override - protected void prepareTestData() { - // no test data used in this test - } - - @BeforeClass - public void classSetup() { - helpPage = AppPage.getNewPageInstance(browser, createUrl(Const.WebPageURIs.INSTRUCTOR_HELP_PAGE + ".jsp"), - InstructorHelpPage.class); - } - - @Test - public void testAll() throws Exception { - testSearch(); - } - - private void testSearch() throws Exception { - - ______TS("content: default help page"); - - helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); - - ______TS("search for empty keyword"); - - helpPage.clearSearchBox(); - helpPage.clickSearchButton(); - helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); - - ______TS("search for single keyword"); - - String searchContent = "course"; - helpPage.inputSearchQuery(searchContent); - helpPage.clickSearchButton(); - helpPage.verifyHtmlPart(SEARCH_RESULTS, "/instructorHelpPageSearchSingleKeyword.html"); - - ______TS("search for multiple keywords"); - - searchContent = "enroll students"; - helpPage.clearSearchBox(); - helpPage.inputSearchQuery(searchContent); - helpPage.clickSearchButton(); - helpPage.verifyHtmlPart(SEARCH_RESULTS, "/instructorHelpPageSearchMultipleKeywords.html"); - - ______TS("check case insensitivity of query"); - - searchContent = "eNroLL STUDENTs"; - helpPage.clearSearchBox(); - helpPage.inputSearchQuery(searchContent); - helpPage.clickSearchButton(); - helpPage.verifyHtmlPart(SEARCH_RESULTS, "/instructorHelpPageSearchMultipleKeywords.html"); - - ______TS("reset search"); - - helpPage.clickResetButton(); - helpPage.verifyHtmlMainContent("/instructorHelpPageDefault.html"); - - ______TS("search for non existing keyword"); - - searchContent = "non existing keyword"; - helpPage.clearSearchBox(); - helpPage.inputSearchQuery(searchContent); - helpPage.clickSearchButton(); - assertEquals("", helpPage.getSearchResults()); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorHomePageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorHomePageUiTest.java deleted file mode 100644 index 0468e7a20ed..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorHomePageUiTest.java +++ /dev/null @@ -1,592 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.time.ZoneId; - -import org.openqa.selenium.WebElement; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.FieldValidator; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorCourseDetailsPage; -import teammates.test.pageobjects.InstructorCourseEditPage; -import teammates.test.pageobjects.InstructorCourseEnrollPage; -import teammates.test.pageobjects.InstructorFeedbackSessionsPage; -import teammates.test.pageobjects.InstructorHelpPage; -import teammates.test.pageobjects.InstructorHomePage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_HOME_PAGE}. - */ -public class InstructorHomePageUiTest extends BaseE2ETestCase { - private InstructorHomePage homePage; - - private FeedbackSessionAttributes feedbackSessionAwaiting; - private FeedbackSessionAttributes feedbackSessionOpen; - private FeedbackSessionAttributes feedbackSessionClosed; - private FeedbackSessionAttributes feedbackSessionPublished; - - // TODO: refactor this test. try to use admin login or create instructors and courses not using json - - @Override - protected void prepareTestData() { - removeAndRestoreDataBundle(loadDataBundle("/InstructorHomePageUiTest1.json")); - testData = loadDataBundle("/InstructorHomePageUiTest2.json"); - removeAndRestoreDataBundle(testData); - - feedbackSessionAwaiting = testData.feedbackSessions.get("Second Feedback Session"); - feedbackSessionOpen = testData.feedbackSessions.get("First Feedback Session"); - feedbackSessionClosed = testData.feedbackSessions.get("Third Feedback Session"); - feedbackSessionPublished = testData.feedbackSessions.get("Fourth Feedback Session"); - - // Remove entities created during test - BackDoor.deleteCourse("newIns.wit-demo"); - BackDoor.deleteInstructor("newIns.wit-demo", "CHomeUiT.instructor.tmms@gmail.tmt"); - } - - @Test - public void allTests() throws Exception { - testPersistenceCheck(); - testLogin(); - testContent(); - testAjaxCourseTableLoad(); - testShowFeedbackStatsLink(); - testHelpLink(); - testCourseLinks(); - testSearchAction(); - testSortAction(); - testRemindActions(); - testPublishUnpublishResendLinkActions(); - testArchiveCourseAction(); - testCopyToFsAction(); - testDeleteCourseAction(); - } - - private void testAjaxCourseTableLoad() throws Exception { - loginAsInstructor("CHomeUiT.instructor.tmms.unloaded"); - - homePage.loadInstructorHomeTab(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLWithUnloadedCourse.html"); - - loginAsCommonInstructor(); - } - - private void testPersistenceCheck() throws Exception { - - ______TS("persistence check"); - - loginWithPersistenceProblem(); - - // This is the full HTML verification for Instructor Home Page, the rest can all be verifyMainHtml - homePage.verifyHtml("/instructorHomeHTMLPersistenceCheck.html"); - } - - private void testLogin() { - - ______TS("login"); - - loginAsNewInstructor(); - assertTrue(browser.driver.getCurrentUrl().contains(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE)); - } - - private void testShowFeedbackStatsLink() throws Exception { - WebElement viewResponseLink = homePage.getViewResponseLink("CHomeUiT.CS2104", "Fourth Feedback Session"); - String currentValidUrl = viewResponseLink.getAttribute("href"); - - ______TS("test case: fail, fetch response rate of invalid url"); - homePage.setViewResponseLinkValue(viewResponseLink, "/invalid/url"); - homePage.clickViewResponseLink("CHomeUiT.CS2104", "Fourth Feedback Session"); - homePage.verifyHtmlMainContent("/instructorHomeHTMLResponseRateFail.html"); - - ______TS("test case: fail to fetch response rate again, check consistency of fail message"); - homePage.clickViewResponseLink("CHomeUiT.CS2104", "Fourth Feedback Session"); - homePage.verifyHtmlMainContent("/instructorHomeHTMLResponseRateFail.html"); - - ______TS("test case: pass with valid url after multiple fails"); - viewResponseLink = homePage.getViewResponseLink("CHomeUiT.CS2104", "Fourth Feedback Session"); - homePage.setViewResponseLinkValue(viewResponseLink, currentValidUrl); - homePage.clickViewResponseLink("CHomeUiT.CS2104", "Fourth Feedback Session"); - homePage.verifyHtmlMainContent("/instructorHomeHTMLResponseRatePass.html"); - } - - private void testContent() throws Exception { - - ______TS("content: no courses"); - - //this case is implicitly tested when testing for 'delete course' action and - //new instructor without sample course - //loginAsInstructor(testData.accounts.get("newInstructorWithSampleCourse").email); - ______TS("content: new instructor, with status message HINT_FOR_NEW_INSTRUCTOR"); - - //already logged in - homePage.loadInstructorHomeTab(); - homePage.verifyHtmlMainContent("/instructorHomeNewInstructorWithoutSampleCourse.html"); - - CourseAttributes newCourse = CourseAttributes - .builder("newIns.wit-demo") - .withName("Sample Course 101") - .withTimezone(ZoneId.of("UTC")) - .build(); - BackDoor.createCourse(newCourse); - @SuppressWarnings("deprecation") - InstructorAttributes instr = InstructorAttributes - .builder("newIns.wit-demo", "CHomeUiT.instructor.tmms@gmail.tmt") - .withName("Teammates Test New Instructor With Sample") - .withGoogleId("CHomeUiT.instructor.tmms.new") - .build(); - BackDoor.createInstructor(instr); - - homePage.loadInstructorHomeTab(); - homePage.verifyHtmlMainContent("/instructorHomeNewInstructorWithSampleCourse.html"); - - ______TS("content: multiple courses"); - - loginAsCommonInstructor(); - - // Should not see private session - homePage.verifyHtmlMainContent("/instructorHomeHTMLWithHelperView.html"); - updateInstructorToCoownerPrivileges(); - homePage.loadInstructorHomeTab(); - homePage.verifyHtmlMainContent("/instructorHomeHTML.html"); - - ______TS("content: require sanitization"); - - loginAsInstructor("CHomeUiT.idOfInstructor1OfTestingSanitizationCourse"); - homePage.loadInstructorHomeTab(); - homePage.verifyHtmlMainContent("/instructorHomeTestingSanitization.html"); - - } - - private void updateInstructorToCoownerPrivileges() { - // update current instructor for CS1101 to have Co-owner privileges - InstructorAttributes instructor = testData.instructors.get("CHomeUiT.instr.CS1101"); - BackDoor.deleteInstructor(instructor.courseId, instructor.email); - instructor.privileges.setDefaultPrivilegesForCoowner(); - BackDoor.createInstructor(instructor); - } - - private void testHelpLink() { - - ______TS("link: help page"); - - InstructorHelpPage helpPage = homePage.loadInstructorHelpTab(); - helpPage.closeCurrentWindowAndSwitchToParentWindow(); - - } - - private void testCourseLinks() { - String courseId = testData.courses.get("CHomeUiT.CS1101").getId(); - String instructorId = testData.accounts.get("account").googleId; - - ______TS("link: course enroll"); - InstructorCourseEnrollPage enrollPage = homePage.clickCourseEnrollLink(courseId); - enrollPage.verifyContains("Enroll Students for CHomeUiT.CS1101"); - String expectedEnrollLinkText = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_ENROLL_PAGE) - .withCourseId(courseId) - .withUserId(instructorId) - .toAbsoluteString(); - assertEquals(expectedEnrollLinkText, browser.driver.getCurrentUrl()); - homePage.goToPreviousPage(InstructorHomePage.class); - - ______TS("link: course view"); - InstructorCourseDetailsPage detailsPage = homePage.clickCourseViewLink(courseId); - detailsPage.verifyContains("Course Details"); - String expectedViewLinkText = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_DETAILS_PAGE) - .withCourseId(courseId) - .withUserId(instructorId) - .toAbsoluteString(); - assertEquals(expectedViewLinkText, browser.driver.getCurrentUrl()); - homePage.goToPreviousPage(InstructorHomePage.class); - - ______TS("link: course edit"); - InstructorCourseEditPage editPage = homePage.clickCourseEditLink(courseId); - editPage.verifyContains("Edit Course Details"); - String expectedEditLinkText = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_EDIT_PAGE) - .withCourseId(courseId) - .withUserId(instructorId) - .toAbsoluteString(); - assertEquals(expectedEditLinkText, browser.driver.getCurrentUrl()); - homePage.goToPreviousPage(InstructorHomePage.class); - - ______TS("link: course add session"); - InstructorFeedbackSessionsPage feedbacksPage = homePage.clickCourseAddEvaluationLink(courseId); - feedbacksPage.verifyContains("Add New Feedback Session"); - String expectedAddSessionLinkText = createUrl(Const.WebPageURIs.INSTRUCTOR_SESSIONS_PAGE) - .withUserId(instructorId) - .withCourseId(courseId) - .toAbsoluteString(); - assertEquals(expectedAddSessionLinkText, browser.driver.getCurrentUrl()); - homePage.goToPreviousPage(InstructorHomePage.class); - - } - - private void testRemindActions() { - - ______TS("remind action: AWAITING feedback session"); - - homePage.verifyUnclickable(homePage.getRemindLink(feedbackSessionAwaiting.getCourseId(), - feedbackSessionAwaiting.getFeedbackSessionName())); - homePage.verifyUnclickable(homePage.getRemindOptionsLink(feedbackSessionAwaiting.getCourseId(), - feedbackSessionAwaiting.getFeedbackSessionName())); - - ______TS("remind action: OPEN feedback session - outer button"); - - homePage.clickAndCancel(homePage.getRemindLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName())); - homePage.clickAndConfirm(homePage.getRemindLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName())); - - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); - - ______TS("remind action: OPEN feedback session - inner button"); - - homePage.clickRemindOptionsLink(feedbackSessionOpen.getCourseId(), feedbackSessionOpen.getFeedbackSessionName()); - homePage.clickAndCancel(homePage.getRemindInnerLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName())); - homePage.clickRemindOptionsLink(feedbackSessionOpen.getCourseId(), feedbackSessionOpen.getFeedbackSessionName()); - homePage.clickAndConfirm(homePage.getRemindInnerLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName())); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); - - ______TS("remind particular users action: OPEN feedback session"); - - homePage.clickRemindOptionsLink(feedbackSessionOpen.getCourseId(), feedbackSessionOpen.getFeedbackSessionName()); - homePage.clickRemindParticularUsersLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName()); - homePage.cancelRemindParticularUsersForm(); - - homePage.clickRemindOptionsLink(feedbackSessionOpen.getCourseId(), feedbackSessionOpen.getFeedbackSessionName()); - homePage.clickRemindParticularUsersLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName()); - homePage.waitForAjaxLoaderGifToDisappear(); - homePage.submitRemindParticularUsersForm(); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSEMPTYRECIPIENT); - homePage.clickRemindOptionsLink(feedbackSessionOpen.getCourseId(), feedbackSessionOpen.getFeedbackSessionName()); - homePage.clickRemindParticularUsersLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName()); - homePage.waitForAjaxLoaderGifToDisappear(); - homePage.fillRemindParticularUsersForm(); - homePage.submitRemindParticularUsersForm(); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); - - ______TS("remind action: CLOSED feedback session - inner button"); - - homePage.clickRemindOptionsLink(feedbackSessionClosed.getCourseId(), feedbackSessionClosed.getFeedbackSessionName()); - homePage.clickAndCancel(homePage.getRemindInnerLink(feedbackSessionClosed.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName())); - homePage.clickRemindOptionsLink(feedbackSessionClosed.getCourseId(), feedbackSessionClosed.getFeedbackSessionName()); - homePage.clickAndConfirm(homePage.getRemindInnerLink(feedbackSessionClosed.getCourseId(), - feedbackSessionClosed.getFeedbackSessionName())); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSESSIONNOTOPEN); - - ______TS("remind particular users action: CLOSED feedback session"); - - homePage.clickRemindOptionsLink(feedbackSessionClosed.getCourseId(), feedbackSessionClosed.getFeedbackSessionName()); - homePage.clickRemindParticularUsersLink(feedbackSessionClosed.getCourseId(), - feedbackSessionClosed.getFeedbackSessionName()); - homePage.cancelRemindParticularUsersForm(); - - homePage.clickRemindOptionsLink(feedbackSessionClosed.getCourseId(), feedbackSessionClosed.getFeedbackSessionName()); - homePage.clickRemindParticularUsersLink(feedbackSessionClosed.getCourseId(), - feedbackSessionClosed.getFeedbackSessionName()); - homePage.waitForAjaxLoaderGifToDisappear(); - homePage.submitRemindParticularUsersForm(); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSESSIONNOTOPEN); - - homePage.clickRemindOptionsLink(feedbackSessionClosed.getCourseId(), feedbackSessionClosed.getFeedbackSessionName()); - homePage.clickRemindParticularUsersLink(feedbackSessionClosed.getCourseId(), - feedbackSessionClosed.getFeedbackSessionName()); - homePage.waitForAjaxLoaderGifToDisappear(); - homePage.fillRemindParticularUsersForm(); - homePage.submitRemindParticularUsersForm(); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSESSIONNOTOPEN); - - ______TS("remind action: PUBLISHED feedback session"); - - homePage.verifyUnclickable(homePage.getRemindLink(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName())); - homePage.verifyUnclickable(homePage.getRemindOptionsLink(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName())); - - } - - private void testPublishUnpublishResendLinkActions() { - ______TS("publish action: AWAITING feedback session"); - - homePage.verifyUnclickable(homePage.getSessionResultsOptionsCaretElement(feedbackSessionAwaiting.getCourseId(), - feedbackSessionAwaiting.getFeedbackSessionName())); - - ______TS("publish action: OPEN feedback session"); - - homePage.clickAndCancel(homePage.getPublishLink(feedbackSessionOpen.getCourseId(), - feedbackSessionOpen.getFeedbackSessionName())); - - ______TS("publish action: CLOSED feedback session"); - - homePage.clickAndCancel(homePage.getPublishLink(feedbackSessionClosed.getCourseId(), - feedbackSessionClosed.getFeedbackSessionName())); - - ______TS("unpublish action: PUBLISHED feedback session"); - homePage.clickFeedbackSessionUnpublishLink(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_UNPUBLISHED); - assertFalse(BackDoor.getFeedbackSession(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()).isPublished()); - - ______TS("publish action: PUBLISHED feedback session"); - homePage.clickFeedbackSessionPublishLink(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_PUBLISHED); - assertTrue(BackDoor.getFeedbackSession(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()).isPublished()); - - ______TS("resend link action: PUBLISHED feedback session"); - // Test that the resend published link button exists for this published session - homePage.verifyResendPublishedEmailButtonExists(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - - // Test that the resend published link button can be clicked and the form can be cancelled - homePage.clickSessionResultsOptionsCaretElement(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.clickResendPublishedEmailLink(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.cancelResendPublishedEmailForm(); - - // Test the status message when the form is submitted with empty recipient list - homePage.clickSessionResultsOptionsCaretElement(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.clickResendPublishedEmailLink(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.waitForAjaxLoaderGifToDisappear(); - homePage.submitResendPublishedEmailForm(); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_SESSION_RESEND_EMAIL_EMPTY_RECIPIENT); - homePage.clickSessionResultsOptionsCaretElement(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.clickResendPublishedEmailLink(feedbackSessionPublished.getCourseId(), - feedbackSessionPublished.getFeedbackSessionName()); - homePage.waitForAjaxLoaderGifToDisappear(); - homePage.fillResendPublishedEmailForm(); - homePage.submitResendPublishedEmailForm(); - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals( - Const.StatusMessages.FEEDBACK_SESSION_RESEND_EMAIL_EMPTY_RECIPIENT); - - ______TS("resend link action: NOT PUBLISHED feedback session"); - // Test that the resend published link button does not exist for this not published session - homePage.verifyResendPublishedEmailButtonDoesNotExist(feedbackSessionAwaiting.getCourseId(), - feedbackSessionAwaiting.getFeedbackSessionName()); - } - - private void testArchiveCourseAction() throws Exception { - String courseIdForCS1101 = testData.courses.get("CHomeUiT.CS1101").getId(); - - ______TS("archive course action: click and cancel"); - - homePage.clickArchiveCourseLinkAndCancel(courseIdForCS1101); - - InstructorAttributes instructor = BackDoor.getInstructorByGoogleId("CHomeUiT.instructor.tmms", courseIdForCS1101); - InstructorAttributes helper = BackDoor.getInstructorByGoogleId("CHomeUiT.instructor.tmms.helper", courseIdForCS1101); - - // Both will be false before it is archived for testing - assertFalse(instructor.isArchived); - assertFalse(helper.isArchived); - - ______TS("archive course action: click and confirm"); - - homePage.clickArchiveCourseLinkAndConfirm(courseIdForCS1101); - - instructor = BackDoor.getInstructorByGoogleId("CHomeUiT.instructor.tmms", courseIdForCS1101); - helper = BackDoor.getInstructorByGoogleId("CHomeUiT.instructor.tmms.helper", courseIdForCS1101); - assertTrue(instructor.isArchived); - assertFalse(helper.isArchived); - - homePage.verifyHtmlMainContent("/instructorHomeCourseArchiveSuccessful.html"); - - ______TS("archive action failed"); - - String courseIdForCS2104 = testData.courses.get("CHomeUiT.CS2104").getId(); - - //delete the course, then submit archive request to it - BackDoor.deleteCourse(courseIdForCS2104); - homePage.clickArchiveCourseLinkAndConfirm(courseIdForCS2104); - // assertTrue(browser.driver.getCurrentUrl().contains(Url.addParamToUrl(Const.ViewURIs.UNAUTHORIZED, - // Const.ParamsNames.ERROR_FEEDBACK_URL_REQUESTED, Const.ActionURIs.INSTRUCTOR_COURSE_ARCHIVE))); - // recover the deleted course and its related entities - testData = loadDataBundle("/InstructorHomePageUiTest2.json"); - removeAndRestoreDataBundle(testData); - loginAsCommonInstructor(); - homePage.clickArchiveCourseLinkAndConfirm(courseIdForCS1101); - homePage.loadInstructorHomeTab(); - } - - private void testCopyToFsAction() throws Exception { - String feedbackSessionName = "First Feedback Session"; - String courseId = testData.courses.get("CHomeUiT.CS2104").getId(); - - ______TS("Submit empty course list: Home Page"); - - homePage.clickFsCopyButton(courseId, feedbackSessionName); - homePage.getFsCopyModal().waitForModalToLoad(); - homePage.getFsCopyModal().clickSubmitButton(); - homePage.getFsCopyModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(homePage.getFsCopyModal().isFormSubmissionStatusMessageVisible()); - homePage.getFsCopyModal().verifyStatusMessage(Const.StatusMessages.FEEDBACK_SESSION_COPY_NONESELECTED); - - homePage.getFsCopyModal().clickCloseButton(); - - ______TS("Copying fails due to fs with same name in course selected: Home Page"); - - homePage.clickFsCopyButton(courseId, feedbackSessionName); - homePage.getFsCopyModal().waitForModalToLoad(); - homePage.getFsCopyModal().fillFormWithAllCoursesSelected(feedbackSessionName); - - homePage.getFsCopyModal().clickSubmitButton(); - - String error = String.format(Const.StatusMessages.FEEDBACK_SESSION_COPY_ALREADYEXISTS, - feedbackSessionName, courseId); - homePage.getFsCopyModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(homePage.getFsCopyModal().isFormSubmissionStatusMessageVisible()); - homePage.getFsCopyModal().verifyStatusMessage(error); - - homePage.getFsCopyModal().clickCloseButton(); - - ______TS("Copying fails due to fs with invalid name: Home Page"); - - homePage.clickFsCopyButton(courseId, feedbackSessionName); - homePage.getFsCopyModal().waitForModalToLoad(); - String invalidFeedbackSessionName = "Invalid name | for feedback session"; - homePage.getFsCopyModal().fillFormWithAllCoursesSelected(invalidFeedbackSessionName); - - homePage.getFsCopyModal().clickSubmitButton(); - homePage.getFsCopyModal().waitForFormSubmissionErrorMessagePresence(); - assertTrue(homePage.getFsCopyModal().isFormSubmissionStatusMessageVisible()); - - homePage.getFsCopyModal().verifyStatusMessage( - getPopulatedErrorMessage( - FieldValidator.INVALID_NAME_ERROR_MESSAGE, invalidFeedbackSessionName, - FieldValidator.FEEDBACK_SESSION_NAME_FIELD_NAME, - FieldValidator.REASON_CONTAINS_INVALID_CHAR)); - homePage.getFsCopyModal().clickCloseButton(); - - ______TS("Successful case: Home Page"); - - homePage.clickFsCopyButton(courseId, feedbackSessionName); - homePage.getFsCopyModal().waitForModalToLoad(); - homePage.getFsCopyModal().fillFormWithAllCoursesSelected("New name!"); - - homePage.getFsCopyModal().clickSubmitButton(); - - homePage.waitForPageToLoad(); - homePage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_SESSION_COPIED); - - homePage.goToPreviousPage(InstructorHomePage.class); - - ______TS("Failure case: Ajax error"); - - // Change action link so that ajax will fail - homePage.changeFsCopyButtonActionLink(courseId, feedbackSessionName, "/page/nonExistentPage?"); - - homePage.clickFsCopyButton(courseId, feedbackSessionName); - // Wait for modal to appear and show error. - homePage.getFsCopyModal().waitForModalLoadingError(); - homePage.getFsCopyModal().clickCloseButton(); - - } - - private void testDeleteCourseAction() throws Exception { - - ______TS("delete course action"); - - String courseId = testData.courses.get("CHomeUiT.CS2104").getId(); - homePage.clickAndCancel(homePage.getDeleteCourseLink(courseId)); - assertNotNull(BackDoor.getCourse(courseId)); - - homePage.clickAndConfirm(homePage.getDeleteCourseLink(courseId)); - assertNotNull(BackDoor.getCourse(courseId)); - - homePage.verifyHtmlMainContent("/instructorHomeCourseDeleteSuccessful.html"); - - BackDoor.deleteCourse(courseId); - - //delete the other course as well - courseId = testData.courses.get("CHomeUiT.CS1101").getId(); - BackDoor.deleteCourse(courseId); - - homePage.loadInstructorHomeTab(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLEmpty.html"); - - } - - private void testSearchAction() { - // Tested in student list page - } - - private void testSortAction() throws Exception { - ______TS("sort courses by id"); - homePage.clickSortByIdButton(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLSortById.html"); - - ______TS("sort courses by name"); - homePage.clickSortByNameButton(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLSortByName.html"); - - ______TS("sort courses by date"); - homePage.clickSortByDateButton(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLSortByDate.html"); - - ______TS("sort sessions by session name"); - homePage.sortTablesByName(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLSortSessionsByName.html"); - - ______TS("sort sessions by session start date"); - homePage.sortTablesByStartDate(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLSortSessionsByStartDate.html"); - - ______TS("sort sessions by session end date"); - homePage.sortTablesByEndDate(); - homePage.verifyHtmlMainContent("/instructorHomeHTMLSortSessionsByEndDate.html"); - } - - private void loginAsNewInstructor() { - String newInstructor = "CHomeUiT.instructor.tmms.new"; - loginAsInstructor(newInstructor); - } - - private void loginAsCommonInstructor() { - String commonInstructor = "CHomeUiT.instructor.tmms"; - loginAsInstructor(commonInstructor); - } - - private void loginAsInstructor(String googleId) { - AppUrl editUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE) - .withUserId(googleId); - - homePage = loginAdminToPageOld(editUrl, InstructorHomePage.class); - } - - private void loginWithPersistenceProblem() { - AppUrl homeUrl = ((AppUrl) createUrl(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE) - .withParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, "something")) - .withUserId("unreg_user"); - - homePage = loginAdminToPageOld(homeUrl, InstructorHomePage.class); - - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorSearchPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorSearchPageUiTest.java deleted file mode 100644 index 2d15b2d195e..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorSearchPageUiTest.java +++ /dev/null @@ -1,219 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.io.File; -import java.io.IOException; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.JsonUtils; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.driver.BackDoor; -import teammates.test.driver.FileHelper; -import teammates.test.pageobjects.InstructorCourseDetailsPage; -import teammates.test.pageobjects.InstructorCourseStudentDetailsEditPage; -import teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage; -import teammates.test.pageobjects.InstructorSearchPage; -import teammates.test.pageobjects.InstructorStudentRecordsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_SEARCH_PAGE}. - */ -public class InstructorSearchPageUiTest extends BaseE2ETestCase { - private InstructorSearchPage searchPage; - - @Override - protected void prepareTestData() throws Exception { - testData = loadDataBundle("/InstructorSearchPageUiTest.json"); - removeAndRestoreDataBundle(testData); - putDocuments(testData); - - // upload a profile picture for one of the students - StudentAttributes student = testData.students.get("student2InCourse1"); - File picture = new File("src/test/resources/images/profile_pic_updated.png"); - String pictureData = JsonUtils.toJson(FileHelper.readFileAsBytes(picture.getAbsolutePath())); - assertEquals("Unable to upload profile picture", "[BACKDOOR_STATUS_SUCCESS]", - BackDoor.uploadAndUpdateStudentProfilePicture(student.googleId, pictureData)); - } - - @Test - public void allTests() throws Exception { - - testContent(); - testSearch(); - - testViewAction(); - testEditAction(); - testAllRecordsAction(); - testDeleteAction(); - - testSanitization(); - - } - - private void testContent() throws Exception { - - ______TS("content: default search page"); - - String instructorId = testData.accounts.get("instructor1OfCourse1").googleId; - searchPage = getInstructorSearchPage(instructorId); - - // This is the full HTML verification for Instructor Search Page, the rest can all be verifyMainHtml - searchPage.verifyHtml("/instructorSearchPageDefault.html"); - - } - - private void testSearch() throws Exception { - - ______TS("search for nothing"); - - String instructorId = testData.accounts.get("instructor1OfCourse1").googleId; - String searchContent = "comment"; - searchPage.inputSearchContent(searchContent); - searchPage.clickStudentCheckBox(); - searchPage.clickSearchButton(); - searchPage.verifyHtmlMainContent("/instructorSearchPageSearchNone.html"); - - ______TS("search for feedback response comments"); - - searchContent = "response comment"; - searchPage.clickFeedbackResponseCommentCheckBox(); - searchPage.clickStudentCheckBox(); - searchPage.clickSearchButton(); - searchPage.verifyHtmlMainContent("/instructorSearchPageSearchFeedbackResponseComments.html"); - - ______TS("search for feedback response comments as helper"); - - String instructorHelperId = testData.accounts.get("helperOfCourse1").googleId; - searchPage = getInstructorSearchPage(instructorHelperId); - searchPage.clickFeedbackResponseCommentCheckBox(); - searchPage.clickStudentCheckBox(); - searchPage.inputSearchContent(searchContent); - searchPage.clickSearchButton(); - searchPage.verifyHtmlMainContent("/instructorSearchPageSearchCommentsAsHelper.html"); - - searchPage = getInstructorSearchPage(instructorId); - - ______TS("search exact string for students"); - - searchPage.clearSearchBox(); - searchContent = "\"student2 2 In Course1\""; - searchPage.inputSearchContent(searchContent); - searchPage.clickSearchButton(); - searchPage.verifyHtmlMainContent("/instructorSearchPageSearchStudentsForStudent2WithExactString.html"); - - ______TS("search for students"); - - searchPage.clearSearchBox(); - searchContent = "Course1 In student1"; - searchPage.inputSearchContent(searchContent); - searchPage.clickSearchButton(); - searchPage.verifyHtmlMainContent("/instructorSearchPageSearchStudentsForStudent1.html"); - searchPage.clearSearchBox(); - searchContent = "In student2"; - searchPage.inputSearchContent(searchContent); - searchPage.clickSearchButton(); - searchPage.clickAndHoverPicture("studentphoto-c0.1"); - searchPage.verifyHtmlMainContent("/instructorSearchPageSearchStudentsForStudent2.html"); - } - - private void testViewAction() { - - ______TS("action: view"); - - searchPage.clearSearchBox(); - String searchContent = "\"student2 2 In Course1\""; - searchPage.inputSearchContent(searchContent); - searchPage.clickSearchButton(); - - String studentName = testData.students.get("student2.2InCourse1").name; - String studentEmail = testData.students.get("student2.2InCourse1").email; - String courseId = testData.courses.get("typicalCourse1").getId(); - - searchPage.clickViewStudent(courseId, studentName); - InstructorCourseStudentDetailsViewPage studentDetailsViewPage = searchPage - .changePageType(InstructorCourseStudentDetailsViewPage.class); - studentDetailsViewPage.verifyIsCorrectPage(studentEmail); - studentDetailsViewPage.closeCurrentWindowAndSwitchToParentWindow(); - } - - private void testEditAction() { - - ______TS("action: edit"); - - searchPage.clearSearchBox(); - String searchContent = "\"student2 2 In Course1\""; - searchPage.inputSearchContent(searchContent); - searchPage.clickSearchButton(); - - String studentName = testData.students.get("student2.2InCourse1").name; - String studentEmail = testData.students.get("student2.2InCourse1").email; - String courseId = testData.courses.get("typicalCourse1").getId(); - - searchPage.clickEditStudent(courseId, studentName); - InstructorCourseStudentDetailsEditPage studentDetailsEditPage = searchPage - .changePageType(InstructorCourseStudentDetailsEditPage.class); - studentDetailsEditPage.verifyIsCorrectPage(studentEmail); - studentDetailsEditPage.closeCurrentWindowAndSwitchToParentWindow(); - } - - private void testAllRecordsAction() { - - ______TS("action: all records"); - - searchPage.clearSearchBox(); - String searchContent = "\"student2 2 In Course1\""; - searchPage.inputSearchContent(searchContent); - searchPage.clickSearchButton(); - - String studentName = testData.students.get("student2.2InCourse1").name; - String courseId = testData.courses.get("typicalCourse1").getId(); - - searchPage.clickAllRecordsLink(courseId, studentName); - InstructorStudentRecordsPage studentRecordsPage = searchPage - .changePageType(InstructorStudentRecordsPage.class); - studentRecordsPage.verifyIsCorrectPage(studentName); - studentRecordsPage.closeCurrentWindowAndSwitchToParentWindow(); - } - - private void testDeleteAction() { - - ______TS("action: delete"); - - String studentName = testData.students.get("student2.2InCourse1").name; - String studentEmail = testData.students.get("student2.2InCourse1").email; - String courseId = testData.courses.get("typicalCourse1").getId(); - - searchPage.clickDeleteAndCancel(courseId, studentName); - assertNotNull(BackDoor.getStudent(courseId, studentEmail)); - - searchPage.clickDeleteAndConfirm(courseId, studentName); - InstructorCourseDetailsPage courseDetailsPage = searchPage.changePageType(InstructorCourseDetailsPage.class); - courseDetailsPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.STUDENT_DELETED); - assertNull(BackDoor.getStudent(courseId, studentEmail)); - } - - private void testSanitization() throws IOException { - - ______TS("action: test sanitization"); - - String instructorId = testData.accounts.get("instructor1OfTestingSanitizationCourse").googleId; - searchPage = getInstructorSearchPage(instructorId); - - String searchContent = "Normal feedback session name"; - searchPage.inputSearchContent(searchContent); - searchPage.clickFeedbackResponseCommentCheckBox(); - searchPage.clickSearchButton(); - searchPage.verifyHtmlMainContent("/instructorSearchPageSearchTestingSanitization.html"); - } - - private InstructorSearchPage getInstructorSearchPage(String instructorId) { - AppUrl searchPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_SEARCH_PAGE) - .withUserId(instructorId); - - return loginAdminToPageOld(searchPageUrl, InstructorSearchPage.class); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorStudentListPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorStudentListPageUiTest.java deleted file mode 100644 index 4ac57266383..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorStudentListPageUiTest.java +++ /dev/null @@ -1,302 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.io.File; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.DataBundle; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.JsonUtils; -import teammates.common.util.StringHelper; -import teammates.common.util.ThreadHelper; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.driver.FileHelper; -import teammates.test.pageobjects.InstructorCourseDetailsPage; -import teammates.test.pageobjects.InstructorCourseEnrollPage; -import teammates.test.pageobjects.InstructorCourseStudentDetailsEditPage; -import teammates.test.pageobjects.InstructorCourseStudentDetailsViewPage; -import teammates.test.pageobjects.InstructorStudentListPage; -import teammates.test.pageobjects.InstructorStudentRecordsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_STUDENT_LIST_PAGE}. - */ -@Priority(-1) -public class InstructorStudentListPageUiTest extends BaseE2ETestCase { - private InstructorStudentListPage viewPage; - - @Override - protected void prepareTestData() throws Exception { - testData = loadDataBundle("/InstructorStudentListPageUiTest.json"); - removeAndRestoreDataBundle(testData); - - DataBundle studentsOnly = new DataBundle(); - studentsOnly.students = testData.students; - putDocuments(studentsOnly); // put the search document for students only - - // upload a profile picture for one of the students - StudentAttributes student = testData.students.get("Student3Course3"); - File picture = new File("src/test/resources/images/profile_pic_updated.png"); - String pictureData = JsonUtils.toJson(FileHelper.readFileAsBytes(picture.getAbsolutePath())); - assertEquals("Unable to upload profile picture", "[BACKDOOR_STATUS_SUCCESS]", - BackDoor.uploadAndUpdateStudentProfilePicture(student.googleId, pictureData)); - } - - @Test - public void testAll() throws Exception { - testContent(); - testLinks(); - testSearch(); - testDeleteAction(); - testSearchScript(); - testDisplayArchive(); - testShowPhoto(); - } - - private void testSearch() throws Exception { - - InstructorAttributes instructorWith2Courses = testData.instructors.get("instructorOfCourse2"); - String instructorId = instructorWith2Courses.googleId; - - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - ______TS("content: search no match"); - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.setSearchKey("noMatch"); - - viewPage.verifyHtmlMainContent("/instructorStudentListPageSearchNoMatch.html"); - - ______TS("content: search student with 1 result"); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.setSearchKey("charlie"); - viewPage.verifyHtmlMainContent("/instructorStudentListPageSearchStudent.html"); - - ______TS("content: search student with multiple results"); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.setSearchKey("alice"); - viewPage.verifyHtmlMainContent("/instructorStudentListPageSearchStudentMultiple.html"); - - } - - private void testContent() throws Exception { - String instructorId; - - ______TS("content: 2 course with students"); - - InstructorAttributes instructorWith2Courses = testData.instructors.get("instructorOfCourse2"); - instructorId = instructorWith2Courses.googleId; - - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - // This is the full HTML verification for Instructor Student List Page, the rest can all be verifyMainHtml - viewPage.verifyHtml("/instructorStudentListWithHelperView.html"); - - // verify copy email functionality - viewPage.toggleShowEmailCheckbox(); - assertFalse(viewPage.isCopyEmailButtonVisible()); - viewPage.toggleShowEmailCheckbox(); - viewPage.clickCopyEmailButton(); - viewPage.waitForCopyEmailPopoverVisible(); - assertEquals(viewPage.getShownEmailsText(), viewPage.getSelectedText().trim()); - - // update current instructor privileges - BackDoor.deleteInstructor(instructorWith2Courses.courseId, instructorWith2Courses.email); - instructorWith2Courses.privileges.setDefaultPrivilegesForCoowner(); - BackDoor.createInstructor(instructorWith2Courses); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - viewPage.verifyHtmlMainContent("/instructorStudentList.html"); - - ______TS("content: 1 course with no students"); - - instructorId = testData.instructors.get("instructorOfCourse1").googleId; - - viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.checkCourse(0); - viewPage.verifyHtmlMainContent("/instructorStudentListPageNoStudent.html"); - - ______TS("content: no course"); - - instructorId = testData.accounts.get("instructorWithoutCourses").googleId; - - viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.verifyHtmlMainContent("/instructorStudentListPageNoCourse.html"); - - ______TS("content: data required sanitization"); - - instructorId = testData.accounts.get("instructor1OfTestingSanitizationCourse").googleId; - - viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.verifyHtmlMainContent("/instructorStudentListPageTestingSanitization.html"); - } - - private void testShowPhoto() throws Exception { - // Mouseover actions do not work on Selenium-Chrome - if ("chrome".equals(TestProperties.BROWSER)) { - return; - } - - if (System.getenv("APPVEYOR") != null) { - // The following photo-related tests somehow does not work in AppVeyor environment. - // This should not be the same "bug" as the Chrome-related above as similar tests in - // InstructorFeedbackResultsPageUiTest still pass. - // TODO fix this - return; - } - - String instructorId = testData.instructors.get("instructorOfCourse2").googleId; - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - - ______TS("default image"); - - StudentAttributes student = testData.students.get("Student1Course2"); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - - viewPage.clickShowPhoto(student.course, student.name); - viewPage.verifyProfilePhoto(student.course, student.name, Const.SystemParams.DEFAULT_PROFILE_PICTURE_PATH); - - ______TS("student has uploaded an image"); - - StudentAttributes student2 = testData.students.get("Student3Course3"); - viewPage.clickShowPhoto(student2.course, student2.name); - String photoUrl = createUrl(Const.ResourceURIs.STUDENT_PROFILE_PICTURE) - .withStudentEmail(StringHelper.encrypt(student2.email)) - .withCourseId(StringHelper.encrypt(student2.course)) - .withUserId(instructorId) - .toAbsoluteString(); - viewPage.verifyProfilePhoto(student2.course, student2.name, photoUrl); - viewPage.verifyHtmlMainContent("/instructorStudentListPageWithPicture.html"); - } - - private void testLinks() { - - String instructorId = testData.instructors.get("instructorOfCourse2").googleId; - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - - ______TS("link: enroll"); - String courseId = testData.courses.get("course2").getId(); - InstructorCourseEnrollPage enrollPage = viewPage.clickEnrollStudents(courseId); - enrollPage.verifyIsCorrectPage(courseId); - viewPage = enrollPage.goToPreviousPage(InstructorStudentListPage.class); - - ______TS("link: view"); - - StudentAttributes student1 = testData.students.get("Student2Course2"); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - ThreadHelper.waitFor(500); - InstructorCourseStudentDetailsViewPage studentDetailsPage = viewPage.clickViewStudent(student1.course, - student1.name); - studentDetailsPage.verifyIsCorrectPage(student1.email); - studentDetailsPage.closeCurrentWindowAndSwitchToParentWindow(); - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - - ______TS("link: edit"); - - StudentAttributes student2 = testData.students.get("Student3Course3"); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - ThreadHelper.waitFor(500); - InstructorCourseStudentDetailsEditPage studentEditPage = viewPage.clickEditStudent(student2.course, - student2.name); - studentEditPage.verifyIsCorrectPage(student2.email); - studentEditPage.submitButtonClicked(); - studentEditPage.closeCurrentWindowAndSwitchToParentWindow(); - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - - ______TS("link: view records"); - - viewPage.checkCourse(0); - viewPage.checkCourse(1); - ThreadHelper.waitFor(500); - InstructorStudentRecordsPage studentRecordsPage = viewPage.clickViewRecordsStudent(student2.course, - student2.name); - studentRecordsPage.verifyIsCorrectPage(student2.name); - studentRecordsPage.closeCurrentWindowAndSwitchToParentWindow(); - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - } - - private void testDeleteAction() { - InstructorAttributes instructorWith2Courses = testData.instructors.get("instructorOfCourse2"); - String instructorId = instructorWith2Courses.googleId; - - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - - ______TS("action: delete"); - - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - ThreadHelper.waitFor(500); - String studentName = testData.students.get("Student2Course2").name; - String studentEmail = testData.students.get("Student2Course2").email; - String courseId = testData.courses.get("course2").getId(); - - viewPage.clickDeleteAndCancel(courseId, studentName); - assertNotNull(BackDoor.getStudent(courseId, studentEmail)); - - String expectedStatus = "The student has been removed from the course"; - viewPage.clickDeleteAndConfirm(courseId, studentName); - InstructorCourseDetailsPage courseDetailsPage = viewPage.changePageType(InstructorCourseDetailsPage.class); - courseDetailsPage.waitForTextsForAllStatusMessagesToUserEquals(expectedStatus); - } - - private void testSearchScript() { - // already covered under testContent() - // ______TS("content: search active") - } - - private void testDisplayArchive() throws Exception { - String instructorId = testData.instructors.get("instructorOfCourse4").googleId; - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_LIST_PAGE).withUserId(instructorId); - viewPage = loginAdminToPageOld(viewPageUrl, InstructorStudentListPage.class); - - ______TS("action: display archive"); - - viewPage.clickDisplayArchiveOptions(); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - viewPage.checkCourse(2); - viewPage.verifyHtmlMainContent("/instructorStudentListPageDisplayArchivedCourses.html"); - - ______TS("action: hide archive"); - - viewPage.clickDisplayArchiveOptions(); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - viewPage.verifyHtmlMainContent("/instructorStudentListPageHideArchivedCourses.html"); - - ______TS("action: re-display archive"); - - viewPage.clickDisplayArchiveOptions(); - viewPage.checkCourse(0); - viewPage.checkCourse(1); - viewPage.checkCourse(2); - viewPage.verifyHtmlMainContent("/instructorStudentListPageDisplayArchivedCourses.html"); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorStudentRecordsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorStudentRecordsPageUiTest.java deleted file mode 100644 index 5851e7cd580..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorStudentRecordsPageUiTest.java +++ /dev/null @@ -1,197 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.io.IOException; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.DataBundle; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.test.pageobjects.InstructorStudentRecordsPage; - -/** - * SUT: {@link Const.WebPageURIs#INSTRUCTOR_STUDENT_RECORDS_PAGE}. - */ -public class InstructorStudentRecordsPageUiTest extends BaseE2ETestCase { - private InstructorStudentRecordsPage viewPage; - - private String instructorId; - private String courseId; - private String studentEmail; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/InstructorStudentRecordsPageUiTest.json"); - removeAndRestoreDataBundle(testData); - } - - @Test - public void testAll() throws Exception { - testContent(); - testFeedbackResponseCommentEditAndDeleteAction(); - testLinks(); - testPanelsCollapseExpand(); - } - - private void testContent() throws Exception { - InstructorAttributes instructor; - StudentAttributes student; - - ______TS("content: typical case, normal student records with comments"); - - instructor = testData.instructors.get("teammates.test.CS2104"); - student = testData.students.get("benny.c.tmms@ISR.CS2104"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - // This is the full HTML verification for Instructor Student Records Page, the rest can all be verifyMainHtml - viewPage.verifyHtml("/instructorStudentRecords.html"); - - ______TS("content: typical case, normal student records with comments, helper view"); - - instructor = testData.instructors.get("teammates.test.CS2104.Helper"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - viewPage.verifyHtmlMainContent("/instructorStudentRecordsWithHelperView.html"); - - ______TS("content: normal student records with other instructor's comments, private feedback session"); - - instructor = testData.instructors.get("teammates.test.CS1101"); - student = testData.students.get("teammates.test@ISR.CS1101"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - viewPage.verifyHtmlMainContent("/instructorStudentRecordsPageWithPrivateFeedback.html"); - - ______TS("content: no student records, no profiles"); - - instructor = testData.instructors.get("teammates.noeval"); - student = testData.students.get("alice.b.tmms@ISR.NoEval"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - viewPage.verifyHtmlMainContent("/instructorStudentRecordsPageNoRecords.html"); - - ______TS("content: multiple feedback session type student record"); - - DataBundle testDataQuestionType = loadDataBundle("/FeedbackSessionQuestionTypeTest.json"); - removeAndRestoreDataBundle(testDataQuestionType); - - instructor = testDataQuestionType.instructors.get("instructor1OfCourse1"); - student = testDataQuestionType.students.get("student1InCourse1"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - viewPage.verifyHtmlMainContent("/instructorStudentRecordsPageMixedQuestionType.html"); - - ______TS("content: profile with attemoted script and html injection with comment"); - - instructor = testData.instructors.get("instructor1OfTestingSanitizationCourse"); - student = testData.students.get("student1InTestingSanitizationCourse"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - viewPage.verifyHtmlMainContent("/instructorStudentRecordsPageWithScriptInjectionProfile.html"); - - } - - private void testLinks() { - // TODO add link to a feedback session - } - - private void testFeedbackResponseCommentEditAndDeleteAction() throws IOException { - InstructorAttributes instructor; - StudentAttributes student; - - instructor = testData.instructors.get("teammates.test.CS2104"); - student = testData.students.get("benny.c.tmms@ISR.CS2104"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - - ______TS("Typical Case: Edit comment created by different instructor"); - - viewPage.editFeedbackResponseComment("-RGQ-1-1-1-1", - "First edited comment to Alice about feedback to Benny from different Instructor"); - viewPage.verifyCommentRowContent("-RGQ-1-1-1-1", "First edited comment to Alice about feedback to Benny from " - + "different Instructor", - "Teammates Test"); - viewPage.verifyHtmlMainContent("/instructorStudentRecordsPageEditedCommentOfDifferentInstructor.html"); - - ______TS("Typical Case: Edit comment"); - - viewPage.editFeedbackResponseComment("-RGQ-1-1-1-2", - "Instructor second edited comment to Alice about feedback to Benny"); - viewPage.verifyCommentRowContent("-RGQ-1-1-1-2", "Instructor second edited comment to Alice about feedback to Benny", - "Teammates Test"); - viewPage.verifyHtmlMainContent("/instructorStudentRecordsPageEditedComment.html"); - - ______TS("Typical Case: Edit and add empty comment"); - - viewPage.editFeedbackResponseComment("-RGQ-1-1-1-2", ""); - viewPage.verifyCommentFormErrorMessage(Const.StatusMessages.FEEDBACK_RESPONSE_COMMENT_EMPTY); - viewPage.closeEditFeedbackResponseCommentForm("-RGQ-1-1-1-2"); - - ______TS("Typical Case: Delete comment"); - - viewPage.deleteFeedbackResponseComment("-RGQ-1-1-1-3"); - viewPage.verifyCommentRowMissing("-RGQ-1-1-1-3"); - } - - private InstructorStudentRecordsPage getStudentRecordsPage() { - AppUrl viewPageUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_STUDENT_RECORDS_PAGE) - .withUserId(instructorId) - .withCourseId(courseId) - .withStudentEmail(studentEmail); - return loginAdminToPageOld(viewPageUrl, InstructorStudentRecordsPage.class); - } - - private void testPanelsCollapseExpand() { - - DataBundle testDataQuestionType = loadDataBundle("/FeedbackSessionQuestionTypeTest.json"); - InstructorAttributes instructor = testDataQuestionType.instructors.get("instructor1OfCourse1"); - StudentAttributes student = testDataQuestionType.students.get("student1InCourse1"); - - instructorId = instructor.googleId; - courseId = instructor.courseId; - studentEmail = student.email; - - viewPage = getStudentRecordsPage(); - - ______TS("Typical case: panels expand/collapse"); - - viewPage.clickAllRecordPanelHeadings(); - viewPage.waitForPanelsToCollapse(); - assertTrue(viewPage.areRecordsHidden()); - - viewPage.clickAllRecordPanelHeadings(); - viewPage.waitForPanelsToExpand(); - assertTrue(viewPage.areRecordsVisible()); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/InstructorSubmissionAdjustmentUiTest.java b/src/test/java/teammates/test/cases/browsertests/InstructorSubmissionAdjustmentUiTest.java deleted file mode 100644 index e8669256fef..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/InstructorSubmissionAdjustmentUiTest.java +++ /dev/null @@ -1,146 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.util.ArrayList; -import java.util.List; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.common.util.ThreadHelper; -import teammates.common.util.retry.MaximumRetriesExceededException; -import teammates.common.util.retry.RetryableTaskReturns; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.Priority; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.InstructorCourseEnrollPage; - -/** - * Covers Ui aspect of submission adjustment for evaluations and feedbacks. - */ -@Priority(1) -public class InstructorSubmissionAdjustmentUiTest extends BaseE2ETestCase { - private InstructorCourseEnrollPage enrollPage; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/InstructorSubmissionAdjustmentUiTest.json"); - - // use the instructor account injected for this test - - testData.accounts.get("instructor1OfCourse1").googleId = TestProperties.TEST_INSTRUCTOR_ACCOUNT; - testData.accounts.get("instructor1OfCourse1").email = TestProperties.TEST_INSTRUCTOR_ACCOUNT + "@gmail.com"; - - removeAndRestoreDataBundle(testData); - } - - @Test - public void testAdjustmentOfSubmission() throws MaximumRetriesExceededException { - - //load the enrollPage - loadEnrollmentPage(); - - ______TS("typical case: enroll new student to existing course"); - - String enrollString = "Section 1\tsomeName\tTeam1.1\trandom@g.tmt\tcomments\t"; - - enrollPage.enroll(enrollString); - - //Wait briefly to allow task queue to successfully execute tasks - ThreadHelper.waitFor(2000); - - ______TS("typical case : existing student changes team"); - loadEnrollmentPage(); - - FeedbackSessionAttributes session = testData.feedbackSessions.get("session2InCourse1"); - StudentAttributes student = testData.students.get("student1InCourse1"); - - //Verify pre-existing submissions and responses - List oldResponsesForSession = - getAllResponsesForStudentForSession(student, session.getFeedbackSessionName()); - assertFalse(oldResponsesForSession.isEmpty()); - - String newTeam = "Team 1.2"; - student.team = newTeam; - - enrollString = "None\t" + student.getTeam() + "\t" - + student.getName() + "\t" + student.getEmail() + "\t"; - enrollPage.enroll(enrollString); - - // It might take a while for the submission adjustment to persist (especially on the live server), - // during which the pre-existing submissions and responses would be counted. - // Hence, this needs to be retried several times until the count becomes zero. - getPersistenceRetryManager().runUntilSuccessful(new RetryableTaskReturns( - "Assert outdated responses removed" - ) { - @Override - public Integer run() { - return getAllResponsesForStudentForSession(student, session.getFeedbackSessionName()).size(); - } - - @Override - public boolean isSuccessful(Integer numberOfResponses) { - return numberOfResponses == 0; - } - }); - - } - - private void loadEnrollmentPage() { - AppUrl enrollUrl = createUrl(Const.WebPageURIs.INSTRUCTOR_COURSE_ENROLL_PAGE) - .withUserId(testData.instructors.get("instructor1OfCourse1").googleId) - .withCourseId(testData.courses.get("typicalCourse1").getId()); - - enrollPage = loginAdminToPageOld(enrollUrl, InstructorCourseEnrollPage.class); - } - - private List getAllTeamResponsesForStudent(StudentAttributes student) { - List returnList = new ArrayList<>(); - - List studentReceiverResponses = BackDoor - .getFeedbackResponsesForReceiverForCourse(student.course, student.email); - - for (FeedbackResponseAttributes response : studentReceiverResponses) { - FeedbackQuestionAttributes question = BackDoor - .getFeedbackQuestion(response.feedbackQuestionId); - if (question.recipientType == FeedbackParticipantType.OWN_TEAM_MEMBERS) { - returnList.add(response); - } - } - - List studentGiverResponses = BackDoor - .getFeedbackResponsesFromGiverForCourse(student.course, student.email); - - for (FeedbackResponseAttributes response : studentGiverResponses) { - FeedbackQuestionAttributes question = BackDoor - .getFeedbackQuestion(response.feedbackQuestionId); - if (question.giverType == FeedbackParticipantType.TEAMS - || question.recipientType == FeedbackParticipantType.OWN_TEAM_MEMBERS) { - returnList.add(response); - } - } - - return returnList; - } - - private List getAllResponsesForStudentForSession(StudentAttributes student, - String feedbackSessionName) { - List returnList = new ArrayList<>(); - - List allResponseOfStudent = getAllTeamResponsesForStudent(student); - - for (FeedbackResponseAttributes responseAttributes : allResponseOfStudent) { - if (responseAttributes.feedbackSessionName.equals(feedbackSessionName)) { - returnList.add(responseAttributes); - } - } - - return returnList; - } -} diff --git a/src/test/java/teammates/test/cases/browsertests/StudentCourseJoinConfirmationPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/StudentCourseJoinConfirmationPageUiTest.java deleted file mode 100644 index 49941c84373..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/StudentCourseJoinConfirmationPageUiTest.java +++ /dev/null @@ -1,228 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import teammates.common.util.Const; -import teammates.common.util.ThreadHelper; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.AppPage; -import teammates.test.pageobjects.StudentCourseJoinConfirmationPage; -import teammates.test.pageobjects.StudentHomePage; - -/** - * SUT: {@link Const.WebPageURIs#JOIN_PAGE}. - */ -public class StudentCourseJoinConfirmationPageUiTest extends BaseE2ETestCase { - private StudentCourseJoinConfirmationPage confirmationPage; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/StudentCourseJoinConfirmationPageUiTest.json"); - - // use the 1st student account injected for this test - - String student1GoogleId = TestProperties.TEST_STUDENT1_ACCOUNT; - String student1Email = student1GoogleId + "@gmail.com"; - testData.accounts.get("alice.tmms").googleId = student1GoogleId; - testData.accounts.get("alice.tmms").email = student1Email; - testData.students.get("alice.tmms@SCJConfirmationUiT.CS2104").email = student1Email; - testData.students.get("alice.tmms@SCJConfirmationUiT.CS2103").email = student1Email; - testData.students.get("alice.tmms@SCJConfirmationUiT.CS1101").googleId = student1GoogleId; - testData.students.get("alice.tmms@SCJConfirmationUiT.CS1101").email = student1Email; - - removeAndRestoreDataBundle(testData); - } - - @BeforeClass - public void classSetup() { - browser.driver.manage().deleteAllCookies(); - logout(); - } - - @Test - public void testAll() throws Exception { - - testContent(); - testJoinNewConfirmation(); - // TODO: remove this test by 21/09/2014 - testJoinConfirmation(); - } - - private void testJoinNewConfirmation() throws Exception { - String expectedMsg; - String homePageActionUrl = createUrl(Const.WebPageURIs.STUDENT_HOME_PAGE).toAbsoluteString(); - String joinLink; - StudentHomePage studentHomePage; - - ______TS("click join link, skips confirmation and asks for login"); - - String courseId = testData.courses.get("SCJConfirmationUiT.CS2104").getId(); - String courseName = testData.courses.get("SCJConfirmationUiT.CS2104").getName(); - String studentEmail = testData.students.get("alice.tmms@SCJConfirmationUiT.CS2104").email; - joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) - .withRegistrationKey(getKeyFromBackDoor(courseId, studentEmail)) - .withCourseId(courseId) - .withStudentEmail(studentEmail) - .toAbsoluteString(); - - browser.driver.get(joinLink); - studentHomePage = AppPage.createCorrectLoginPageType(browser) - .loginAsStudent(TestProperties.TEST_STUDENT1_ACCOUNT, - TestProperties.TEST_STUDENT1_PASSWORD); - - studentHomePage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.STUDENT_COURSE_JOIN_SUCCESSFUL, "[" + courseId + "] " + courseName), - String.format(Const.StatusMessages.HINT_FOR_NO_SESSIONS_STUDENT, "[" + courseId + "] " + courseName), - "Meanwhile, you can update your profile here."); - - ______TS("test student confirmation page content"); - - courseId = testData.courses.get("SCJConfirmationUiT.CS2103").getId(); - courseName = testData.courses.get("SCJConfirmationUiT.CS2103").getName(); - studentEmail = testData.students.get("alice.tmms@SCJConfirmationUiT.CS2103").email; - joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) - .withRegistrationKey(getKeyFromBackDoor(courseId, studentEmail)) - .toAbsoluteString(); - - browser.driver.get(joinLink); - confirmationPage = AppPage.getNewPageInstance(browser, StudentCourseJoinConfirmationPage.class); - // this test uses accounts from test.properties. - // NOTE: the logout link at the bottom of the page has to be changed to {*} - // since the link is different in dev and staging servers - - // This is the full HTML verification for Student Course Join Confirmation Page, the rest can all be verifyMainHtml - confirmationPage.verifyHtml("/studentCourseJoinConfirmationHTML.html"); - - ______TS("Cancelling goes to login page"); - confirmationPage.clickCancelButton(); - - ______TS("Confirming goes to home page"); - browser.driver.get(homePageActionUrl); - studentHomePage = AppPage.createCorrectLoginPageType(browser) - .loginAsStudent(TestProperties.TEST_STUDENT1_ACCOUNT, - TestProperties.TEST_STUDENT1_PASSWORD); - browser.driver.get(joinLink); - confirmationPage = AppPage.getNewPageInstance(browser, StudentCourseJoinConfirmationPage.class); - confirmationPage.clickConfirmButton(); - studentHomePage = AppPage.getNewPageInstance(browser, StudentHomePage.class); - studentHomePage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.STUDENT_COURSE_JOIN_SUCCESSFUL, "[" + courseId + "] " + courseName), - String.format(Const.StatusMessages.HINT_FOR_NO_SESSIONS_STUDENT, "[" + courseId + "] " + courseName), - "Meanwhile, you can update your profile here."); - - ______TS("already joined, no confirmation page"); - - browser.driver.get(joinLink); - confirmationPage = AppPage.getNewPageInstance(browser, StudentCourseJoinConfirmationPage.class); - confirmationPage.clickConfirmButton(); - - studentHomePage = AppPage.getNewPageInstance(browser, StudentHomePage.class); - expectedMsg = "You (" + TestProperties.TEST_STUDENT1_ACCOUNT + ") have already joined this course"; - studentHomePage.waitForTextsForAllStatusMessagesToUserEquals(expectedMsg); - - assertTrue(browser.driver.getCurrentUrl().contains(Const.ParamsNames.ERROR + "=true")); - studentHomePage.logout(); - } - - private void testContent() { - - /*covered in testJoinConfirmation() - *case: click join link then confirm: success: valid key - */ - } - - private void testJoinConfirmation() throws Exception { - logout(); - removeAndRestoreDataBundle(testData); - String expectedMsg; - String homePageActionUrl = createUrl(Const.WebPageURIs.STUDENT_HOME_PAGE).toAbsoluteString(); - String joinLink; - StudentHomePage studentHomePage; - - ______TS("click join link, skips confirmation and asks for login"); - - String courseId = testData.courses.get("SCJConfirmationUiT.CS2104").getId(); - String courseName = testData.courses.get("SCJConfirmationUiT.CS2104").getName(); - String studentEmail = testData.students.get("alice.tmms@SCJConfirmationUiT.CS2104").email; - joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) - .withRegistrationKey(getKeyFromBackDoor(courseId, studentEmail)) - .toAbsoluteString(); - - browser.driver.get(joinLink); - studentHomePage = AppPage.createCorrectLoginPageType(browser) - .loginAsStudent(TestProperties.TEST_STUDENT1_ACCOUNT, - TestProperties.TEST_STUDENT1_PASSWORD); - studentHomePage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.STUDENT_COURSE_JOIN_SUCCESSFUL, "[" + courseId + "] " + courseName), - String.format(Const.StatusMessages.HINT_FOR_NO_SESSIONS_STUDENT, "[" + courseId + "] " + courseName), - "Meanwhile, you can update your profile here."); - - ______TS("test student confirmation page content"); - - courseId = testData.courses.get("SCJConfirmationUiT.CS2103").getId(); - courseName = testData.courses.get("SCJConfirmationUiT.CS2103").getName(); - studentEmail = testData.students.get("alice.tmms@SCJConfirmationUiT.CS2103").email; - joinLink = createUrl(Const.WebPageURIs.JOIN_PAGE) - .withRegistrationKey(getKeyFromBackDoor(courseId, studentEmail)) - .toAbsoluteString(); - - browser.driver.get(joinLink); - confirmationPage = AppPage.getNewPageInstance(browser, StudentCourseJoinConfirmationPage.class); - // this test uses accounts from test.properties - - // This is also a HTML verification for Student Course Join Confirmation Page because they use the - // same html file for verification - confirmationPage.verifyHtml("/studentCourseJoinConfirmationHTML.html"); - - ______TS("Cancelling goes to login page"); - confirmationPage.clickCancelButton(); - - ______TS("Confirming goes to home page"); - browser.driver.get(homePageActionUrl); - studentHomePage = AppPage.createCorrectLoginPageType(browser) - .loginAsStudent(TestProperties.TEST_STUDENT1_ACCOUNT, - TestProperties.TEST_STUDENT1_PASSWORD); - browser.driver.get(joinLink); - confirmationPage = AppPage.getNewPageInstance(browser, StudentCourseJoinConfirmationPage.class); - confirmationPage.clickConfirmButton(); - studentHomePage = AppPage.getNewPageInstance(browser, StudentHomePage.class); - studentHomePage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.STUDENT_COURSE_JOIN_SUCCESSFUL, "[" + courseId + "] " + courseName), - String.format(Const.StatusMessages.HINT_FOR_NO_SESSIONS_STUDENT, "[" + courseId + "] " + courseName), - "Meanwhile, you can update your profile here."); - - ______TS("already joined, no confirmation page"); - - browser.driver.get(joinLink); - confirmationPage = AppPage.getNewPageInstance(browser, StudentCourseJoinConfirmationPage.class); - confirmationPage.clickConfirmButton(); - - studentHomePage = AppPage.getNewPageInstance(browser, StudentHomePage.class); - expectedMsg = "You (" + TestProperties.TEST_STUDENT1_ACCOUNT + ") have already joined this course"; - studentHomePage.waitForTextsForAllStatusMessagesToUserEquals(expectedMsg); - - assertTrue(browser.driver.getCurrentUrl().contains(Const.ParamsNames.ERROR + "=true")); - } - - @AfterClass - public void classTearDown() { - BackDoor.removeDataBundle(testData); - } - - // continuously ask BackDoor to get the key until a legit key is returned - private String getKeyFromBackDoor(String courseId, String studentEmail) { - int numberOfRemainingRetries = 10; - String key = "[BACKDOOR_STATUS_FAILURE]"; - while (key.startsWith("[BACKDOOR_STATUS_FAILURE]") && numberOfRemainingRetries > 0) { - key = BackDoor.getEncryptedKeyForStudent(courseId, studentEmail); - numberOfRemainingRetries--; - ThreadHelper.waitFor(100); - } - return key; - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/StudentFeedbackResultsPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/StudentFeedbackResultsPageUiTest.java deleted file mode 100644 index 83b35fee902..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/StudentFeedbackResultsPageUiTest.java +++ /dev/null @@ -1,177 +0,0 @@ -package teammates.test.cases.browsertests; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.AppPage; -import teammates.test.pageobjects.HomePage; -import teammates.test.pageobjects.LoginPage; -import teammates.test.pageobjects.StudentCourseJoinConfirmationPage; -import teammates.test.pageobjects.StudentFeedbackResultsPage; - -/** - * SUT: {@link Const.WebPageURIs#STUDENT_SESSION_RESULTS_PAGE}. - */ -public class StudentFeedbackResultsPageUiTest extends BaseE2ETestCase { - private StudentFeedbackResultsPage resultsPage; - - @Override - protected void prepareTestData() { - testData = loadDataBundle("/StudentFeedbackResultsPageUiTest.json"); - removeAndRestoreDataBundle(testData); - } - - @Test - public void testAll() throws Exception { - - ______TS("unreg student"); - - logout(); - - // Open Session - StudentAttributes unreg = testData.students.get("DropOut"); - resultsPage = loginToStudentFeedbackResultsPage(unreg, "Open Session", StudentFeedbackResultsPage.class); - resultsPage.verifyHtmlMainContent("/unregisteredStudentFeedbackResultsPageOpen.html"); - - // Mcq Session - resultsPage = loginToStudentFeedbackResultsPage(unreg, "MCQ Session", StudentFeedbackResultsPage.class); - - // This is the full HTML verification for Unregistered Student Feedback Results Page, - // the rest can all be verifyMainHtml - resultsPage.verifyHtml("/unregisteredStudentFeedbackResultsPageMCQ.html"); - - ______TS("no responses"); - - resultsPage = loginToStudentFeedbackResultsPage("Alice", "Empty Session"); - - // This is the full HTML verification for Registered Student Feedback Results Page, - // the rest can all be verifyMainHtml - resultsPage.verifyHtml("/studentFeedbackResultsPageEmpty.html"); - - ______TS("standard session results"); - - resultsPage = loginToStudentFeedbackResultsPage("Alice", "Open Session"); - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageOpen.html"); - - ______TS("team-to-team session results"); - - resultsPage = loginToStudentFeedbackResultsPage("Benny", "Open Session"); - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageTeamToTeam.html"); - - ______TS("MCQ session results"); - - resultsPage = loginToStudentFeedbackResultsPage("Alice", "MCQ Session"); - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageMCQ.html"); - - String additionalInfoId = ""; - int qnNumber = 4; - verifyQuestionAdditionalInfoExpand(qnNumber, additionalInfoId); - verifyQuestionAdditionalInfoCollapse(qnNumber, additionalInfoId); - - additionalInfoId = ""; - qnNumber = 5; - verifyQuestionAdditionalInfoExpand(qnNumber, additionalInfoId); - verifyQuestionAdditionalInfoCollapse(qnNumber, additionalInfoId); - - ______TS("MSQ session results"); - - resultsPage = loginToStudentFeedbackResultsPage("Benny", "MSQ Session"); - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageMSQ.html"); - - additionalInfoId = ""; - qnNumber = 4; - verifyQuestionAdditionalInfoExpand(qnNumber, additionalInfoId); - verifyQuestionAdditionalInfoCollapse(qnNumber, additionalInfoId); - - additionalInfoId = ""; - qnNumber = 5; - verifyQuestionAdditionalInfoExpand(qnNumber, additionalInfoId); - verifyQuestionAdditionalInfoCollapse(qnNumber, additionalInfoId); - - ______TS("NUMSCALE session results"); - - resultsPage = loginToStudentFeedbackResultsPage("Alice", "NUMSCALE Session"); - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageNUMSCALE.html"); - - ______TS("CONSTSUM session results"); - - resultsPage = loginToStudentFeedbackResultsPage("Benny", "CONSTSUM Session"); - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageCONSTSUM.html"); - - ______TS("CONTRIB session results"); - - resultsPage = loginToStudentFeedbackResultsPage("Alice", "CONTRIB Session"); - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageCONTRIB.html"); - - ______TS("unreg student logged in as a student in another course: registered after logging out"); - - String student1Username = TestProperties.TEST_STUDENT1_ACCOUNT; - String student1Password = TestProperties.TEST_STUDENT1_PASSWORD; - - logout(); - LoginPage loginPage = AppPage.getNewPageInstance(browser, HomePage.class).clickStudentLogin(); - loginPage.loginAsStudent(student1Username, student1Password); - - StudentCourseJoinConfirmationPage confirmationPage = - loginToStudentFeedbackResultsPage(unreg, "Open Session", StudentCourseJoinConfirmationPage.class); - confirmationPage.verifyHtmlMainContent("/studentCourseJoinConfirmationLoggedInHTML.html"); - loginPage = confirmationPage.clickCancelButton(); - loginPage.loginAsStudent(student1Username, student1Password, StudentFeedbackResultsPage.class); - - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageNewlyRegistered.html"); - - BackDoor.editStudent(unreg.email, unreg); // clear the googleId - - ______TS("unreg student logged in as a student in another course: registered without logging out"); - - logout(); - loginPage = AppPage.getNewPageInstance(browser, HomePage.class).clickStudentLogin(); - loginPage.loginAsStudent(student1Username, student1Password); - - confirmationPage = - loginToStudentFeedbackResultsPage(unreg, "Open Session", StudentCourseJoinConfirmationPage.class); - confirmationPage.verifyHtmlMainContent("/studentCourseJoinConfirmationLoggedInHTML.html"); - resultsPage = confirmationPage.clickConfirmButton(StudentFeedbackResultsPage.class); - - resultsPage.verifyHtmlMainContent("/studentFeedbackResultsPageNewlyRegistered.html"); - - BackDoor.deleteStudent(unreg.course, unreg.email); - } - - private StudentFeedbackResultsPage loginToStudentFeedbackResultsPage(String studentName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.STUDENT_SESSION_RESULTS_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - return loginAdminToPageOld(editUrl, StudentFeedbackResultsPage.class); - } - - private T loginToStudentFeedbackResultsPage(StudentAttributes s, String fsDataId, - Class typeOfPage) { - AppUrl submitUrl = createUrl(Const.WebPageURIs.STUDENT_SESSION_RESULTS_PAGE) - .withCourseId(s.course) - .withStudentEmail(s.email) - .withSessionName(testData.feedbackSessions.get(fsDataId) - .getFeedbackSessionName()) - .withRegistrationKey(BackDoor.getEncryptedKeyForStudent(s.course, s.email)); - return AppPage.getNewPageInstance(browser, submitUrl, typeOfPage); - } - - private void verifyQuestionAdditionalInfoCollapse(int qnNumber, String additionalInfoId) { - resultsPage.clickQuestionAdditionalInfoButton(qnNumber, additionalInfoId); - assertFalse(resultsPage.isQuestionAdditionalInfoVisible(qnNumber, additionalInfoId)); - assertEquals("[more]", resultsPage.getQuestionAdditionalInfoButtonText(qnNumber, additionalInfoId)); - } - - private void verifyQuestionAdditionalInfoExpand(int qnNumber, String additionalInfoId) { - resultsPage.clickQuestionAdditionalInfoButton(qnNumber, additionalInfoId); - assertTrue(resultsPage.isQuestionAdditionalInfoVisible(qnNumber, additionalInfoId)); - assertEquals("[less]", resultsPage.getQuestionAdditionalInfoButtonText(qnNumber, additionalInfoId)); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/StudentFeedbackSubmitPageUiTest.java b/src/test/java/teammates/test/cases/browsertests/StudentFeedbackSubmitPageUiTest.java deleted file mode 100644 index 18fe72d678e..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/StudentFeedbackSubmitPageUiTest.java +++ /dev/null @@ -1,896 +0,0 @@ -package teammates.test.cases.browsertests; - -import java.time.Instant; - -import org.openqa.selenium.By; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.datatransfer.questions.FeedbackConstantSumResponseDetails; -import teammates.common.datatransfer.questions.FeedbackContributionResponseDetails; -import teammates.common.datatransfer.questions.FeedbackMsqResponseDetails; -import teammates.common.datatransfer.questions.FeedbackNumericalScaleResponseDetails; -import teammates.common.util.AppUrl; -import teammates.common.util.Const; -import teammates.e2e.cases.e2e.BaseE2ETestCase; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.BackDoor; -import teammates.test.pageobjects.AppPage; -import teammates.test.pageobjects.FeedbackSessionNotVisiblePage; -import teammates.test.pageobjects.FeedbackSubmitPage; - -/** - * SUT: {@link Const.WebPageURIs#SESSION_SUBMISSION_PAGE}. - * - *

    The first team is named "Team >'"< 1" to test cases where a HTML character exists in the team name. - */ -public class StudentFeedbackSubmitPageUiTest extends BaseE2ETestCase { - private FeedbackSubmitPage submitPage; - - @Override - protected void prepareTestData() { - // test data is refreshed before each test case - } - - @BeforeMethod - protected void refreshTestData() { - testData = loadDataBundle("/StudentFeedbackSubmitPageUiTest.json"); - removeAndRestoreDataBundle(testData); - } - - @Test - public void testAll() throws Exception { - testContent(); - testSubmitAction(); - testInputValidation(); - testLinks(); - testResponsiveSubmission(); - testModifyData(); - } - - @Test - public void testAddingEditingAndDeletingFeedbackParticipantComments() { - testAddCommentsToQuestionsWithoutResponses(); - testAddCommentsToQuestionsWithResponses(); - testEditCommentsActionAfterAddingComments(); - testDeleteCommentsActionAfterEditingComments(); - } - - private void testLinks() { - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Awaiting Session"); - submitPage.loadStudentHomeTab(); - submitPage = submitPage.goToPreviousPage(FeedbackSubmitPage.class); - submitPage.loadProfileTab(); - - submitPage.logout(); - submitPage = loginToStudentFeedbackSubmitPage(testData.students.get("DropOut"), "Open Session"); - submitPage.clickAndCancel(browser.driver.findElement(By.id("studentHomeNavLink"))); - submitPage.clickAndCancel(browser.driver.findElement(By.id("studentProfileNavLink"))); - } - - private void testContent() throws Exception { - - ______TS("unreg student"); - - logout(); - - submitPage = loginToStudentFeedbackSubmitPage(testData.students.get("DropOut"), "Open Session"); - - // This is the full HTML verification for Unregistered Student Feedback Submit Page, - // the rest can all be verifyMainHtml - submitPage.verifyHtml("/unregisteredStudentFeedbackSubmitPageOpen.html"); - - ______TS("Awaiting session"); - - // this session contains questions to instructors, and since instr3 is not displayed to students, - // student cannot submit to instr3 - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Awaiting Session"); - - // This is the full HTML verification for Registered Student Feedback Submit Page, the rest can all be verifyMainHtml - submitPage.verifyHtml("/studentFeedbackSubmitPageAwaiting.html"); - - ______TS("Open session"); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageOpen.html"); - submitPage.verifyVisibilityAndCloseMoreInfoAboutEqualShareModal(); - - ______TS("Grace period session"); - - FeedbackSessionAttributes fs = BackDoor.getFeedbackSession("SFSubmitUiT.CS2104", - "Grace Period Session"); - - fs.setGracePeriodMinutes(10); - fs.setEndTime(Instant.now().minusSeconds(60)); - BackDoor.editFeedbackSession(fs); - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Grace Period Session"); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageGracePeriod.html"); - - ______TS("Closed session"); - - // see comment for awaiting session - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Closed Session"); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageClosed.html"); - - ______TS("Empty session"); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Empty Session"); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageEmpty.html"); - - ______TS("Not yet visible session"); - - FeedbackSessionNotVisiblePage fsNotVisiblePage = - loginToStudentFeedbackSubmitPageFeedbackSessionNotVisible("Alice", "Not Yet Visible Session"); - fsNotVisiblePage.verifyHtmlMainContent("/studentFeedbackSubmitPageNotYetVisible.html"); - - } - - private void testSubmitAction() throws Exception { - - ______TS("create new responses"); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.waitForPageToLoad(); - - assertTrue(submitPage.isConfirmationEmailBoxTicked()); - - String responseText = "Test Self Feedback"; - submitPage.fillResponseRichTextEditor(1, 0, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(1, 0)); - - responseText = "Response to Benny."; - submitPage.selectRecipient(2, 0, "Benny Charles"); - submitPage.fillResponseRichTextEditor(2, 0, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(2, 0)); - - responseText = "Response to student who is going to drop out."; - submitPage.selectRecipient(2, 1, "Drop out"); - submitPage.fillResponseRichTextEditor(2, 1, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(2, 1)); - - responseText = "Response to extra guy."; - submitPage.selectRecipient(2, 2, "Extra guy"); - submitPage.fillResponseRichTextEditor(2, 2, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(2, 2)); - submitPage.fillResponseTextBox(14, 0, "1"); - - // Test partial response for question - responseText = "Feedback to team 3"; - submitPage.fillResponseRichTextEditor(4, 1, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(4, 1)); - - submitPage.verifyOtherOptionTextUnclickable(6, 0); - submitPage.chooseMcqOption(6, 0, ""); - submitPage.waitForOtherOptionTextToBeClickable(6, 0); - submitPage.fillMcqOtherOptionTextBox(6, 0, "Features"); - - submitPage.chooseMcqOption(7, 0, "Algo"); - - submitPage.verifyOtherOptionTextUnclickable(8, 0); - submitPage.toggleMsqOption(8, 0, ""); - submitPage.waitForOtherOptionTextToBeClickable(8, 0); - submitPage.fillMsqOtherOptionTextBox(8, 0, "Features"); - - submitPage.toggleMsqOption(9, 0, "UI"); - submitPage.toggleMsqOption(9, 0, "Design"); - - submitPage.fillResponseTextBox(18, 0, 0, "90"); - submitPage.fillResponseTextBox(18, 0, 1, "10"); - - // total sums up to expected value, verify empty entries are filled with 0 - submitPage.fillResponseTextBox(19, 1, 0, "200"); - assertEquals(submitPage.getResponseTextBoxValue(19, 0, 0), "0"); - - // delete an auto-filled 0, verify it's auto-filled again - submitPage.clearResponseTextBoxValue(19, 0, 0); - assertEquals(submitPage.getResponseTextBoxValue(19, 0, 0), "0"); - - // modify a non-zero value and remove a 0 - submitPage.fillResponseTextBox(19, 1, 0, "100"); - submitPage.clearResponseTextBoxValue(19, 0, 0); - - // verify no longer auto-filled with 0 - assertTrue(submitPage.isTextBoxValueEmpty(19, 0, 0)); - - // clear both input box for successful form submission. - submitPage.clearResponseTextBoxValue(19, 1, 0); - - submitPage.chooseContribOption(20, 0, "Equal share"); - - // Just check that some of the responses persisted. - FeedbackQuestionAttributes fq = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 2); - FeedbackQuestionAttributes fqPartial = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 4); - FeedbackQuestionAttributes fqMcq = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 8); - FeedbackQuestionAttributes fqMsq = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 10); - FeedbackQuestionAttributes fqNumscale = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 15); - FeedbackQuestionAttributes fqConstSum = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 19); - FeedbackQuestionAttributes fqConstSum2 = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 20); - FeedbackQuestionAttributes fqContrib = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", - "First Session", 21); - - assertNull(BackDoor.getFeedbackResponse(fq.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.benny.c@gmail.tmt")); - String aliceTeam = testData.students.get("Alice").team; - assertNull(BackDoor.getFeedbackResponse(fqPartial.getId(), - aliceTeam, - "Team 3")); - assertNull(BackDoor.getFeedbackResponse(fqMcq.getId(), - aliceTeam, - "Team 2")); - assertNull(BackDoor.getFeedbackResponse(fqMsq.getId(), - aliceTeam, - "Team 2")); - assertNull(BackDoor.getFeedbackResponse(fqNumscale.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqConstSum.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqContrib.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqContrib.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.benny.c@gmail.tmt")); - submitPage.submitWithoutConfirmationEmail(); - assertFalse(submitPage.isConfirmationEmailBoxTicked()); - - submitPage.verifyAndCloseSuccessfulSubmissionModal("3, 5, 10, 11, 12, 13, 15, 16, 17, 19, " - + "21, 22, 23, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "3, 5, 10, 11, 12, 13, 15, 16, 17, 19, " - + "21, 22, 23, 24, 25, 26, 27."); - - assertNotNull(BackDoor.getFeedbackResponse(fq.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.benny.c@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse(fqPartial.getId(), - aliceTeam, - "Team 3")); - assertNotNull(BackDoor.getFeedbackResponse(fqMcq.getId(), - aliceTeam, - "Team 2")); - assertNotNull(BackDoor.getFeedbackResponse(fqMsq.getId(), - aliceTeam, - "Team 2")); - assertNotNull(BackDoor.getFeedbackResponse(fqNumscale.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse(fqConstSum.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse(fqContrib.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqContrib.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.benny.c@gmail.tmt")); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPagePartiallyFilled.html"); - - ______TS("test toggle radio button"); - - submitPage.chooseMcqOption(7, 1, "UI"); - submitPage.chooseMcqOption(7, 1, "Algo"); - submitPage.chooseMcqOption(7, 1, "Algo"); // toggle 'Algo' radio option - - submitPage.submitWithoutConfirmationEmail(); - assertFalse(submitPage.isConfirmationEmailBoxTicked()); - - submitPage.verifyAndCloseSuccessfulSubmissionModal("3, 5, 10, 11, 12, 13, 15, 16, 17, 19, " - + "21, 22, 23, 24, 25, 26, 27."); - assertNull(BackDoor.getFeedbackResponse(fqMcq.getId(), aliceTeam, "Team 3")); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPagePartiallyFilled.html"); - - ______TS("edit existing response"); - - // Test editing an existing response - // + fill up rest of responses at the same time - String editedResponse = "Edited response to Benny."; - submitPage.fillResponseRichTextEditor(2, 0, editedResponse); - assertEquals(editedResponse.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(2, 0)); - - responseText = "Feedback to instructors"; - submitPage.fillResponseRichTextEditor(3, 0, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(3, 0)); - - responseText = "Feedback to team 2."; - submitPage.fillResponseRichTextEditor(4, 1, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(4, 1)); - - responseText = "Feedback to teammate."; - submitPage.fillResponseRichTextEditor(5, 0, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(5, 0)); - - submitPage.chooseMcqOption(6, 0, "UI"); - submitPage.chooseMcqOption(7, 0, "UI"); // Changed from "Algo" to "UI" - submitPage.chooseMcqOption(7, 1, "UI"); - - submitPage.toggleMsqOption(8, 0, "UI"); - submitPage.toggleMsqOption(8, 0, "Algo"); - submitPage.toggleMsqOption(8, 0, "Design"); - submitPage.toggleMsqOption(9, 0, "UI"); - submitPage.toggleMsqOption(9, 0, "Algo"); - submitPage.toggleMsqOption(9, 0, "Design"); - submitPage.toggleMsqOption(9, 1, "Design"); - - submitPage.chooseMcqOption(10, 0, "Drop out (Team 2)"); - submitPage.toggleMsqOption(11, 0, "Alice Betsy'\" (Team >'\"< 1'\")"); - submitPage.toggleMsqOption(11, 0, "Benny Charles (Team >'\"< 1'\")"); - submitPage.toggleMsqOption(11, 0, "Charlie Davis (Team 2)"); - submitPage.toggleMsqOption(11, 0, "Extra guy (Team 2)"); - - submitPage.chooseMcqOption(12, 0, "Team 2"); - submitPage.toggleMsqOption(13, 0, "Team >'\"< 1'\""); - submitPage.toggleMsqOption(13, 0, "Team 3"); - - submitPage.fillResponseTextBox(14, 0, "5"); - submitPage.fillResponseTextBox(15, 0, "1.5"); - submitPage.fillResponseTextBox(15, 1, "2.5"); - - submitPage.chooseMcqOption(16, 0, "Teammates Test2"); - submitPage.toggleMsqOption(17, 0, "Teammates Test"); - submitPage.toggleMsqOption(17, 0, "Teammates Test3"); - - submitPage.fillResponseTextBox(18, 0, 0, "70"); - submitPage.fillResponseTextBox(18, 0, 1, "30"); - - submitPage.fillResponseTextBox(19, 0, 0, "90"); - submitPage.fillResponseTextBox(19, 1, 0, "110"); - - submitPage.chooseContribOption(20, 1, "0%"); - - // Just check the edited responses, and two new response. - assertNull(BackDoor.getFeedbackResponse(fqPartial.getId(), - aliceTeam, - "Team 2")); - assertNull(BackDoor.getFeedbackResponse(fqConstSum2.getId(), - aliceTeam, - "Team 2")); - assertNull(BackDoor.getFeedbackResponse(fqConstSum2.getId(), - aliceTeam, - "Team 3")); - - submitPage.submitWithoutConfirmationEmail(); - assertFalse(submitPage.isConfirmationEmailBoxTicked()); - - //check new response - fqPartial = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", "First Session", 4); - assertNotNull(BackDoor.getFeedbackResponse(fqPartial.getId(), - aliceTeam, - "Team 2")); - - //check edited - submitPage.verifyAndCloseSuccessfulSubmissionModal("21, 22, 23, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 22, 23, 24, 25, 26, 27."); - assertEquals("

    " + editedResponse + "

    ", - BackDoor.getFeedbackResponse(fq.getId(), "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.benny.c@gmail.tmt").getSerializedFeedbackResponseDetail()); - - assertEquals("UI", BackDoor.getFeedbackResponse(fqMcq.getId(), - aliceTeam, - "Team 2").getResponseDetails().getAnswerString()); - - FeedbackMsqResponseDetails frMsq = - (FeedbackMsqResponseDetails) BackDoor.getFeedbackResponse(fqMsq.getId(), - aliceTeam, - "Team 2").getResponseDetails(); - assertFalse(frMsq.getAnswers().contains("UI")); - assertTrue(frMsq.getAnswers().contains("Algo")); - assertFalse(frMsq.getAnswers().contains("Design")); - - FeedbackNumericalScaleResponseDetails frNumscale = (FeedbackNumericalScaleResponseDetails) - BackDoor.getFeedbackResponse(fqNumscale.getId(), "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt").getResponseDetails(); - assertEquals("5", frNumscale.getAnswerString()); - - FeedbackConstantSumResponseDetails frConstSum = (FeedbackConstantSumResponseDetails) - BackDoor.getFeedbackResponse(fqConstSum.getId(), "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt").getResponseDetails(); - assertEquals("70, 30", frConstSum.getAnswerString()); - - FeedbackConstantSumResponseDetails frConstSum1 = (FeedbackConstantSumResponseDetails) - BackDoor.getFeedbackResponse(fqConstSum2.getId(), - aliceTeam, - "Team 2").getResponseDetails(); - assertEquals("90", frConstSum1.getAnswerString()); - - FeedbackConstantSumResponseDetails frConstSum2 = (FeedbackConstantSumResponseDetails) - BackDoor.getFeedbackResponse(fqConstSum2.getId(), - aliceTeam, - "Team 3").getResponseDetails(); - assertEquals("110", frConstSum2.getAnswerString()); - - FeedbackContributionResponseDetails frContrib = (FeedbackContributionResponseDetails) - BackDoor.getFeedbackResponse(fqContrib.getId(), "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt").getResponseDetails(); - assertEquals("100", frContrib.getAnswerString()); - - FeedbackContributionResponseDetails frContrib1 = (FeedbackContributionResponseDetails) - BackDoor.getFeedbackResponse(fqContrib.getId(), "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.benny.c@gmail.tmt").getResponseDetails(); - assertEquals("0", frContrib1.getAnswerString()); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageFullyFilled.html"); - - ______TS("MSQ: min/max selectable choices test"); - int qnNumber = 22; - - // Submit response with 1 option checked - submitPage.toggleMsqOption(qnNumber, 0, "Charlie Davis (Team 2)"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.FEEDBACK_RESPONSES_MSQ_MIN_CHECK, qnNumber, 2)); - - // Submit response with 2 options checked - submitPage.toggleMsqOption(qnNumber, 0, "Drop out (Team 2)"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 23, 24, 25, 26, 27."); - submitPage.waitForConfirmationModalAndClickOk(); - - // Submit response with 3 options checked - submitPage.toggleMsqOption(qnNumber, 0, "Emily (Team 3)"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 23, 24, 25, 26, 27."); - submitPage.waitForConfirmationModalAndClickOk(); - - // Submit response with 4 options checked - submitPage.toggleMsqOption(qnNumber, 0, "Extra guy (Team 2)"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.FEEDBACK_RESPONSES_MSQ_MAX_CHECK, qnNumber, 3)); - - // Uncheck an option so that response is valid - submitPage.toggleMsqOption(qnNumber, 0, "Extra guy (Team 2)"); - - qnNumber = 23; - // Submit response for 1st recipient with 2 options checked - submitPage.toggleMsqOption(qnNumber, 0, "B"); - submitPage.toggleMsqOption(qnNumber, 0, "C"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.FEEDBACK_RESPONSES_MSQ_MIN_CHECK, qnNumber, 3)); - - // Submit response for 1st recipient with 3 options checked - submitPage.toggleMsqOption(qnNumber, 0, "E"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 24, 25, 26, 27."); - submitPage.waitForConfirmationModalAndClickOk(); - - // Submit response for 1st recipient with 4 options checked - submitPage.toggleMsqOption(qnNumber, 0, "A"); - submitPage.clickSubmitButton(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - String.format(Const.StatusMessages.FEEDBACK_RESPONSES_MSQ_MAX_CHECK, qnNumber, 3)); - - ______TS("create new response for unreg student"); - submitPage.logout(); - submitPage = loginToStudentFeedbackSubmitPage(testData.students.get("DropOut"), "Open Session"); - - responseText = "Test Self Feedback"; - submitPage.fillResponseRichTextEditor(1, 0, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(1, 0)); - - responseText = "Response to Benny."; - submitPage.selectRecipient(2, 0, "Benny Charles"); - submitPage.fillResponseRichTextEditor(2, 0, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(2, 0)); - - responseText = "Response to student who is number 1."; - submitPage.selectRecipient(2, 1, "Alice Betsy'\""); - submitPage.fillResponseRichTextEditor(2, 1, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(2, 1)); - - responseText = "Response to extra guy."; - submitPage.selectRecipient(2, 2, "Extra guy"); - submitPage.fillResponseRichTextEditor(2, 2, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(2, 2)); - - submitPage.fillResponseTextBox(14, 0, "1"); - - // Test partial response for question - responseText = "Feedback to team 3"; - submitPage.fillResponseRichTextEditor(4, 0, responseText); - assertEquals(responseText.trim().split(" +").length, submitPage.getResponseTextBoxLengthLabelValue(4, 0)); - - submitPage.chooseMcqOption(7, 1, "Algo"); - submitPage.toggleMsqOption(9, 1, "UI"); - submitPage.toggleMsqOption(9, 1, "Design"); - - submitPage.fillResponseTextBox(18, 0, 0, "90"); - submitPage.fillResponseTextBox(18, 0, 1, "10"); - - submitPage.chooseContribOption(20, 0, "Equal share"); - - assertNull(BackDoor.getFeedbackResponse(fq.getId(), "drop.out@gmail.tmt", "SFSubmitUiT.benny.c@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqPartial.getId(), "Team 2", "Team 3")); - assertNull(BackDoor.getFeedbackResponse(fqMcq.getId(), "Team 2", testData.students.get("Alice").team)); - assertNull(BackDoor.getFeedbackResponse(fqMsq.getId(), "Team 2", testData.students.get("Alice").team)); - assertNull(BackDoor.getFeedbackResponse(fqNumscale.getId(), "drop.out@gmail.tmt", "drop.out@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqConstSum.getId(), "drop.out@gmail.tmt", "drop.out@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqContrib.getId(), "drop.out@gmail.tmt", "SFSubmitUiT.charlie.d@gmail.tmt")); - - submitPage.submitWithoutConfirmationEmail(); - assertFalse(submitPage.isConfirmationEmailBoxTicked()); - - submitPage.verifyAndCloseSuccessfulSubmissionModal("3, 5, 6, 8, 10, 11, 12, 13, " - + "15, 16, 17, 19, 21, 22, 23, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "3, 5, 6, 8, 10, 11, 12, 13, " - + "15, 16, 17, 19, 21, 22, 23, 24, 25, 26, 27."); - submitPage.verifyHtmlMainContent("/unregisteredStudentFeedbackSubmitPagePartiallyFilled.html"); - - assertNotNull(BackDoor.getFeedbackResponse(fq.getId(), "drop.out@gmail.tmt", "SFSubmitUiT.benny.c@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse(fqPartial.getId(), "Team 2", "Team 3")); - assertNotNull(BackDoor.getFeedbackResponse(fqMcq.getId(), "Team 2", testData.students.get("Alice").team)); - assertNotNull(BackDoor.getFeedbackResponse(fqMsq.getId(), "Team 2", testData.students.get("Alice").team)); - assertNotNull(BackDoor.getFeedbackResponse(fqNumscale.getId(), "drop.out@gmail.tmt", "drop.out@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse(fqConstSum.getId(), "drop.out@gmail.tmt", "drop.out@gmail.tmt")); - assertNotNull(BackDoor.getFeedbackResponse(fqContrib.getId(), "drop.out@gmail.tmt", - "SFSubmitUiT.charlie.d@gmail.tmt")); - } - - private void testAddCommentsToQuestionsWithoutResponses() { - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.waitForPageToLoad(); - - submitPage.addFeedbackParticipantComment("-6-0", "Comment without response"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal( - "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "1, 2, 3, 4, 5, 6, 7, 8, 9, " - + "10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27."); - submitPage.verifyCommentRowMissing("-6-0"); - } - - private void testAddCommentsToQuestionsWithResponses() { - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.waitForPageToLoad(); - - submitPage.chooseMcqOption(6, 0, "UI"); - submitPage.chooseMcqOption(7, 1, "UI"); - submitPage.addFeedbackParticipantComment("-6-0", "New MCQ Comment 1"); - submitPage.addFeedbackParticipantComment("-7-1", "New MCQ team Comment 2"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("1, 2, 3, 4, 5, 8, 9, " - + "10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "1, 2, 3, 4, 5, 8, 9, " - + "10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27."); - submitPage.verifyCommentRowContent("-6-0", "New MCQ Comment 1"); - submitPage.verifyCommentRowContent("-7-0", "New MCQ team Comment 2"); - } - - private void testEditCommentsActionAfterAddingComments() { - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.waitForPageToLoad(); - - submitPage.editFeedbackParticipantComment("-6-0", "Edited MCQ Comment 1"); - submitPage.editFeedbackParticipantComment("-7-0", "Edited MCQ team Comment 2"); - - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("1, 2, 3, 4, 5, 8, 9, " - + "10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "1, 2, 3, 4, 5, 8, 9, " - + "10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27."); - submitPage.verifyCommentRowContent("-6-0", "Edited MCQ Comment 1"); - submitPage.verifyCommentRowContent("-7-0", "Edited MCQ team Comment 2"); - } - - private void testDeleteCommentsActionAfterEditingComments() { - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.waitForPageToLoad(); - - submitPage.deleteFeedbackResponseComment("-6-0"); - submitPage.verifyCommentRowMissing("-6-0"); - submitPage.deleteFeedbackResponseComment("-7-0"); - submitPage.verifyCommentRowMissing("-7-0"); - } - - private void testInputValidation() { - ______TS("Test InputValidation lower than Min value"); - - // this should not give any error since the value will be automatically adjusted before the form is submitted - // adjusted value should be 1 - logout(); - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.fillResponseTextBox(14, 0, ""); - submitPage.fillResponseTextBox(14, 0, "0"); - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("21, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 24, 25, 26, 27."); - - FeedbackQuestionAttributes fqNumscale = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", "First Session", 15); - - FeedbackResponseAttributes frNumscale = BackDoor.getFeedbackResponse(fqNumscale.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt"); - - assertEquals("1", frNumscale.getResponseDetails().getAnswerString()); - - ______TS("Test InputValidation Over Max value"); - - // this should not give any error since the value will be automatically adjusted before the form is submitted - // adjusted value should be 5 - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.fillResponseTextBox(14, 0, "50000"); - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("21, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 24, 25, 26, 27."); - - fqNumscale = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", "First Session", 15); - - frNumscale = BackDoor.getFeedbackResponse(fqNumscale.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt"); - - assertEquals("5", frNumscale.getResponseDetails().getAnswerString()); - - ______TS("Test InputValidation extreme negative value"); - - /* Attention: in safari or chrome, negative sign "-" can be input so the result will be adjusted to 1 - * However, in firefox, the sign "-" can not be typed into the text box so no negative - * value can be input - */ - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.fillResponseTextBox(14, 0, "-99999"); - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("21, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 24, 25, 26, 27."); - - fqNumscale = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", "First Session", 15); - - frNumscale = BackDoor.getFeedbackResponse(fqNumscale.getId(), - "SFSubmitUiT.alice.b@gmail.tmt", - "SFSubmitUiT.alice.b@gmail.tmt"); - - if ("firefox".equals(TestProperties.BROWSER)) { - assertEquals("5", frNumscale.getResponseDetails().getAnswerString()); - } else { - assertEquals("1", frNumscale.getResponseDetails().getAnswerString()); - - // We need the final response value for this particular question to be "5" - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.fillResponseTextBox(14, 0, "5"); - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 24, 25, 26, 27."); - } - - ______TS("write response without specifying recipient"); - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - - submitPage.selectRecipient(2, 2, ""); - submitPage.fillResponseRichTextEditor(2, 2, "Response to no recipient"); - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals( - "You did not specify a recipient for your response in question 2."); - - ______TS("cannot choose self when generating choices from students (excluding self)"); - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - assertFalse(submitPage.checkIfMcqOrMsqChoiceExists(24, 0, - "Alice Betsy'\" (Team >'\"< 1'\")")); - assertTrue(submitPage.checkIfMcqOrMsqChoiceExists(24, 0, - "Charlie Davis (Team 2)")); - - assertFalse(submitPage.checkIfMcqOrMsqChoiceExists(25, 0, - "Alice Betsy'\" (Team >'\"< 1'\")")); - assertTrue(submitPage.checkIfMcqOrMsqChoiceExists(25, 0, - "Charlie Davis (Team 2)")); - assertTrue(submitPage.checkIfMcqOrMsqChoiceExists(25, 0, - "Extra guy (Team 2)")); - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 24, 25, 26, 27."); - - ______TS("cannot choose self when generating choices from teams (excluding self)"); - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - assertFalse(submitPage.checkIfMcqOrMsqChoiceExists(26, 0, "Team 1")); - assertTrue(submitPage.checkIfMcqOrMsqChoiceExists(26, 0, "Team 2")); - - assertFalse(submitPage.checkIfMcqOrMsqChoiceExists(27, 0, "Team 1")); - assertTrue(submitPage.checkIfMcqOrMsqChoiceExists(27, 0, "Team 2")); - submitPage.submitWithoutConfirmationEmail(); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "21, 24, 25, 26, 27."); - - } - - private void testResponsiveSubmission() { - ______TS("mobile test"); - submitPage = loginToStudentFeedbackSubmitPage(testData.students.get("DropOut"), "Open Session"); - - // Select the first option for the first question for each student - submitPage.clickRubricRadio(21, 0, 0, 0); - submitPage.clickRubricRadio(21, 1, 0, 0); - submitPage.clickRubricRadio(21, 2, 0, 0); - submitPage.clickRubricRadio(21, 3, 0, 0); - - // Switch to mobile view - submitPage.changeToMobileView(); - // Test if changes on desktop view persisted to mobile view - assertTrue(submitPage.isRubricRadioMobileChecked(21, 0, 0, 0)); - assertTrue(submitPage.isRubricRadioMobileChecked(21, 1, 0, 0)); - assertTrue(submitPage.isRubricRadioMobileChecked(21, 2, 0, 0)); - assertTrue(submitPage.isRubricRadioMobileChecked(21, 3, 0, 0)); - - // Clear option for the first question for each student - submitPage.reloadPage(); - submitPage.changeToMobileView(); - - // Select the second option for the second question for each student - submitPage.clickRubricRadioMobile(21, 0, 1, 1); - submitPage.clickRubricRadioMobile(21, 1, 1, 1); - submitPage.clickRubricRadioMobile(21, 2, 1, 1); - submitPage.clickRubricRadioMobile(21, 3, 1, 1); - - // Switch to desktop view - submitPage.changeToDesktopView(); - // Test if changes on mobile view persisted to desktop view - assertFalse(submitPage.isRubricRadioMobileChecked(21, 0, 0, 0)); - assertFalse(submitPage.isRubricRadioMobileChecked(21, 1, 0, 0)); - assertFalse(submitPage.isRubricRadioMobileChecked(21, 2, 0, 0)); - assertFalse(submitPage.isRubricRadioMobileChecked(21, 3, 0, 0)); - assertTrue(submitPage.isRubricRadioMobileChecked(21, 0, 1, 1)); - assertTrue(submitPage.isRubricRadioMobileChecked(21, 1, 1, 1)); - assertTrue(submitPage.isRubricRadioMobileChecked(21, 2, 1, 1)); - assertTrue(submitPage.isRubricRadioMobileChecked(21, 3, 1, 1)); - - FeedbackQuestionAttributes fqRubric = BackDoor.getFeedbackQuestion("SFSubmitUiT.CS2104", "First Session", 22); - assertNull(BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "SFSubmitUiT.danny.e@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "extra.guy@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "drop.out@gmail.tmt")); - assertNull(BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "SFSubmitUiT.charlie.d@gmail.tmt")); - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("3, 5, 6, 8, 10, 11, 12, 13, 15, 16, " - + "17, 19, 22, 23, 24, 25, 26, 27."); - assertEquals("[-1, 1]", BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "SFSubmitUiT.danny.e@gmail.tmt").getResponseDetails().getAnswerString()); - assertEquals("[-1, 1]", BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "extra.guy@gmail.tmt").getResponseDetails().getAnswerString()); - assertEquals("[-1, 1]", BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "drop.out@gmail.tmt").getResponseDetails().getAnswerString()); - assertEquals("[-1, 1]", BackDoor.getFeedbackResponse(fqRubric.getId(), - "drop.out@gmail.tmt", - "SFSubmitUiT.charlie.d@gmail.tmt").getResponseDetails().getAnswerString()); - } - - private void testModifyData() throws Exception { - ______TS("modify data"); - - // Next, we edit some student data to cover editing of students - // after creating the responses. - - // move one student out of Team 2 into a new team - // This should cause the page to render an extra response box for - // the team question. - StudentAttributes extraGuy = testData.students.get("ExtraGuy"); - moveToTeam(extraGuy, "New Team"); - - // delete one student - // This should remove (hide on page render; not deleted) the response made to him, - // and change the number of options in the recipient dropdown list. - StudentAttributes dropOutGuy = testData.students.get("DropOut"); - String backDoorOperationStatus = BackDoor.deleteStudent(dropOutGuy.course, - dropOutGuy.email); - assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, backDoorOperationStatus); - - // move Benny out of Team >'"< 1 into team 2 and change her email - // This should cause the team mates question to disappear completely as - // no one else is in Team >'"< 1, but other responses to Benny should remain. - StudentAttributes benny = testData.students.get("Benny"); - moveToTeam(benny, "Team 2"); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - submitPage.verifyHtmlMainContent("/studentFeedbackSubmitPageModified.html"); - - // verify submission with no-response questions are possible - submitPage.fillResponseTextBox(19, 2, "100"); - submitPage.submitWithoutConfirmationEmail(); - submitPage.verifyAndCloseSuccessfulSubmissionModal("10, 21, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "10, 21, 24, 25, 26, 27."); - - ______TS("Responses with invalid recipients do not prevent submission"); - StudentAttributes alice = testData.students.get("Alice"); - - FeedbackQuestionAttributes questionFromDataBundle = testData.feedbackQuestions.get("qn4InSession1"); - FeedbackQuestionAttributes question = BackDoor.getFeedbackQuestion( - questionFromDataBundle.courseId, questionFromDataBundle.feedbackSessionName, - questionFromDataBundle.questionNumber); - - FeedbackResponseAttributes existingResponse = - BackDoor.getFeedbackResponse(question.getId(), alice.team, "Team 2"); - FeedbackResponseAttributes response = new FeedbackResponseAttributes(existingResponse); - response.recipient = "invalidRecipient"; - - String backDoorStatusForCreatingResponse = BackDoor.createFeedbackResponse(response); - assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, backDoorStatusForCreatingResponse); - - submitPage = loginToStudentFeedbackSubmitPage("Alice", "Open Session"); - - submitPage.submitWithoutConfirmationEmail(); - // verify that existing responses with invalid recipients do not affect submission - submitPage.verifyAndCloseSuccessfulSubmissionModal("10, 21, 24, 25, 26, 27."); - submitPage.waitForTextsForAllStatusMessagesToUserEquals(Const.StatusMessages.FEEDBACK_RESPONSES_SAVED, - Const.StatusMessages.FEEDBACK_UNANSWERED_QUESTIONS + "10, 21, 24, 25, 26, 27."); - - } - - private FeedbackSubmitPage loginToStudentFeedbackSubmitPage(StudentAttributes s, String fsDataId) { - AppUrl submitUrl = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) - .withCourseId(s.course) - .withStudentEmail(s.email) - .withSessionName(testData.feedbackSessions.get(fsDataId) - .getFeedbackSessionName()) - .withRegistrationKey(BackDoor.getEncryptedKeyForStudent(s.course, s.email)); - - return AppPage.getNewPageInstance(browser, submitUrl, FeedbackSubmitPage.class); - } - - private FeedbackSubmitPage loginToStudentFeedbackSubmitPage(String studentName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - - return loginAdminToPageOld(editUrl, FeedbackSubmitPage.class); - } - - private FeedbackSessionNotVisiblePage - loginToStudentFeedbackSubmitPageFeedbackSessionNotVisible(String studentName, String fsName) { - AppUrl editUrl = createUrl(Const.WebPageURIs.SESSION_SUBMISSION_PAGE) - .withUserId(testData.students.get(studentName).googleId) - .withCourseId(testData.feedbackSessions.get(fsName).getCourseId()) - .withSessionName(testData.feedbackSessions.get(fsName).getFeedbackSessionName()); - - return loginAdminToPageOld(editUrl, FeedbackSessionNotVisiblePage.class); - } - - private void moveToTeam(StudentAttributes student, String newTeam) { - String backDoorOperationStatus; - student.team = newTeam; - backDoorOperationStatus = BackDoor.editStudent(student.email, student); - assertEquals(Const.StatusCodes.BACKDOOR_STATUS_SUCCESS, backDoorOperationStatus); - } - -} diff --git a/src/test/java/teammates/test/cases/browsertests/package-info.java b/src/test/java/teammates/test/cases/browsertests/package-info.java deleted file mode 100644 index b99169c5ddd..00000000000 --- a/src/test/java/teammates/test/cases/browsertests/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Black-box system test cases for testing the application as a whole via the Web browser. - */ -package teammates.test.cases.browsertests; diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackMsqResponseDetailsTest.java b/src/test/java/teammates/test/cases/datatransfer/FeedbackMsqResponseDetailsTest.java deleted file mode 100644 index 0d482825de1..00000000000 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackMsqResponseDetailsTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package teammates.test.cases.datatransfer; - -import java.util.Arrays; -import java.util.List; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.questions.FeedbackMsqQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackMsqResponseDetails; -import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; - -/** - * SUT: {@link FeedbackMsqResponseDetails}. - */ -public class FeedbackMsqResponseDetailsTest extends BaseTestCase { - - @Test - public void testValidateResponseDetails_otherAnswerNotChosenButOtherFieldIsNotEmpty_shouldTriggerError() { - FeedbackMsqQuestionDetails msqQuestionDetails = new FeedbackMsqQuestionDetails(); - msqQuestionDetails.setMsqChoices(Arrays.asList("choiceA", "choiceB")); - msqQuestionDetails.setOtherEnabled(true); - msqQuestionDetails.setHasAssignedWeights(false); - - FeedbackQuestionAttributes feedbackQuestionAttributes = FeedbackQuestionAttributes.builder() - .withQuestionDetails(msqQuestionDetails) - .build(); - - FeedbackMsqResponseDetails feedbackMsqResponseDetails = new FeedbackMsqResponseDetails(); - feedbackMsqResponseDetails.setOther(false); - feedbackMsqResponseDetails.setOtherFieldContent("NonEmpty"); - feedbackMsqResponseDetails.setAnswers(Arrays.asList("choiceA")); - - List errors = feedbackMsqResponseDetails.validateResponseDetails(feedbackQuestionAttributes); - assertEquals(1, errors.size()); - assertEquals(Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION, errors.get(0)); - - // now set other field to empty - feedbackMsqResponseDetails.setOtherFieldContent(""); - errors = feedbackMsqResponseDetails.validateResponseDetails(feedbackQuestionAttributes); - assertEquals(0, errors.size()); - } - - @Test - public void testValidateResponseDetails_choiceNotInValidChoices_shouldTriggerError() { - FeedbackMsqQuestionDetails msqQuestionDetails = new FeedbackMsqQuestionDetails(); - msqQuestionDetails.setMsqChoices(Arrays.asList("choiceA", "choiceB")); - msqQuestionDetails.setOtherEnabled(true); - msqQuestionDetails.setHasAssignedWeights(false); - FeedbackQuestionAttributes feedbackQuestionAttributes = FeedbackQuestionAttributes.builder() - .withQuestionDetails(msqQuestionDetails) - .build(); - - // typical case: answers not in valid choices - FeedbackMsqResponseDetails feedbackMsqResponseDetails = new FeedbackMsqResponseDetails(); - feedbackMsqResponseDetails.setOther(false); - feedbackMsqResponseDetails.setOtherFieldContent(""); - feedbackMsqResponseDetails.setAnswers(Arrays.asList("choiceC")); - List errors = feedbackMsqResponseDetails.validateResponseDetails(feedbackQuestionAttributes); - assertEquals(1, errors.size()); - assertEquals(feedbackMsqResponseDetails.getAnswerString() - + " " + Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION, errors.get(0)); - - // now set choice to be within the valid choices - feedbackMsqResponseDetails.setAnswers(Arrays.asList("choiceA")); - errors = feedbackMsqResponseDetails.validateResponseDetails(feedbackQuestionAttributes); - assertEquals(0, errors.size()); - - // when other field is enabled, the other field content will become a valid choice - feedbackMsqResponseDetails.setOther(true); - feedbackMsqResponseDetails.setOtherFieldContent("Other"); - feedbackMsqResponseDetails.setAnswers(Arrays.asList("Other1")); - errors = feedbackMsqResponseDetails.validateResponseDetails(feedbackQuestionAttributes); - assertEquals(2, errors.size()); - assertEquals(feedbackMsqResponseDetails.getAnswerString() - + " " + Const.FeedbackQuestion.MSQ_ERROR_INVALID_OPTION, errors.get(0)); - assertEquals(Const.FeedbackQuestion.MSQ_ERROR_OTHER_CONTENT_NOT_PROVIDED, errors.get(1)); - - // make answer list and other field content consistent - feedbackMsqResponseDetails.setOther(true); - feedbackMsqResponseDetails.setOtherFieldContent("Other"); - feedbackMsqResponseDetails.setAnswers(Arrays.asList("Other")); - errors = feedbackMsqResponseDetails.validateResponseDetails(feedbackQuestionAttributes); - assertEquals(0, errors.size()); - } -} diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackRubricQuestionDetailsTest.java b/src/test/java/teammates/test/cases/datatransfer/FeedbackRubricQuestionDetailsTest.java deleted file mode 100644 index 3ac58347c99..00000000000 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackRubricQuestionDetailsTest.java +++ /dev/null @@ -1,71 +0,0 @@ -package teammates.test.cases.datatransfer; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.questions.FeedbackQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionType; -import teammates.common.datatransfer.questions.FeedbackRubricQuestionDetails; -import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; - -/** - * SUT: {@link FeedbackRubricQuestionDetails}. - */ -public class FeedbackRubricQuestionDetailsTest extends BaseTestCase { - - @Test - public void testConstructor_defaultConstructor_fieldsShouldHaveCorrectDefaultValues() { - FeedbackRubricQuestionDetails rubricDetails = new FeedbackRubricQuestionDetails(); - - assertEquals(FeedbackQuestionType.RUBRIC, rubricDetails.getQuestionType()); - assertFalse(rubricDetails.hasAssignedWeights()); - assertTrue(rubricDetails.getRubricWeights().isEmpty()); - } - - @Test - public void testValidateQuestionDetails_invalidWeightListSize_errorReturned() { - FeedbackRubricQuestionDetails rubricDetails = new FeedbackRubricQuestionDetails(); - rubricDetails.setNumOfRubricChoices(2); - rubricDetails.setNumOfRubricSubQuestions(2); - rubricDetails.setRubricDescriptions(Arrays.asList(Arrays.asList("", ""), Arrays.asList("", ""))); - rubricDetails.setHasAssignedWeights(true); - rubricDetails.setRubricSubQuestions(Arrays.asList("SubQn-1", "SubQn-2")); - rubricDetails.setRubricChoices(Arrays.asList("Choice-1", "Choice-2")); - rubricDetails.setRubricWeightsForEachCell(Arrays.asList(Arrays.asList(1.5, 2.5), Collections.singletonList(1.0))); - - List errors = rubricDetails.validateQuestionDetails(); - assertEquals(1, errors.size()); - assertEquals(Const.FeedbackQuestion.RUBRIC_ERROR_INVALID_WEIGHT, errors.get(0)); - } - - @Test - public void testValidateQuestionDetails_validWeightListSize_errorListShouldBeEmpty() { - FeedbackRubricQuestionDetails rubricDetails = new FeedbackRubricQuestionDetails(); - rubricDetails.setNumOfRubricChoices(2); - rubricDetails.setNumOfRubricSubQuestions(2); - rubricDetails.setRubricDescriptions(Arrays.asList(Arrays.asList("", ""), Arrays.asList("", ""))); - rubricDetails.setHasAssignedWeights(true); - rubricDetails.setRubricSubQuestions(Arrays.asList("SubQn-1", "SubQn-2")); - rubricDetails.setRubricChoices(Arrays.asList("Choice-1", "Choice-2")); - rubricDetails.setRubricWeightsForEachCell(Arrays.asList(Arrays.asList(1.5, 2.5), Arrays.asList(1.0, 2.0))); - - List errors = rubricDetails.validateQuestionDetails(); - assertEquals(0, errors.size()); - } - - @Test - public void testIsInstructorCommentsOnResponsesAllowed_shouldReturnTrue() { - FeedbackQuestionDetails feedbackQuestionDetails = new FeedbackRubricQuestionDetails(); - assertTrue(feedbackQuestionDetails.isInstructorCommentsOnResponsesAllowed()); - } - - @Test - public void testIsFeedbackParticipantCommentsOnResponsesAllowed_shouldReturnFalse() { - FeedbackQuestionDetails feedbackQuestionDetails = new FeedbackRubricQuestionDetails(); - assertFalse(feedbackQuestionDetails.isFeedbackParticipantCommentsOnResponsesAllowed()); - } -} diff --git a/src/test/java/teammates/test/cases/datatransfer/FeedbackRubricResponseDetailsTest.java b/src/test/java/teammates/test/cases/datatransfer/FeedbackRubricResponseDetailsTest.java deleted file mode 100644 index f7a6be9671e..00000000000 --- a/src/test/java/teammates/test/cases/datatransfer/FeedbackRubricResponseDetailsTest.java +++ /dev/null @@ -1,86 +0,0 @@ -package teammates.test.cases.datatransfer; - -import java.util.ArrayList; -import java.util.Arrays; - -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.questions.FeedbackRubricQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackRubricResponseDetails; -import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; - -/** - * SUT: {@link FeedbackRubricResponseDetails}. - */ -public class FeedbackRubricResponseDetailsTest extends BaseTestCase { - - private FeedbackQuestionAttributes sampleQuestion; - - @BeforeMethod - public void beforeMethod() { - FeedbackRubricQuestionDetails rubricQuestionDetails = new FeedbackRubricQuestionDetails(); - rubricQuestionDetails.setHasAssignedWeights(false); - rubricQuestionDetails.setRubricWeightsForEachCell(new ArrayList<>()); - rubricQuestionDetails.setNumOfRubricChoices(2); - rubricQuestionDetails.setNumOfRubricSubQuestions(2); - rubricQuestionDetails.setRubricChoices(Arrays.asList("a", "b")); - rubricQuestionDetails.setRubricSubQuestions(Arrays.asList("q1", "q2")); - rubricQuestionDetails.setRubricDescriptions(Arrays.asList(Arrays.asList("d1", "d2"), Arrays.asList("d3", "d4"))); - - sampleQuestion = FeedbackQuestionAttributes.builder() - .withCourseId("testCourse") - .withFeedbackSessionName("testSession") - .withQuestionDescription("testDescription") - .withQuestionDetails(rubricQuestionDetails) - .withQuestionNumber(1) - .withGiverType(FeedbackParticipantType.STUDENTS) - .withRecipientType(FeedbackParticipantType.STUDENTS) - .withNumberOfEntitiesToGiveFeedbackTo(5) - .withShowGiverNameTo(new ArrayList<>()) - .withShowResponsesTo(new ArrayList<>()) - .withShowRecipientNameTo(new ArrayList<>()) - .build(); - } - - @Test - public void testValidateResponseDetails_validAnswer_shouldReturnEmptyErrorList() { - FeedbackRubricResponseDetails responseDetails = new FeedbackRubricResponseDetails(); - - responseDetails.setAnswer(Arrays.asList(1, Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN)); - assertTrue(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - - responseDetails.setAnswer(Arrays.asList(Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN, 0)); - assertTrue(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - - responseDetails.setAnswer(Arrays.asList(0, 0)); - assertTrue(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - } - - @Test - public void testValidateResponseDetails_invalidAnswer_shouldReturnNonEmptyErrorList() { - FeedbackRubricResponseDetails responseDetails = new FeedbackRubricResponseDetails(); - - responseDetails.setAnswer(Arrays.asList()); - assertFalse(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - - responseDetails.setAnswer(Arrays.asList(0)); - assertFalse(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - - responseDetails.setAnswer(Arrays.asList( - Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN, Const.FeedbackQuestion.RUBRIC_ANSWER_NOT_CHOSEN)); - assertFalse(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - - responseDetails.setAnswer(Arrays.asList(0, -2)); - assertFalse(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - - responseDetails.setAnswer(Arrays.asList(2, 1)); - assertFalse(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - - responseDetails.setAnswer(Arrays.asList(0, 1, 0)); - assertFalse(responseDetails.validateResponseDetails(sampleQuestion).isEmpty()); - } -} diff --git a/src/test/java/teammates/test/cases/datatransfer/package-info.java b/src/test/java/teammates/test/cases/datatransfer/package-info.java deleted file mode 100644 index acf52021dba..00000000000 --- a/src/test/java/teammates/test/cases/datatransfer/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Component test cases for testing the datatransfer objects from the Common component. - */ -package teammates.test.cases.datatransfer; diff --git a/src/test/java/teammates/test/cases/logic/package-info.java b/src/test/java/teammates/test/cases/logic/package-info.java deleted file mode 100644 index c390f7047ad..00000000000 --- a/src/test/java/teammates/test/cases/logic/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Component test cases for testing the Logic component. - */ -package teammates.test.cases.logic; diff --git a/src/test/java/teammates/test/cases/package-info.java b/src/test/java/teammates/test/cases/package-info.java deleted file mode 100644 index c1691b67c7d..00000000000 --- a/src/test/java/teammates/test/cases/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains component test cases. - */ -package teammates.test.cases; diff --git a/src/test/java/teammates/test/cases/search/package-info.java b/src/test/java/teammates/test/cases/search/package-info.java deleted file mode 100644 index 5de9c242eea..00000000000 --- a/src/test/java/teammates/test/cases/search/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Component test cases for testing the search functions. - */ -package teammates.test.cases.search; diff --git a/src/test/java/teammates/test/cases/storage/package-info.java b/src/test/java/teammates/test/cases/storage/package-info.java deleted file mode 100644 index d0f32f0e0e7..00000000000 --- a/src/test/java/teammates/test/cases/storage/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Component test cases for testing the Storage component. - */ -package teammates.test.cases.storage; diff --git a/src/test/java/teammates/test/cases/testdriver/AssertHelperTest.java b/src/test/java/teammates/test/cases/testdriver/AssertHelperTest.java deleted file mode 100644 index 559ea338323..00000000000 --- a/src/test/java/teammates/test/cases/testdriver/AssertHelperTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package teammates.test.cases.testdriver; - -import org.testng.annotations.Test; - -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.AssertHelper; - -/** - * SUT: {@link AssertHelper}. - */ -public class AssertHelperTest extends BaseTestCase { - - @Test - public void testAssertContains() { - - AssertHelper.assertContains("404 Page Not Found", - "Error: 404 Page Not Found. Check the URL."); - AssertHelper.assertContains("Fails on checking assert contains", - "404 Page Not Found", - "Error: 404 Page Not Found. Check the URL."); - } - - @Test - public void testAssertContainsRegex() { - - AssertHelper.assertContainsRegex("404 Page Not Found", - "Error: 404 Page Not Found. Check the URL."); - AssertHelper.assertContainsRegex("Fails on checking assert contains regex", - "404 Page Not Found", - "Error: 404 Page Not Found. Check the URL."); - - AssertHelper.assertContainsRegex( - "
    {*}

    !@#$%^&*(){}_+[]

    ", - "
    Testing

    !@#$%^&*(){}_+[]

    HOME"); - AssertHelper.assertContainsRegex("Fails on checking assert contains regex", - "
    {*}
    ", - "
    Testing
    HOME"); - - AssertHelper.assertContainsRegex( - "\n\t\n\t\tHello world!\n\t\n\t", - "
    Hello world!
    "); - AssertHelper.assertContainsRegex("Fails on checking assert contains regex", - "\n\t\n\t\tHello world!\n\t\n\t", - "
    Hello world!
    "); - } - -} diff --git a/src/test/java/teammates/test/cases/testdriver/package-info.java b/src/test/java/teammates/test/cases/testdriver/package-info.java deleted file mode 100644 index a903d5e639f..00000000000 --- a/src/test/java/teammates/test/cases/testdriver/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Component test cases for testing the test driver infrastructure and helpers. - */ -package teammates.test.cases.testdriver; diff --git a/src/test/java/teammates/test/cases/util/BuildPropertiesTest.java b/src/test/java/teammates/test/cases/util/BuildPropertiesTest.java deleted file mode 100644 index d078b77aca0..00000000000 --- a/src/test/java/teammates/test/cases/util/BuildPropertiesTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package teammates.test.cases.util; - -import org.testng.annotations.Test; - -import teammates.common.util.Config; -import teammates.test.cases.BaseTestCase; - -/** - * SUT: {@link Config}. - */ -public class BuildPropertiesTest extends BaseTestCase { - - @Test - public void checkPresence() { - assertNotNull(Config.APP_URL); - } - -} diff --git a/src/test/java/teammates/test/cases/util/JsonUtilsTest.java b/src/test/java/teammates/test/cases/util/JsonUtilsTest.java deleted file mode 100644 index 88454dee981..00000000000 --- a/src/test/java/teammates/test/cases/util/JsonUtilsTest.java +++ /dev/null @@ -1,105 +0,0 @@ -package teammates.test.cases.util; - -import java.util.ArrayList; - -import org.testng.annotations.Test; - -import com.google.gson.JsonParseException; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; -import teammates.common.util.Const; -import teammates.common.util.JsonUtils; -import teammates.test.cases.BaseTestCase; - -/** - * SUT: {@link JsonUtils}. - */ -public class JsonUtilsTest extends BaseTestCase { - - @Test - public void testFeedbackQuestionDetailsAdaptor_withComposedQuestionDetails_shouldSerializeToConcreteClass() { - FeedbackTextQuestionDetails questionDetails = new FeedbackTextQuestionDetails("Question text."); - - ArrayList participants = new ArrayList<>(); - participants.add(FeedbackParticipantType.OWN_TEAM_MEMBERS); - participants.add(FeedbackParticipantType.RECEIVER); - - FeedbackQuestionAttributes fqa = FeedbackQuestionAttributes.builder() - .withCourseId("testingCourse") - .withFeedbackSessionName("testFeedbackSession") - .withGiverType(FeedbackParticipantType.INSTRUCTORS) - .withRecipientType(FeedbackParticipantType.SELF) - .withNumberOfEntitiesToGiveFeedbackTo(Const.MAX_POSSIBLE_RECIPIENTS) - .withQuestionNumber(1) - .withQuestionDetails(questionDetails) - .withShowGiverNameTo(participants) - .withShowRecipientNameTo(participants) - .withShowResponsesTo(participants) - .build(); - - try { - String serializeString = JsonUtils.toJson(fqa); - assertEquals("{\n" - + " \"feedbackSessionName\": \"testFeedbackSession\",\n" - + " \"courseId\": \"testingCourse\",\n" - + " \"questionDetails\": {\n" - + " \"recommendedLength\": 0,\n" - + " \"questionType\": \"TEXT\",\n" - + " \"questionText\": \"Question text.\"\n" - + " },\n" - + " \"questionNumber\": 1,\n" - + " \"giverType\": \"INSTRUCTORS\",\n" - + " \"recipientType\": \"SELF\",\n" - + " \"numberOfEntitiesToGiveFeedbackTo\": -100,\n" - + " \"showResponsesTo\": [\n" - + " \"RECEIVER\"\n" - + " ],\n" - + " \"showGiverNameTo\": [\n" - + " \"RECEIVER\"\n" - + " ],\n" - + " \"showRecipientNameTo\": [\n" - + " \"RECEIVER\"\n" - + " ]\n" - + "}", serializeString); - } catch (JsonParseException e) { - fail("error detected during serializing"); - } - } - - @Test - public void testFeedbackResponseDetailsAdaptor_withComposedResponseDetails_shouldSerializeToConcreteClass() { - FeedbackResponseAttributes fra = - FeedbackResponseAttributes.builder( - "questionId", "giver@email.com", "recipient@email.com") - .withFeedbackSessionName("Session1") - .withCourseId("CS3281") - .withGiverSection("giverSection") - .withRecipientSection("recipientSection") - .withResponseDetails(new FeedbackTextResponseDetails("My answer")) - .build(); - - try { - String serializeString = JsonUtils.toJson(fra); - assertEquals("{\n" - + " \"feedbackQuestionId\": \"questionId\",\n" - + " \"giver\": \"giver@email.com\",\n" - + " \"recipient\": \"recipient@email.com\",\n" - + " \"feedbackSessionName\": \"Session1\",\n" - + " \"courseId\": \"CS3281\",\n" - + " \"responseDetails\": {\n" - + " \"answer\": \"My answer\",\n" - + " \"questionType\": \"TEXT\"\n" - + " },\n" - + " \"giverSection\": \"giverSection\",\n" - + " \"recipientSection\": \"recipientSection\",\n" - + " \"feedbackResponseId\": \"questionId%giver@email.com%recipient@email.com\"\n" - + "}", serializeString); - } catch (JsonParseException e) { - fail("error detected during serializing"); - } - } -} diff --git a/src/test/java/teammates/test/cases/util/TimeHelperTest.java b/src/test/java/teammates/test/cases/util/TimeHelperTest.java deleted file mode 100644 index 6ba8ef37ad5..00000000000 --- a/src/test/java/teammates/test/cases/util/TimeHelperTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package teammates.test.cases.util; - -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.Month; -import java.time.ZoneId; - -import org.testng.annotations.Test; - -import teammates.common.util.TimeHelper; -import teammates.test.cases.BaseTestCase; - -/** - * SUT: {@link TimeHelper}. - */ -public class TimeHelperTest extends BaseTestCase { - - @Test - public void testParseDateTimeFromSessionsForm() { - String testDate = "Fri, 01 Feb, 2013"; - String testTime = "0"; - LocalDateTime expectedOutput = LocalDateTime.of(2013, Month.FEBRUARY, 1, 0, 0); - - testTime = "0"; - ______TS("boundary case: time = 0"); - assertEquals(expectedOutput, TimeHelper.parseDateTimeFromSessionsForm(testDate, testTime)); - - ______TS("boundary case: time = 24"); - testTime = "24"; - expectedOutput = LocalDateTime.of(2013, Month.FEBRUARY, 1, 23, 59); - assertEquals(expectedOutput, TimeHelper.parseDateTimeFromSessionsForm(testDate, testTime)); - - ______TS("negative time"); - assertNull(TimeHelper.parseDateTimeFromSessionsForm(testDate, "-5")); - - ______TS("large time"); - assertNull(TimeHelper.parseDateTimeFromSessionsForm(testDate, "68")); - - ______TS("date null"); - assertNull(TimeHelper.parseDateTimeFromSessionsForm(null, testTime)); - - ______TS("time null"); - assertNull(TimeHelper.parseDateTimeFromSessionsForm(testDate, null)); - - ______TS("invalid time"); - assertNull(TimeHelper.parseDateTimeFromSessionsForm(testDate, "invalid time")); - - ______TS("fractional time"); - assertNull(TimeHelper.parseDateTimeFromSessionsForm(testDate, "5.5")); - - ______TS("invalid date"); - assertNull(TimeHelper.parseDateTimeFromSessionsForm("invalid date", testDate)); - } - - @Test - public void testEndOfYearDates() { - LocalDateTime date = LocalDateTime.of(2015, Month.DECEMBER, 30, 12, 0); - assertEquals("Wed, 30 Dec, 2015", TimeHelper.formatDateForSessionsForm(date)); - assertEquals("Wed, 30 Dec 2015, 12:00 NOON", TimeHelper.formatDateTimeForDisplay(date)); - assertEquals("Wed, 30 Dec 2015, 12:00 NOON UTC", TimeHelper.formatDateTimeForDisplay( - date.atZone(ZoneId.of("UTC")).toInstant(), ZoneId.of("UTC"))); - assertEquals("30 Dec 12:00 NOON", TimeHelper.formatDateTimeForInstructorHomePage(date)); - } - - @Test - public void testFormatDateForInstructorPages() { - ZoneId zoneId = ZoneId.of("UTC"); - Instant instant = LocalDateTime.of(2018, Month.AUGUST, 18, 0, 0).atZone(zoneId).toInstant(); - assertEquals("18 Aug 2018", TimeHelper.formatDateForInstructorPages(instant, zoneId)); - assertEquals("", TimeHelper.formatDateForInstructorPages(null, zoneId)); - } - - @Test - public void testFormatDateTimeForDisplay() { - ZoneId zoneId = ZoneId.of("UTC"); - Instant instant = LocalDateTime.of(2015, Month.NOVEMBER, 30, 12, 0).atZone(zoneId).toInstant(); - assertEquals("Mon, 30 Nov 2015, 12:00 NOON UTC", TimeHelper.formatDateTimeForDisplay(instant, zoneId)); - - zoneId = ZoneId.of("Asia/Singapore"); - instant = LocalDateTime.of(2015, Month.NOVEMBER, 30, 16, 0).atZone(zoneId).toInstant(); - assertEquals("Mon, 30 Nov 2015, 04:00 PM SGT", TimeHelper.formatDateTimeForDisplay(instant, zoneId)); - - instant = LocalDateTime.of(2015, Month.NOVEMBER, 30, 4, 0).atZone(zoneId).toInstant(); - assertEquals("Mon, 30 Nov 2015, 04:00 AM SGT", TimeHelper.formatDateTimeForDisplay(instant, zoneId)); - } - -} diff --git a/src/test/java/teammates/test/cases/util/package-info.java b/src/test/java/teammates/test/cases/util/package-info.java deleted file mode 100644 index 507c1459f67..00000000000 --- a/src/test/java/teammates/test/cases/util/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Component test cases for testing the utility classes from the Common component. - */ -package teammates.test.cases.util; diff --git a/src/test/java/teammates/test/cases/webapi/CreateFeedbackResponseActionTest.java b/src/test/java/teammates/test/cases/webapi/CreateFeedbackResponseActionTest.java deleted file mode 100644 index 6119b6545fe..00000000000 --- a/src/test/java/teammates/test/cases/webapi/CreateFeedbackResponseActionTest.java +++ /dev/null @@ -1,325 +0,0 @@ -package teammates.test.cases.webapi; - -import java.util.ArrayList; - -import org.apache.http.HttpStatus; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackMcqResponseDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionType; -import teammates.common.datatransfer.questions.FeedbackResponseDetails; -import teammates.common.datatransfer.questions.FeedbackTextResponseDetails; -import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.InvalidHttpRequestBodyException; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.test.driver.AssertHelper; -import teammates.ui.webapi.action.CreateFeedbackResponseAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackResponseData; -import teammates.ui.webapi.request.FeedbackResponseCreateRequest; -import teammates.ui.webapi.request.Intent; - -/** - * SUT: {@link CreateFeedbackResponseAction}. - */ -public class CreateFeedbackResponseActionTest extends BaseActionTest { - private FeedbackQuestionAttributes qn1InSession1InCourse1; - private StudentAttributes student1InCourse1; - private InstructorAttributes instructor1OfCourse1; - private InstructorAttributes instructor2OfCourse1; - private FeedbackQuestionAttributes qn2InGracePeriodInCourse1; - private InstructorAttributes instructor1OfCourse2; - private FeedbackQuestionAttributes qn1InClosedSessionInCourse1; - private StudentAttributes student2InCourse1; - private StudentAttributes student5InCourse1; - private FeedbackQuestionAttributes qn2InSession1InCourse1; - - @Override - protected String getActionUri() { - return Const.ResourceURIs.RESPONSE; - } - - @Override - protected String getRequestMethod() { - return POST; - } - - @Override - protected void prepareTestData() { - removeAndRestoreTypicalDataBundle(); - FeedbackSessionAttributes gracePeriodSession = typicalBundle.feedbackSessions.get("gracePeriodSession"); - FeedbackSessionAttributes session1InCourse1 = typicalBundle.feedbackSessions.get("session1InCourse1"); - FeedbackSessionAttributes closedSession = typicalBundle.feedbackSessions.get("closedSession"); - instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); - student1InCourse1 = typicalBundle.students.get("student1InCourse1"); - qn1InSession1InCourse1 = logic.getFeedbackQuestion( - session1InCourse1.getFeedbackSessionName(), session1InCourse1.getCourseId(), 1); - qn2InGracePeriodInCourse1 = logic.getFeedbackQuestion( - gracePeriodSession.getFeedbackSessionName(), gracePeriodSession.getCourseId(), 2); - qn1InClosedSessionInCourse1 = logic.getFeedbackQuestion( - closedSession.getFeedbackSessionName(), closedSession.getCourseId(), 1); - instructor1OfCourse2 = typicalBundle.instructors.get("instructor1OfCourse2"); - student2InCourse1 = typicalBundle.students.get("student2InCourse1"); - student5InCourse1 = typicalBundle.students.get("student5InCourse1"); - instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); - qn2InSession1InCourse1 = logic.getFeedbackQuestion( - session1InCourse1.getFeedbackSessionName(), session1InCourse1.getCourseId(), 2); - } - - @Test - @Override - protected void testExecute() throws Exception { - - ______TS("not enough attributes"); - verifyHttpParameterFailure(); - verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); - verifyHttpParameterFailure(Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId()); - - ______TS("typical case for student"); - loginAsStudent(student2InCourse1.getGoogleId()); - String[] paramsQn2 = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn2InSession1InCourse1.getId(), - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - }; - FeedbackResponseCreateRequest createRequest = getResponseRequest(student1InCourse1.getEmail()); - CreateFeedbackResponseAction typicalAction = getAction(createRequest, paramsQn2); - JsonResult typicalResult = getJsonResult(typicalAction); - - assertEquals(HttpStatus.SC_OK, typicalResult.getStatusCode()); - FeedbackResponseData typicalData = (FeedbackResponseData) typicalResult.getOutput(); - FeedbackResponseAttributes responseAddedForStudent = - logic.getFeedbackResponse(qn2InSession1InCourse1.getId(), - student2InCourse1.getEmail(), student1InCourse1.getEmail()); - assertNotNull(responseAddedForStudent); - assertEquals("This is the text", typicalData.getResponseDetails().getAnswerString()); - assertEquals(student1InCourse1.getEmail(), typicalData.getRecipientIdentifier()); - assertNotNull(typicalData.getFeedbackResponseId()); - assertEquals(student2InCourse1.getEmail(), typicalData.getGiverIdentifier()); - - ______TS("typical case for instructor"); - loginAsInstructor(instructor2OfCourse1.getGoogleId()); - String[] paramsQn2Grace = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn2InGracePeriodInCourse1.getId(), - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - }; - FeedbackResponseCreateRequest requestForInstructor = getResponseRequest(instructor2OfCourse1.getEmail()); - CreateFeedbackResponseAction typicalActionForInstructor = getAction(requestForInstructor, paramsQn2Grace); - JsonResult typicalResultInstructor = getJsonResult(typicalActionForInstructor); - - assertEquals(HttpStatus.SC_OK, typicalResultInstructor.getStatusCode()); - FeedbackResponseData typicalDataInstructor = (FeedbackResponseData) typicalResultInstructor.getOutput(); - FeedbackResponseAttributes responseAddedForInstructor = - logic.getFeedbackResponse(qn2InGracePeriodInCourse1.getId(), - instructor2OfCourse1.getEmail(), instructor2OfCourse1.getEmail()); - assertNotNull(responseAddedForInstructor); - assertEquals("This is the text", typicalDataInstructor.getResponseDetails().getAnswerString()); - assertNotNull(typicalDataInstructor.getFeedbackResponseId()); - assertEquals(instructor2OfCourse1.getEmail(), typicalDataInstructor.getGiverIdentifier()); - assertEquals(instructor2OfCourse1.getEmail(), typicalDataInstructor.getRecipientIdentifier()); - - ______TS("response already exists"); - //show that this FeedbackResponse already exists - FeedbackResponseAttributes existingFeedbackResponse = - logic.getFeedbackResponse(qn2InSession1InCourse1.getId(), student2InCourse1.getEmail(), - student5InCourse1.getEmail()); - assertNotNull(existingFeedbackResponse); - - String[] paramsQ2S1C1 = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn2InSession1InCourse1.getId(), - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - }; - loginAsStudent(student2InCourse1.getGoogleId()); - FeedbackResponseCreateRequest createRequestAlreadyExists = getResponseRequest(student5InCourse1.getEmail()); - CreateFeedbackResponseAction typicalActionAlreadyExists = getAction(createRequestAlreadyExists, paramsQ2S1C1); - assertThrows(InvalidHttpRequestBodyException.class, () -> getJsonResult(typicalActionAlreadyExists)); - - ______TS("invalid intent"); - String[] invalidIntentParams = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId(), - Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString(), - }; - verifyHttpParameterFailure(invalidIntentParams); - } - - @Test - public void testExecute_studentFeedbackSubmissionMcqGenerateOptionsForTeams_shouldValidateAnswer() throws Exception { - FeedbackSessionAttributes fsa = typicalBundle.feedbackSessions.get("session1InCourse1"); - StudentAttributes studentAttributes = typicalBundle.students.get("student1InCourse1"); - - // create a question - FeedbackMcqQuestionDetails feedbackMcqQuestionDetails = new FeedbackMcqQuestionDetails(); - feedbackMcqQuestionDetails.setGenerateOptionsFor(FeedbackParticipantType.TEAMS); - FeedbackQuestionAttributes fqa = logic.createFeedbackQuestion(FeedbackQuestionAttributes.builder() - .withCourseId(fsa.getCourseId()) - .withFeedbackSessionName(fsa.getFeedbackSessionName()) - .withNumberOfEntitiesToGiveFeedbackTo(2) - .withQuestionDescription("test") - .withQuestionNumber(1) - .withGiverType(FeedbackParticipantType.STUDENTS) - .withRecipientType(FeedbackParticipantType.STUDENTS) - .withQuestionDetails(feedbackMcqQuestionDetails) - .withShowResponsesTo(new ArrayList<>()) - .withShowGiverNameTo(new ArrayList<>()) - .withShowRecipientNameTo(new ArrayList<>()) - .build()); - - // send create request - FeedbackResponseCreateRequest createRequest = new FeedbackResponseCreateRequest(); - createRequest.setQuestionType(FeedbackQuestionType.MCQ); - createRequest.setRecipientIdentifier(studentAttributes.getEmail()); - FeedbackMcqResponseDetails feedbackMcqResponseDetails = new FeedbackMcqResponseDetails(); - feedbackMcqResponseDetails.setAnswer("TEAM_NOT_EXIST"); - createRequest.setResponseDetails(feedbackMcqResponseDetails); - - String[] params = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, fqa.getFeedbackQuestionId(), - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - }; - - InvalidHttpRequestBodyException e = assertThrows(InvalidHttpRequestBodyException.class, () -> { - loginAsStudent(studentAttributes.getGoogleId()); - CreateFeedbackResponseAction a = getAction(createRequest, params); - getJsonResult(a); - }); - AssertHelper.assertContains(Const.FeedbackQuestion.MCQ_ERROR_INVALID_OPTION, e.getMessage()); - } - - @Test - public void testExecute_instructorFeedbackSubmissionMcqGenerateOptionsForTeams_shouldValidateAnswer() throws Exception { - FeedbackSessionAttributes fsa = typicalBundle.feedbackSessions.get("session1InCourse1"); - InstructorAttributes instructorAttributes = typicalBundle.instructors.get("instructor1OfCourse1"); - - // create a question - FeedbackMcqQuestionDetails feedbackMcqQuestionDetails = new FeedbackMcqQuestionDetails(); - feedbackMcqQuestionDetails.setGenerateOptionsFor(FeedbackParticipantType.TEAMS); - FeedbackQuestionAttributes fqa = logic.createFeedbackQuestion(FeedbackQuestionAttributes.builder() - .withCourseId(fsa.getCourseId()) - .withFeedbackSessionName(fsa.getFeedbackSessionName()) - .withNumberOfEntitiesToGiveFeedbackTo(2) - .withQuestionDescription("test") - .withQuestionNumber(1) - .withGiverType(FeedbackParticipantType.INSTRUCTORS) - .withRecipientType(FeedbackParticipantType.INSTRUCTORS) - .withQuestionDetails(feedbackMcqQuestionDetails) - .withShowResponsesTo(new ArrayList<>()) - .withShowGiverNameTo(new ArrayList<>()) - .withShowRecipientNameTo(new ArrayList<>()) - .build()); - - // send create request - FeedbackResponseCreateRequest createRequest = new FeedbackResponseCreateRequest(); - createRequest.setQuestionType(FeedbackQuestionType.MCQ); - createRequest.setRecipientIdentifier(instructorAttributes.getEmail()); - FeedbackMcqResponseDetails feedbackMcqResponseDetails = new FeedbackMcqResponseDetails(); - feedbackMcqResponseDetails.setAnswer("TEAM_NOT_EXIST"); - createRequest.setResponseDetails(feedbackMcqResponseDetails); - - String[] params = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, fqa.getFeedbackQuestionId(), - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - }; - - InvalidHttpRequestBodyException e = assertThrows(InvalidHttpRequestBodyException.class, () -> { - loginAsInstructor(instructorAttributes.getGoogleId()); - CreateFeedbackResponseAction a = getAction(createRequest, params); - getJsonResult(a); - }); - AssertHelper.assertContains(Const.FeedbackQuestion.MCQ_ERROR_INVALID_OPTION, e.getMessage()); - } - - @Test - @Override - protected void testAccessControl() throws Exception { - - ______TS("non-exist feedback question"); - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - String[] nonExistFeedbackQuestionParams = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, "randomNonExist", - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - }; - assertThrows(EntityNotFoundException.class, - () -> getAction(nonExistFeedbackQuestionParams).checkAccessControl()); - - ______TS("feedback session is closed"); - String[] closedFeedbackSessionParams = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InClosedSessionInCourse1.getId(), - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - }; - verifyCannotAccess(closedFeedbackSessionParams); - - ______TS("in preview request"); - String[] previewParams = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId(), - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.PREVIEWAS, student1InCourse1.getEmail(), - }; - verifyCannotAccess(previewParams); - - ______TS("not answerable for students"); - String[] notAnswerableForStudents = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn2InGracePeriodInCourse1.getId(), - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - }; - //verify not answerable to students - assertEquals(FeedbackParticipantType.INSTRUCTORS, qn2InGracePeriodInCourse1.getGiverType()); - verifyCannotAccess(notAnswerableForStudents); - - ______TS("not answerable to instructors"); - String[] notAnswerableForInstructors = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId(), - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - }; - assertEquals(FeedbackParticipantType.STUDENTS, qn1InSession1InCourse1.getGiverType()); - verifyCannotAccess(notAnswerableForInstructors); - - ______TS("invalid HTTP parameters"); - String[] invalidParams = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId(), - Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString(), - }; - assertThrows(InvalidHttpParameterException.class, () -> getAction(invalidParams).checkAccessControl()); - invalidParams[3] = Intent.INSTRUCTOR_RESULT.toString(); - assertThrows(InvalidHttpParameterException.class, () -> getAction(invalidParams).checkAccessControl()); - - ______TS("invalid recipient for student"); - loginAsStudent(student1InCourse1.getGoogleId()); - String[] invalidRecipientForStudent = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn1InSession1InCourse1.getId(), - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - }; - assertThrows(UnauthorizedAccessException.class, () -> { - FeedbackResponseCreateRequest createRequest = getResponseRequest(student2InCourse1.getEmail()); - getAction(createRequest, invalidRecipientForStudent).checkAccessControl(); - }); - - ______TS("invalid recipient for instructor"); - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - String[] invalidRecipientForInstructor = { - Const.ParamsNames.FEEDBACK_QUESTION_ID, qn2InGracePeriodInCourse1.getId(), - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - }; - assertThrows(UnauthorizedAccessException.class, () -> { - FeedbackResponseCreateRequest createRequest = getResponseRequest(instructor1OfCourse2.getEmail()); - getAction(createRequest, invalidRecipientForInstructor).checkAccessControl(); - }); - - } - - private FeedbackResponseCreateRequest getResponseRequest(String recipientEmail) { - FeedbackResponseCreateRequest createRequest = new FeedbackResponseCreateRequest(); - createRequest.setQuestionType(FeedbackQuestionType.TEXT); - createRequest.setRecipientIdentifier(recipientEmail); - FeedbackResponseDetails responseDetails = new FeedbackTextResponseDetails("This is the text"); - createRequest.setResponseDetails(responseDetails); - return createRequest; - } -} diff --git a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackResponseActionTest.java b/src/test/java/teammates/test/cases/webapi/DeleteFeedbackResponseActionTest.java deleted file mode 100644 index 156d2530fca..00000000000 --- a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackResponseActionTest.java +++ /dev/null @@ -1,323 +0,0 @@ -package teammates.test.cases.webapi; - -import org.apache.http.HttpStatus; -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteFeedbackResponseAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.request.Intent; - -/** - * SUT: {@link DeleteFeedbackResponseAction}. - */ -public class DeleteFeedbackResponseActionTest extends BaseActionTest { - - private StudentAttributes student1InCourse1; - private StudentAttributes student2InCourse1; - private StudentAttributes student5InCourse1; - private InstructorAttributes instructor2OfCourse1; - private InstructorAttributes instructor1OfCourse1; - private FeedbackResponseAttributes typicalResponse; - private FeedbackResponseAttributes testModerateResponse; - private FeedbackResponseAttributes typicalResponse2; - private FeedbackResponseAttributes typicalResponse3; - private FeedbackResponseAttributes responseInClosedSession; - private FeedbackSessionAttributes closedSession; - - @Override - protected String getActionUri() { - return Const.ResourceURIs.RESPONSE; - } - - @Override - protected String getRequestMethod() { - return DELETE; - } - - @Override - protected void prepareTestData() { - removeAndRestoreTypicalDataBundle(); - student1InCourse1 = typicalBundle.students.get("student1InCourse1"); - student2InCourse1 = typicalBundle.students.get("student2InCourse1"); - StudentAttributes student4inCourse1 = typicalBundle.students.get("student4InCourse1"); - student5InCourse1 = typicalBundle.students.get("student5InCourse1"); - instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); - instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); - FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); - FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); - closedSession = typicalBundle.feedbackSessions.get("closedSession"); - - FeedbackQuestionAttributes question = logic.getFeedbackQuestion( - session.getFeedbackSessionName(), session.getCourseId(), 1); - - String giverEmail = student1InCourse1.getEmail(); - String receiverEmail = student1InCourse1.getEmail(); - typicalResponse = logic.getFeedbackResponse(question.getId(), - giverEmail, receiverEmail); - - FeedbackQuestionAttributes testModerateQuestion = logic.getFeedbackQuestion( - session.getFeedbackSessionName(), session.getCourseId(), 2); - testModerateResponse = logic.getFeedbackResponse(testModerateQuestion.getId(), - student2InCourse1.getEmail(), student5InCourse1.getEmail()); - - FeedbackQuestionAttributes question2 = logic.getFeedbackQuestion( - session2.getFeedbackSessionName(), session2.getCourseId(), 1); - typicalResponse2 = logic.getFeedbackResponse(question2.getId(), - student4inCourse1.getEmail(), "Team 1.2"); - - FeedbackQuestionAttributes question3 = logic.getFeedbackQuestion( - session.getFeedbackSessionName(), session.getCourseId(), 3); - typicalResponse3 = logic.getFeedbackResponse(question3.getId(), - instructor1OfCourse1.getEmail(), "%GENERAL%"); - - FeedbackQuestionAttributes question4 = logic.getFeedbackQuestion( - closedSession.getFeedbackSessionName(), closedSession.getCourseId(), 1); - responseInClosedSession = logic.getFeedbackResponse(question4.getId(), - instructor1OfCourse1.getEmail(), instructor1OfCourse1.getEmail()); - } - - @Test - @Override - protected void testExecute() throws Exception { - - loginAsStudent(student1InCourse1.getGoogleId()); - - ______TS("Not enough parameters"); - - verifyHttpParameterFailure(); - verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); - - ______TS("Typical success case, student"); - - String[] params = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), - }; - - DeleteFeedbackResponseAction a = getAction(params); - JsonResult r = getJsonResult(a); - - assertEquals(HttpStatus.SC_OK, r.getStatusCode()); - - // response is deleted - assertNull(logic.getFeedbackResponse(typicalResponse.getId())); - - // delete the response again, throw NullPointerException - a = getAction(params); - DeleteFeedbackResponseAction finalAction = a; - assertThrows(NullPointerException.class, () -> getJsonResult(finalAction)); - - ______TS("Typical success case, instructor"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - params = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), - }; - - a = getAction(params); - r = getJsonResult(a); - - assertEquals(HttpStatus.SC_OK, r.getStatusCode()); - - // response is deleted - assertNull(logic.getFeedbackResponse(typicalResponse3.getId())); - - // delete the response again, throw NullPointerException - a = getAction(params); - DeleteFeedbackResponseAction finalA = a; - assertThrows(NullPointerException.class, () -> getJsonResult(finalA)); - } - - @Test - @Override - protected void testAccessControl() throws Exception { - - ______TS("wrong giver type"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - String[] wrongGiverTypeParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), - }; - - verifyCannotAccess(wrongGiverTypeParams); - - ______TS("preview mode, cannot access"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - String[] previewParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), - Const.ParamsNames.PREVIEWAS, instructor1OfCourse1.email, - }; - - verifyCannotAccess(previewParams); - - ______TS("response in session not open, cannot access"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - assertFalse(closedSession.isOpened()); - - String[] sessionNotOpenParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, responseInClosedSession.getId(), - }; - - verifyCannotAccess(sessionNotOpenParams); - - ______TS("Response contains question not intended shown to instructor, " - + "moderated instructor should not be accessible"); - - loginAsInstructor(instructor1OfCourse1.googleId); - - assertFalse(logic.getFeedbackQuestion(typicalResponse2.getFeedbackQuestionId()) - .getShowResponsesTo().contains(FeedbackParticipantType.INSTRUCTORS)); - - String[] invalidModeratedInstructorSubmissionParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse2.getId(), - Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, instructor1OfCourse1.getEmail(), - }; - - verifyCannotAccess(invalidModeratedInstructorSubmissionParams); - - ______TS("Instructor moderates student's response, but response not given by moderated student, " - + "should not be accessible"); - - loginAsInstructor(instructor1OfCourse1.googleId); - - assertEquals(FeedbackParticipantType.STUDENTS, - logic.getFeedbackQuestion(testModerateResponse.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student1InCourse1.getEmail(), testModerateResponse.getGiver()); - - String[] moderatedStudentSubmissionParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, testModerateResponse.getId(), - Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), - }; - verifyCannotAccess(moderatedStudentSubmissionParams); - - ______TS("non-existent feedback response"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - String[] nonExistParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, "randomNonExistId", - }; - - assertThrows(EntityNotFoundException.class, () -> getAction(nonExistParams).checkAccessControl()); - - ______TS("Student intends to access other person's response, should not be accessible"); - - loginAsStudent(student2InCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.STUDENTS, - logic.getFeedbackQuestion(typicalResponse.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student2InCourse1.getEmail(), typicalResponse.getGiver()); - - String[] studentAccessOtherPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), - }; - - verifyCannotAccess(studentAccessOtherPersonParams); - - ______TS("Student intends to access own response, should be accessible"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - assertEquals(student1InCourse1.getEmail(), typicalResponse.getGiver()); - - String[] studentAccessOwnPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse.getId(), - }; - - verifyCanAccess(studentAccessOwnPersonParams); - - ______TS("Student intends to access same team's response, should be accessible"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.TEAMS, - logic.getFeedbackQuestion(typicalResponse2.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student1InCourse1.getTeam(), typicalResponse2.getGiver()); - - String[] studentAccessOSameTeamParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse2.getId(), - }; - - verifyCanAccess(studentAccessOSameTeamParams); - - ______TS("Student intends to access other team's response, should not be accessible"); - - loginAsStudent(student5InCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.TEAMS, - logic.getFeedbackQuestion(typicalResponse2.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student5InCourse1.getTeam(), typicalResponse2.getGiver()); - - String[] studentAccessOtherTeamParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse2.getId(), - }; - - verifyCannotAccess(studentAccessOtherTeamParams); - - ______TS("Instructor intends to access other person's response, should not be accessible"); - - loginAsInstructor(instructor2OfCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.SELF, - logic.getFeedbackQuestion(typicalResponse3.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(instructor2OfCourse1.getEmail(), typicalResponse3.getGiver()); - - String[] instructorAccessOtherPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), - }; - - verifyCannotAccess(instructorAccessOtherPersonParams); - - ______TS("Instructor intends to access own response, should be accessible"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - assertEquals(instructor1OfCourse1.getEmail(), typicalResponse3.getGiver()); - - String[] instructorAccessOwnPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), - }; - - verifyCanAccess(instructorAccessOwnPersonParams); - - ______TS("Unknown intent, should not be accessible"); - - loginAsInstructor(instructor2OfCourse1.getGoogleId()); - - String[] unknownIntentParams = new String[] { - Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, typicalResponse3.getId(), - }; - - assertThrows(InvalidHttpParameterException.class, () -> getAction(unknownIntentParams).checkAccessControl()); - } - -} diff --git a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackResponseActionTest.java b/src/test/java/teammates/test/cases/webapi/UpdateFeedbackResponseActionTest.java deleted file mode 100644 index 338f14fd57b..00000000000 --- a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackResponseActionTest.java +++ /dev/null @@ -1,566 +0,0 @@ -package teammates.test.cases.webapi; - -import java.util.ArrayList; - -import org.testng.annotations.Test; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; -import teammates.common.datatransfer.questions.FeedbackMcqResponseDetails; -import teammates.common.datatransfer.questions.FeedbackQuestionType; -import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.InvalidHttpRequestBodyException; -import teammates.common.util.Const; -import teammates.test.driver.AssertHelper; -import teammates.ui.webapi.action.UpdateFeedbackResponseAction; -import teammates.ui.webapi.request.FeedbackResponseUpdateRequest; -import teammates.ui.webapi.request.Intent; - -/** - * SUT: {@link UpdateFeedbackResponseAction}. - */ -public class UpdateFeedbackResponseActionTest extends BaseActionTest { - - private StudentAttributes student1InCourse1; - private InstructorAttributes instructor1OfCourse1; - private FeedbackResponseAttributes student1ResponseToStudent1; - private FeedbackResponseAttributes instructor1ResponseToAll; - - @Override - protected String getActionUri() { - return Const.ResourceURIs.RESPONSE; - } - - @Override - protected String getRequestMethod() { - return PUT; - } - - @Override - protected void prepareTestData() { - removeAndRestoreTypicalDataBundle(); - student1InCourse1 = typicalBundle.students.get("student1InCourse1"); - instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); - FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); - - FeedbackQuestionAttributes question = logic.getFeedbackQuestion( - session.getFeedbackSessionName(), session.getCourseId(), 1); - - String giverEmail = student1InCourse1.getEmail(); - String receiverEmail = student1InCourse1.getEmail(); - student1ResponseToStudent1 = logic.getFeedbackResponse(question.getId(), - giverEmail, receiverEmail); - - FeedbackQuestionAttributes question3 = logic.getFeedbackQuestion( - session.getFeedbackSessionName(), session.getCourseId(), 3); - instructor1ResponseToAll = logic.getFeedbackResponse(question3.getId(), - instructor1OfCourse1.getEmail(), "%GENERAL%"); - } - - @Override - protected void testExecute() throws Exception { - // See individual test cases below - } - - @Test - protected void testExecute_missingIntent_httpParameterFailure() { - - ______TS("missing intent response parameters"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - String[] missingIntentParams = new String[] { - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), - }; - - verifyHttpParameterFailure(missingIntentParams); - } - - @Test - protected void testExecute_missingResponseId_httpParameterFailure() { - - ______TS("missing response id parameters"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - String[] missingResponseIdParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - }; - - verifyHttpParameterFailure(missingResponseIdParams); - } - - @Test - public void testExecute_studentFeedbackSubmissionMcqGenerateOptionsForTeams_shouldValidateAnswer() throws Exception { - FeedbackSessionAttributes fsa = typicalBundle.feedbackSessions.get("session1InCourse1"); - StudentAttributes studentAttributes = typicalBundle.students.get("student1InCourse1"); - - // create a question - FeedbackMcqQuestionDetails feedbackMcqQuestionDetails = new FeedbackMcqQuestionDetails(); - feedbackMcqQuestionDetails.setGenerateOptionsFor(FeedbackParticipantType.TEAMS); - FeedbackQuestionAttributes fqa = logic.createFeedbackQuestion(FeedbackQuestionAttributes.builder() - .withCourseId(fsa.getCourseId()) - .withFeedbackSessionName(fsa.getFeedbackSessionName()) - .withNumberOfEntitiesToGiveFeedbackTo(2) - .withQuestionDescription("test") - .withQuestionNumber(1) - .withGiverType(FeedbackParticipantType.STUDENTS) - .withRecipientType(FeedbackParticipantType.STUDENTS) - .withQuestionDetails(feedbackMcqQuestionDetails) - .withShowResponsesTo(new ArrayList<>()) - .withShowGiverNameTo(new ArrayList<>()) - .withShowRecipientNameTo(new ArrayList<>()) - .build()); - - // create a response - FeedbackMcqResponseDetails feedbackMcqResponseDetails = new FeedbackMcqResponseDetails(); - feedbackMcqResponseDetails.setAnswer(studentAttributes.getTeam()); - FeedbackResponseAttributes feedbackResponse = - FeedbackResponseAttributes - .builder(fqa.getId(), studentAttributes.getEmail(), studentAttributes.getEmail()) - .withGiverSection(studentAttributes.getSection()) - .withRecipientSection(studentAttributes.getSection()) - .withCourseId(fqa.getCourseId()) - .withFeedbackSessionName(fqa.getFeedbackSessionName()) - .withResponseDetails(feedbackMcqResponseDetails) - .build(); - feedbackResponse = logic.createFeedbackResponse(feedbackResponse); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(studentAttributes.getEmail()); - - String[] params = { - Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponse.getId(), - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - }; - - InvalidHttpRequestBodyException e = assertThrows(InvalidHttpRequestBodyException.class, () -> { - loginAsStudent(studentAttributes.getGoogleId()); - UpdateFeedbackResponseAction a = getAction(updateRequest, params); - getJsonResult(a); - }); - AssertHelper.assertContains(Const.FeedbackQuestion.MCQ_ERROR_INVALID_OPTION, e.getMessage()); - } - - @Test - public void testExecute_instructorFeedbackSubmissionMcqGenerateOptionsForTeams_shouldValidateAnswer() throws Exception { - FeedbackSessionAttributes fsa = typicalBundle.feedbackSessions.get("session1InCourse1"); - InstructorAttributes instructorAttributes = typicalBundle.instructors.get("instructor1OfCourse1"); - StudentAttributes studentAttributes = typicalBundle.students.get("student1InCourse1"); - - // create a question - FeedbackMcqQuestionDetails feedbackMcqQuestionDetails = new FeedbackMcqQuestionDetails(); - feedbackMcqQuestionDetails.setGenerateOptionsFor(FeedbackParticipantType.TEAMS); - FeedbackQuestionAttributes fqa = logic.createFeedbackQuestion(FeedbackQuestionAttributes.builder() - .withCourseId(fsa.getCourseId()) - .withFeedbackSessionName(fsa.getFeedbackSessionName()) - .withNumberOfEntitiesToGiveFeedbackTo(2) - .withQuestionDescription("test") - .withQuestionNumber(1) - .withGiverType(FeedbackParticipantType.INSTRUCTORS) - .withRecipientType(FeedbackParticipantType.INSTRUCTORS) - .withQuestionDetails(feedbackMcqQuestionDetails) - .withShowResponsesTo(new ArrayList<>()) - .withShowGiverNameTo(new ArrayList<>()) - .withShowRecipientNameTo(new ArrayList<>()) - .build()); - - // create a response - FeedbackMcqResponseDetails feedbackMcqResponseDetails = new FeedbackMcqResponseDetails(); - feedbackMcqResponseDetails.setAnswer(studentAttributes.getTeam()); - FeedbackResponseAttributes feedbackResponse = - FeedbackResponseAttributes - .builder(fqa.getId(), instructorAttributes.getEmail(), instructorAttributes.getEmail()) - .withGiverSection(Const.DEFAULT_SECTION) - .withRecipientSection(Const.DEFAULT_SECTION) - .withCourseId(fqa.getCourseId()) - .withFeedbackSessionName(fqa.getFeedbackSessionName()) - .withResponseDetails(feedbackMcqResponseDetails) - .build(); - feedbackResponse = logic.createFeedbackResponse(feedbackResponse); - - // send update request - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructorAttributes.getEmail()); - - String[] params = { - Const.ParamsNames.FEEDBACK_RESPONSE_ID, feedbackResponse.getId(), - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - }; - - InvalidHttpRequestBodyException e = assertThrows(InvalidHttpRequestBodyException.class, () -> { - loginAsInstructor(instructorAttributes.getGoogleId()); - UpdateFeedbackResponseAction a = getAction(updateRequest, params); - getJsonResult(a); - }); - AssertHelper.assertContains(Const.FeedbackQuestion.MCQ_ERROR_INVALID_OPTION, e.getMessage()); - } - - private FeedbackResponseUpdateRequest getUpdateRequest(String recipientIdentifier) { - FeedbackResponseUpdateRequest updateRequest = new FeedbackResponseUpdateRequest(); - updateRequest.setQuestionType(FeedbackQuestionType.MCQ); - updateRequest.setRecipientIdentifier(recipientIdentifier); - FeedbackMcqResponseDetails newDetails = new FeedbackMcqResponseDetails(); - newDetails.setAnswer("TEAM_NOT_EXIST"); - updateRequest.setResponseDetails(newDetails); - return updateRequest; - } - - @Test - @Override - protected void testAccessControl() throws Exception { - // See individual test cases below - } - - @Test - protected void testAccessControl_wrongGiver_inaccessible() { - - ______TS("wrong giver type"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - String[] wrongGiverTypeParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), - }; - - verifyCannotAccess(wrongGiverTypeParams); - } - - @Test - protected void testAccessControl_previewMode_inaccessible() { - - ______TS("preview mode, cannot access"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - String[] previewParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), - Const.ParamsNames.PREVIEWAS, instructor1OfCourse1.email, - }; - - verifyCannotAccess(previewParams); - - } - - @Test - protected void testAccessControl_responseSessionNotOpen_inaccessible() { - - ______TS("response in session not open, cannot access"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - FeedbackSessionAttributes closedSession = typicalBundle.feedbackSessions.get("closedSession"); - FeedbackQuestionAttributes question4 = logic.getFeedbackQuestion( - closedSession.getFeedbackSessionName(), closedSession.getCourseId(), 1); - FeedbackResponseAttributes responseInClosedSession = logic.getFeedbackResponse(question4.getId(), - instructor1OfCourse1.getEmail(), instructor1OfCourse1.getEmail()); - - assertFalse(closedSession.isOpened()); - - String[] sessionNotOpenParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, responseInClosedSession.getId(), - }; - - verifyCannotAccess(sessionNotOpenParams); - } - - @Test - protected void testAccessControl_containsQuestionNotForInstructor_inaccessible() { - - ______TS("Responses not visible to instructors, should not be accessible to an instructor" - + " even with course edit permissions."); - - StudentAttributes student4inCourse1 = typicalBundle.students.get("student4InCourse1"); - FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); - FeedbackQuestionAttributes question2 = logic.getFeedbackQuestion( - session2.getFeedbackSessionName(), session2.getCourseId(), 1); - FeedbackResponseAttributes student4ResponseToTeam = logic.getFeedbackResponse(question2.getId(), - student4inCourse1.getEmail(), "Team 1.2"); - - loginAsInstructor(instructor1OfCourse1.googleId); - - assertFalse(logic.getFeedbackQuestion(student4ResponseToTeam.getFeedbackQuestionId()) - .getShowResponsesTo().contains(FeedbackParticipantType.INSTRUCTORS)); - - String[] invalidModeratedInstructorSubmissionParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student4ResponseToTeam.getId(), - Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student4inCourse1.getEmail(), - }; - - verifyCannotAccess(invalidModeratedInstructorSubmissionParams); - } - - @Test - protected void testAccessControl_noFeedbackResponse_inaccessible() { - - ______TS("non-existent feedback response"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - assertNull(logic.getFeedbackResponse("randomNonExistId")); - - String[] nonExistParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, "randomNonExistId", - }; - - assertThrows(EntityNotFoundException.class, () -> getAction(nonExistParams).checkAccessControl()); - } - - @Test - protected void testAccessControl_unknownIntent_inaccessible() { - - ______TS("Unknown intent, should not be accessible"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - String[] unknownIntentParams = new String[] { - Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, instructor1ResponseToAll.getId(), - }; - - assertThrows(InvalidHttpParameterException.class, () -> getAction(unknownIntentParams).checkAccessControl()); - } - - @Test - protected void testAccessControl_giverNotModeratedStudent_inaccessible() { - - ______TS("Instructor moderates student's response, but response not given by moderated student, " - + "should not be accessible"); - - StudentAttributes student2InCourse1 = typicalBundle.students.get("student2InCourse1"); - StudentAttributes student5InCourse1 = typicalBundle.students.get("student5InCourse1"); - FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); - FeedbackQuestionAttributes testModerateQuestion = logic.getFeedbackQuestion( - session.getFeedbackSessionName(), session.getCourseId(), 2); - FeedbackResponseAttributes testModerateResponse = logic.getFeedbackResponse(testModerateQuestion.getId(), - student2InCourse1.getEmail(), student5InCourse1.getEmail()); - - loginAsInstructor(instructor1OfCourse1.googleId); - - assertEquals(FeedbackParticipantType.STUDENTS, - logic.getFeedbackQuestion(testModerateResponse.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student1InCourse1.getEmail(), testModerateResponse.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor1OfCourse1.getEmail()); - - String[] moderatedStudentSubmissionParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, testModerateResponse.getId(), - Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), - }; - - verifyCannotAccess(updateRequest, moderatedStudentSubmissionParams); - } - - @Test - protected void testAccessControl_studentAccessOtherStudent_inaccessible() { - - ______TS("Student intends to access other person's response, should not be accessible"); - - StudentAttributes student2InCourse1 = typicalBundle.students.get("student2InCourse1"); - - loginAsStudent(student2InCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.STUDENTS, - logic.getFeedbackQuestion(student1ResponseToStudent1.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student2InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); - - String[] studentAccessOtherPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), - }; - - verifyCannotAccess(updateRequest, studentAccessOtherPersonParams); - } - - @Test - protected void testAccessControl_studentAccessOtherTeam_inaccessible() { - - ______TS("Student intends to access other team's response, should not be accessible"); - - StudentAttributes student5InCourse1 = typicalBundle.students.get("student5InCourse1"); - StudentAttributes student4inCourse1 = typicalBundle.students.get("student4InCourse1"); - FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); - FeedbackQuestionAttributes question2 = logic.getFeedbackQuestion( - session2.getFeedbackSessionName(), session2.getCourseId(), 1); - FeedbackResponseAttributes student4ResponseToTeam = logic.getFeedbackResponse(question2.getId(), - student4inCourse1.getEmail(), "Team 1.2"); - - loginAsStudent(student5InCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.TEAMS, - logic.getFeedbackQuestion(student4ResponseToTeam.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student5InCourse1.getTeam(), student4ResponseToTeam.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student5InCourse1.getEmail()); - - String[] studentAccessOtherTeamParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student4ResponseToTeam.getId(), - }; - - verifyCannotAccess(updateRequest, studentAccessOtherTeamParams); - } - - @Test - protected void testAccessControl_instructorAccessOtherGiver_inaccessible() { - - ______TS("Instructor intends to access other person's response, should not be accessible"); - - InstructorAttributes instructor2OfCourse1 = typicalBundle.instructors.get("instructor2OfCourse1"); - - loginAsInstructor(instructor2OfCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.SELF, - logic.getFeedbackQuestion(instructor1ResponseToAll.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(instructor2OfCourse1.getEmail(), instructor1ResponseToAll.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor2OfCourse1.getEmail()); - - String[] instructorAccessOtherPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, instructor1ResponseToAll.getId(), - }; - - verifyCannotAccess(updateRequest, instructorAccessOtherPersonParams); - } - - @Test - protected void testAccessControl_instructorAccessOwnResponse_accessible() { - - ______TS("Instructor intends to access own response, should be accessible"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - assertEquals(instructor1OfCourse1.getEmail(), instructor1ResponseToAll.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor1ResponseToAll.getRecipient()); - - String[] instructorAccessOwnPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, instructor1ResponseToAll.getId(), - }; - - verifyCanAccess(updateRequest, instructorAccessOwnPersonParams); - } - - @Test - protected void testAccessControl_instructorAccessIntentStudentLoggedIn_inaccessible() { - - ______TS("Instructor intends to access own response, but logged in as student, should be inaccessible"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - assertEquals(instructor1OfCourse1.getEmail(), instructor1ResponseToAll.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor1ResponseToAll.getRecipient()); - - String[] instructorAccessOwnPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, instructor1ResponseToAll.getId(), - }; - - verifyCannotAccess(updateRequest, instructorAccessOwnPersonParams); - } - - @Test - protected void testAccessControl_studentAccessSameTeam_accessible() { - - ______TS("Student intends to access same team's response, should be accessible"); - - StudentAttributes student4inCourse1 = typicalBundle.students.get("student4InCourse1"); - FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); - FeedbackQuestionAttributes question2 = logic.getFeedbackQuestion( - session2.getFeedbackSessionName(), session2.getCourseId(), 1); - FeedbackResponseAttributes student4ResponseToTeam = logic.getFeedbackResponse(question2.getId(), - student4inCourse1.getEmail(), "Team 1.2"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - assertEquals(FeedbackParticipantType.TEAMS, - logic.getFeedbackQuestion(student4ResponseToTeam.getFeedbackQuestionId()).getGiverType()); - assertNotEquals(student1InCourse1.getTeam(), student4ResponseToTeam.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student4ResponseToTeam.getRecipient()); - - String[] studentAccessSameTeamParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student4ResponseToTeam.getId(), - }; - - verifyCanAccess(updateRequest, studentAccessSameTeamParams); - } - - @Test - protected void testAccessControl_studentAccessOwnResponse_accessible() { - - ______TS("Student intends to access own response, should be accessible"); - - loginAsStudent(student1InCourse1.getGoogleId()); - - assertEquals(student1InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); - - String[] studentAccessOwnPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), - }; - - verifyCanAccess(updateRequest, studentAccessOwnPersonParams); - } - - @Test - protected void testAccessControl_instructorSubmitStudentResponse_accessible() { - - ______TS("Instructor attempts to edit student's response with appropriate permission, should be accessible"); - - loginAsInstructor(instructor1OfCourse1.getGoogleId()); - - assertEquals(student1InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); - - String[] studentAccessOwnPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), - Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), - }; - - verifyCanAccess(updateRequest, studentAccessOwnPersonParams); - } - - @Test - protected void testAccessControl_instructorSubmitStudentResponseNoPermission_inaccessible() { - - ______TS("Instructor attempts to edit student's response, but without appropriate permission, " - + "should be inaccessible"); - - InstructorAttributes helperOfCourse1 = typicalBundle.instructors.get("helperOfCourse1"); - - loginAsInstructor(helperOfCourse1.getGoogleId()); - - assertEquals(student1InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); - - FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); - - String[] studentAccessOwnPersonParams = new String[] { - Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), - Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), - }; - - verifyCannotAccess(updateRequest, studentAccessOwnPersonParams); - } -} diff --git a/src/test/java/teammates/test/cases/webapi/WebApiServletTest.java b/src/test/java/teammates/test/cases/webapi/WebApiServletTest.java deleted file mode 100644 index d5fd4f0b6d8..00000000000 --- a/src/test/java/teammates/test/cases/webapi/WebApiServletTest.java +++ /dev/null @@ -1,123 +0,0 @@ -package teammates.test.cases.webapi; - -import org.apache.http.HttpStatus; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.testng.annotations.Test; - -import com.google.appengine.api.datastore.DatastoreTimeoutException; -import com.google.apphosting.api.DeadlineExceededException; - -import teammates.common.exception.EntityNotFoundException; -import teammates.common.exception.InvalidHttpParameterException; -import teammates.common.exception.UnauthorizedAccessException; -import teammates.common.util.Const; -import teammates.test.cases.BaseTestCaseWithObjectifyAccess; -import teammates.test.driver.MockHttpServletRequest; -import teammates.test.driver.MockHttpServletResponse; -import teammates.ui.webapi.action.WebApiServlet; - -/** - * SUT: {@link WebApiServlet}. - */ -public class WebApiServletTest extends BaseTestCaseWithObjectifyAccess { - - private static final WebApiServlet SERVLET = new WebApiServlet(); - - private MockHttpServletRequest mockRequest; - private MockHttpServletResponse mockResponse; - - private void setupMocks(String method, String requestUrl) { - mockRequest = new MockHttpServletRequest(method, Const.ResourceURIs.URI_PREFIX + requestUrl); - mockResponse = new MockHttpServletResponse(); - } - - @Test - public void allTests() throws Exception { - - ______TS("Typical case: valid action mapping"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, "NoException"); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_OK, mockResponse.getStatus()); - - ______TS("Failure case: invalid action mapping"); - - setupMocks(HttpGet.METHOD_NAME, "nonexistent"); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_NOT_FOUND, mockResponse.getStatus()); - - setupMocks(HttpPost.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, mockResponse.getStatus()); - - ______TS("Failure case: NullHttpParameterException"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_BAD_REQUEST, mockResponse.getStatus()); - - ______TS("Failure case: InvalidHttpParameterException"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, InvalidHttpParameterException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_BAD_REQUEST, mockResponse.getStatus()); - - ______TS("Failure case: DeadlineExceededException"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, DeadlineExceededException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); - - ______TS("Failure case: DatastoreTimeoutException"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, DatastoreTimeoutException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); - - ______TS("Failure case: UnauthorizedAccessException"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, UnauthorizedAccessException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_FORBIDDEN, mockResponse.getStatus()); - - ______TS("Failure case: EntityNotFoundException"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, EntityNotFoundException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_NOT_FOUND, mockResponse.getStatus()); - - ______TS("Failure case: NullPointerException"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, NullPointerException.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); - - ______TS("Failure case: AssertionError"); - - setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); - mockRequest.addParam(Const.ParamsNames.ERROR, AssertionError.class.getSimpleName()); - - SERVLET.doGet(mockRequest, mockResponse); - assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); - - } - -} diff --git a/src/test/java/teammates/test/cases/webapi/package-info.java b/src/test/java/teammates/test/cases/webapi/package-info.java deleted file mode 100644 index cc0112da1a6..00000000000 --- a/src/test/java/teammates/test/cases/webapi/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * System test cases for testing the user-invoked actions. - */ -package teammates.test.cases.webapi; diff --git a/src/test/java/teammates/test/driver/BackDoor.java b/src/test/java/teammates/test/driver/BackDoor.java deleted file mode 100644 index ce7f7058b44..00000000000 --- a/src/test/java/teammates/test/driver/BackDoor.java +++ /dev/null @@ -1,532 +0,0 @@ -package teammates.test.driver; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.net.URL; -import java.net.URLConnection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gson.reflect.TypeToken; - -import teammates.common.datatransfer.DataBundle; -import teammates.common.datatransfer.attributes.AccountAttributes; -import teammates.common.datatransfer.attributes.CourseAttributes; -import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; -import teammates.common.datatransfer.attributes.FeedbackResponseAttributes; -import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; -import teammates.common.datatransfer.attributes.InstructorAttributes; -import teammates.common.datatransfer.attributes.StudentAttributes; -import teammates.common.datatransfer.attributes.StudentProfileAttributes; -import teammates.common.exception.TeammatesException; -import teammates.common.util.Const; -import teammates.common.util.JsonUtils; -import teammates.common.util.SanitizationHelper; - -/** - * Used to access the datastore without going through the UI. - * - *

    It requires an authentication via "backdoor key" so that - * the access is limited only to the person who deployed the application. - */ -@Deprecated -public final class BackDoor { - - private BackDoor() { - //utility class - } - - /** - * Persists given data into the datastore. - * - *

    If given entities already exist in the data store, they will be overwritten. - */ - public static String restoreDataBundle(DataBundle dataBundle) { - String dataBundleJson = JsonUtils.toJson(dataBundle); - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", dataBundleJson); - return makePostRequest(params); - } - - /** - * Removes given data from the datastore. - * - *

    If given entities have already been deleted, it fails silently. - */ - public static String removeDataBundle(DataBundle dataBundle) { - String dataBundleJson = JsonUtils.toJson(dataBundle); - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", dataBundleJson); - return makePostRequest(params); - } - - /** - * Removes and restores given data in the datastore. This method is to be called on test startup. - * - *

    Note: The data associated with the test accounts have to be manually removed by removing the data - * bundle when a test ends because the test accounts are shared across tests. - * - *

    Test data should never be cleared after test in order to prevent incurring additional datastore costs because the - * test's data may not be accessed in another test. Also although unlikely in normal conditions, when a test fail to - * remove data bundle on teardown, another test should have no reason to fail. - * - *

    Another reason not to remove associated data after a test is that in case of test failures, it helps to have the - * associated data in the datastore to debug the failure. - * - *

    This means that removing the data bundle on startup is not always sufficient because a test only knows how - * to remove its associated data. - * This is why some tests would fail when they use the same account and use different data. - * Extending this method to remove data outside its associated data would introduce - * unnecessary complications such as extra costs and knowing exactly how much data to remove. Removing too much data - * would not just incur higher datastore costs but we can make tests unexpectedly pass(fail) when the data is expected to - * be not present(present) in another test. - * - *

    TODO: Hence, we need to explicitly remove the data bundle in tests on teardown to avoid instability of tests. - * However, removing the data bundle on teardown manually is not a perfect solution because two tests can concurrently - * access the same account and their data may get mixed up in the process. This is a major problem we need to address. - */ - public static String removeAndRestoreDataBundle(DataBundle dataBundle) { - String dataBundleJson = JsonUtils.toJson(dataBundle); - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", dataBundleJson); - return makePostRequest(params); - } - - /** - * Puts searchable documents for entities into the datastore. - */ - public static String putDocuments(DataBundle dataBundle) { - String dataBundleJson = JsonUtils.toJson(dataBundle); - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", dataBundleJson); - return makePostRequest(params); - } - - /** - * Persists an account data into the datastore. - */ - public static String createAccount(AccountAttributes account) { - DataBundle dataBundle = new DataBundle(); - dataBundle.accounts.put(account.googleId, account); - return restoreDataBundle(dataBundle); - } - - /** - * Gets an account data from the datastore. - */ - public static AccountAttributes getAccount(String googleId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", googleId); - String accountJsonString = makePostRequest(params); - return JsonUtils.fromJson(accountJsonString, AccountAttributes.class); - } - - /** - * Gets a student profile data from the datastore. - */ - public static StudentProfileAttributes getStudentProfile(String googleId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", googleId); - String studentProfileJsonString = makePostRequest(params); - return JsonUtils.fromJson(studentProfileJsonString, StudentProfileAttributes.class); - } - - /** - * Checks if a profile picture with the specified key is present in GCS. - */ - public static boolean getWhetherPictureIsPresentInGcs(String pictureKey) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", pictureKey); - return Boolean.parseBoolean(makePostRequest(params)); - } - - /** - * Uploads and updates a student's profile picture in the datastore. - */ - public static String uploadAndUpdateStudentProfilePicture(String googleId, String pictureDataJsonString) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", googleId); - params.put("PLACEHOLDER", pictureDataJsonString); - return makePostRequest(params); - } - - /** - * Deletes an account from datastore. - */ - public static String deleteAccount(String googleId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", googleId); - return makePostRequest(params); - } - - /** - * Persists an instructor data into the datastore. - */ - public static String createInstructor(InstructorAttributes instructor) { - DataBundle dataBundle = new DataBundle(); - dataBundle.instructors.put(instructor.googleId, instructor); - return restoreDataBundle(dataBundle); - } - - /** - * Gets an instructor data with particular google ID from the datastore. - */ - public static InstructorAttributes getInstructorByGoogleId(String googleId, String courseId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", googleId); - params.put("PLACEHOLDER", courseId); - String instructorJsonString = makePostRequest(params); - return JsonUtils.fromJson(instructorJsonString, InstructorAttributes.class); - } - - /** - * Gets an instructor data with particular email from the datastore. - */ - public static InstructorAttributes getInstructorByEmail(String instructorEmail, String courseId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", instructorEmail); - params.put("PLACEHOLDER", courseId); - String instructorJsonString = makePostRequest(params); - return JsonUtils.fromJson(instructorJsonString, InstructorAttributes.class); - } - - /** - * Gets the encrypted registration key for an instructor in the datastore. - */ - public static String getEncryptedKeyForInstructor(String courseId, String instructorEmail) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", instructorEmail); - return makePostRequest(params); - } - - /** - * Deletes an instructor from the datastore. - */ - public static String deleteInstructor(String courseId, String instructorEmail) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", instructorEmail); - return makePostRequest(params); - } - - /** - * Persists a course into the datastore. - */ - public static String createCourse(CourseAttributes course) { - DataBundle dataBundle = new DataBundle(); - dataBundle.courses.put("dummy-key", course); - return restoreDataBundle(dataBundle); - } - - /** - * Gets a course data from the datastore. - */ - public static CourseAttributes getCourse(String courseId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - String courseJsonString = makePostRequest(params); - return JsonUtils.fromJson(courseJsonString, CourseAttributes.class); - } - - /** - * Edits a course in the datastore. - */ - public static String editCourse(CourseAttributes course) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", JsonUtils.toJson(course)); - return makePostRequest(params); - } - - /** - * Deletes a course from the datastore. - */ - public static String deleteCourse(String courseId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - return makePostRequest(params); - } - - /** - * Persists a student data into the datastore. - */ - public static String createStudent(StudentAttributes student) { - DataBundle dataBundle = new DataBundle(); - dataBundle.students.put("dummy-key", student); - return restoreDataBundle(dataBundle); - } - - /** - * Gets a student data from the datastore. - */ - public static StudentAttributes getStudent(String courseId, String studentEmail) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", studentEmail); - String studentJson = makePostRequest(params); - return JsonUtils.fromJson(studentJson, StudentAttributes.class); - } - - /** - * Gets list of students data from the datastore. - */ - public static List getStudents(String courseId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - String studentsJson = makePostRequest(params); - return JsonUtils.fromJson(studentsJson, new TypeToken>(){}.getType()); - } - - /** - * Gets the encrypted registration key for a student in the datastore. - */ - public static String getEncryptedKeyForStudent(String courseId, String studentEmail) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", studentEmail); - return makePostRequest(params); - } - - /** - * Edits a student in the datastore. - */ - public static String editStudent(String originalEmail, StudentAttributes student) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", originalEmail); - params.put("PLACEHOLDER", JsonUtils.toJson(student)); - return makePostRequest(params); - } - - /** - * Deletes a student from the datastore. - */ - public static String deleteStudent(String courseId, String studentEmail) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", studentEmail); - return makePostRequest(params); - } - - /** - * Gets a feedback session data from the data storage. - */ - public static FeedbackSessionAttributes getFeedbackSession(String courseId, String feedbackSessionName) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", feedbackSessionName); - params.put("PLACEHOLDER", courseId); - String feedbackSessionJson = makePostRequest(params); - return JsonUtils.fromJson(feedbackSessionJson, FeedbackSessionAttributes.class); - } - - /** - * Gets a feedback session data from the recycle bin. - */ - public static FeedbackSessionAttributes getFeedbackSessionFromRecycleBin(String courseId, String feedbackSessionName) { - Map params = - createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", feedbackSessionName); - params.put("PLACEHOLDER", courseId); - String feedbackSessionJson = makePostRequest(params); - return JsonUtils.fromJson(feedbackSessionJson, FeedbackSessionAttributes.class); - } - - /** - * Edits a feedback session in the datastore. - */ - public static String editFeedbackSession(FeedbackSessionAttributes updatedFeedbackSession) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", JsonUtils.toJson(updatedFeedbackSession)); - return makePostRequest(params); - } - - /** - * Deletes a feedback session from the datastore. - */ - public static String deleteFeedbackSession(String feedbackSessionName, String courseId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", feedbackSessionName); - params.put("PLACEHOLDER", courseId); - return makePostRequest(params); - } - - /** - * Gets a feedback question data from the datastore. - */ - public static FeedbackQuestionAttributes getFeedbackQuestion(String courseId, String feedbackSessionName, - int qnNumber) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", feedbackSessionName); - params.put("PLACEHOLDER", String.valueOf(qnNumber)); - String feedbackQuestionJson = makePostRequest(params); - return JsonUtils.fromJson(feedbackQuestionJson, FeedbackQuestionAttributes.class); - } - - /** - * Gets a feedback question data from the datastore. - */ - public static FeedbackQuestionAttributes getFeedbackQuestion(String questionId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", questionId); - String feedbackQuestionJson = makePostRequest(params); - return JsonUtils.fromJson(feedbackQuestionJson, FeedbackQuestionAttributes.class); - } - - /** - * Edits a feedback question in the datastore. - */ - public static String editFeedbackQuestion(FeedbackQuestionAttributes updatedFeedbackQuestion) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", JsonUtils.toJson(updatedFeedbackQuestion)); - return makePostRequest(params); - } - - /** - * Deletes a feedback question from the datastore. - */ - public static String deleteFeedbackQuestion(String questionId) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", questionId); - return makePostRequest(params); - } - - /** - * Persists a feedback response into the datastore. - */ - public static String createFeedbackResponse(FeedbackResponseAttributes feedbackResponse) { - String feedbackResponseJson = JsonUtils.toJson(feedbackResponse); - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", feedbackResponseJson); - return makePostRequest(params); - } - - /** - * Gets a feedback response data from the datastore. - */ - public static FeedbackResponseAttributes getFeedbackResponse(String feedbackQuestionId, String giverEmail, - String recipient) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", feedbackQuestionId); - params.put("PLACEHOLDER", giverEmail); - params.put("PLACEHOLDER", recipient); - String feedbackResponseJson = makePostRequest(params); - return JsonUtils.fromJson(feedbackResponseJson, FeedbackResponseAttributes.class); - } - - /** - * Gets a list of feedback response data for particular recipient from the datastore. - */ - public static List - getFeedbackResponsesForReceiverForCourse(String courseId, String recipientEmail) { - Map params = - createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", recipientEmail); - String feedbackResponsesJson = makePostRequest(params); - return JsonUtils.fromJson(feedbackResponsesJson, - new TypeToken>(){}.getType()); - } - - /** - * Gets a list of feedback response data for particular giver from the datastore. - */ - public static List - getFeedbackResponsesFromGiverForCourse(String courseId, String giverEmail) { - Map params = - createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", courseId); - params.put("PLACEHOLDER", giverEmail); - String feedbackResponsesJson = makePostRequest(params); - return JsonUtils.fromJson(feedbackResponsesJson, - new TypeToken>(){}.getType()); - } - - /** - * Deletes a feedback response from the datastore. - */ - public static String deleteFeedbackResponse(String feedbackQuestionId, String giverEmail, String recipient) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", feedbackQuestionId); - params.put("PLACEHOLDER", giverEmail); - params.put("PLACEHOLDER", recipient); - return makePostRequest(params); - } - - private static Map createParamMap(String operation) { - Map map = new HashMap<>(); - map.put("PLACEHOLDER", operation); - - // For authentication - map.put("PLACEHOLDER", "BACKDOOR_KEY"); - - return map; - } - - private static String makePostRequest(Map map) { - try { - String paramString = encodeParameters(map); - String urlString = "/backdoor"; - URLConnection conn = getConnectionToUrl(urlString); - sendRequest(paramString, conn); - return readResponse(conn); - } catch (Exception e) { - return TeammatesException.toStringWithStackTrace(e); - } - } - - @SuppressWarnings("PMD.AssignmentInOperand") // necessary for reading stream response - private static String readResponse(URLConnection conn) throws IOException { - conn.setReadTimeout(10000); - StringBuilder sb = new StringBuilder(); - try (InputStreamReader isr = new InputStreamReader(conn.getInputStream(), Const.SystemParams.ENCODING); - BufferedReader rd = new BufferedReader(isr)) { - String line; - while ((line = rd.readLine()) != null) { - sb.append(line); - } - } - return sb.toString(); - } - - private static void sendRequest(String paramString, URLConnection conn) throws IOException { - try (OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream(), Const.SystemParams.ENCODING)) { - wr.write(paramString); - wr.flush(); - } - } - - private static URLConnection getConnectionToUrl(String urlString) throws IOException { - URL url = new URL(urlString); - URLConnection conn = url.openConnection(); - conn.setDoOutput(true); - return conn; - } - - private static String encodeParameters(Map map) { - StringBuilder dataStringBuilder = new StringBuilder(); - map.forEach((key, value) -> dataStringBuilder.append(key + "=" + SanitizationHelper.sanitizeForUri(value) + "&")); - return dataStringBuilder.toString(); - } - - /** - * Checks if a group recipient's file is present in GCS with specified Key. - */ - public static boolean isGroupListFileKeyPresentInGcs(String groupListFileKey) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", groupListFileKey); - return Boolean.parseBoolean(makePostRequest(params)); - } - - /** - * Deletes the uploaded test file for testing email using group mode. - */ - public static String deleteGroupListFile(String groupListFileKey) { - Map params = createParamMap("PLACEHOLDER"); - params.put("PLACEHOLDER", groupListFileKey); - return makePostRequest(params); - } - -} diff --git a/src/test/java/teammates/test/driver/TimeHelperExtension.java b/src/test/java/teammates/test/driver/TimeHelperExtension.java deleted file mode 100644 index f0f7bb70b7d..00000000000 --- a/src/test/java/teammates/test/driver/TimeHelperExtension.java +++ /dev/null @@ -1,65 +0,0 @@ -package teammates.test.driver; - -import java.time.Duration; -import java.time.Instant; -import java.time.LocalDateTime; - -/** - * Holds additional methods for {@link teammates.common.util.TimeHelper} used only in tests. - */ -public final class TimeHelperExtension { - - private TimeHelperExtension() { - // utility class - } - - /** - * Returns one of these : 0100H, 0200H, ..., 0900H, 1000H, ... 2300H, 2359H. - * Note the last one is different from the others. - */ - public static String convertToDisplayValueInTimeDropDown(LocalDateTime date) { - int optionValue = convertToOptionValueInTimeDropDown(date); - if (optionValue == 24) { - return "2359H"; - } else if (optionValue >= 0 && optionValue < 10) { - return "0" + optionValue + "00H"; - } else if (optionValue >= 10 && optionValue < 24) { - return optionValue + "00H"; - } else { - throw new RuntimeException("Unrecognized time option: " + optionValue); - } - } - - /** - * Formats a date in the corresponding option value in 'Time' dropdowns The - * hour just after midnight is converted to option 24 (i.e., 2359 as shown - * to the user) 23.59 is also converted to 24. (i.e., 23.59-00.59 ---> 24) - */ - public static int convertToOptionValueInTimeDropDown(LocalDateTime localDateTime) { - //TODO: see if we can eliminate this method (i.e., merge with convertToDisplayValueInTimeDropDown) - int hour = localDateTime.getHour(); - if (hour == 0 || hour == 23 && localDateTime.getMinute() == 59) { - return 24; - } - return hour; - } - - /** - * Returns an java.time.Instant object that is offset by a number of minutes from now. - * @param offsetInMinutes number of minutes offset by (integer). - * @return java.time.Instant offset by offsetInMinutes minutes from now. - */ - public static Instant getInstantMinutesOffsetFromNow(long offsetInMinutes) { - return Instant.now().plus(Duration.ofMinutes(offsetInMinutes)); - } - - /** - * Returns an java.time.Instant object that is offset by a number of hours from now. - * @param offsetInHours number of hours offset by (integer). - * @return java.time.Instant offset by offsetInHours hours from now. - */ - public static Instant getInstantHoursOffsetFromNow(long offsetInHours) { - return Instant.now().plus(Duration.ofHours(offsetInHours)); - } - -} diff --git a/src/test/java/teammates/test/driver/package-info.java b/src/test/java/teammates/test/package-info.java similarity index 73% rename from src/test/java/teammates/test/driver/package-info.java rename to src/test/java/teammates/test/package-info.java index 23cec72e3f2..b443c5d831c 100644 --- a/src/test/java/teammates/test/driver/package-info.java +++ b/src/test/java/teammates/test/package-info.java @@ -1,4 +1,4 @@ /** * Contains infrastructure and helpers needed for running the component tests. */ -package teammates.test.driver; +package teammates.test; diff --git a/src/test/java/teammates/test/pageobjects/AdminAccountDetailsPage.java b/src/test/java/teammates/test/pageobjects/AdminAccountDetailsPage.java deleted file mode 100644 index 31ea9d480fd..00000000000 --- a/src/test/java/teammates/test/pageobjects/AdminAccountDetailsPage.java +++ /dev/null @@ -1,39 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertTrue; - -import org.openqa.selenium.By; - -import teammates.e2e.pageobjects.Browser; - -public class AdminAccountDetailsPage extends AppPage { - - public AdminAccountDetailsPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Instructor Account Details

    "); - } - - public AdminAccountDetailsPage clickRemoveInstructorFromCourse(String courseId) { - waitForElementPresence(By.id("instructor_" + courseId)); - click(browser.driver.findElement(By.id("instructor_" + courseId))); - waitForPageToLoad(); - return this; - } - - public AdminAccountDetailsPage clickRemoveStudentFromCourse(String courseId) { - waitForElementPresence(By.id("student_" + courseId)); - click(browser.driver.findElement(By.id("student_" + courseId))); - waitForPageToLoad(); - return this; - } - - public void verifyIsCorrectPage(String instructorId) { - assertTrue(containsExpectedPageContents()); - assertTrue(getPageSource().contains("

    " + instructorId + "

    ")); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/AdminSessionsPage.java b/src/test/java/teammates/test/pageobjects/AdminSessionsPage.java deleted file mode 100644 index fb0edb3fe08..00000000000 --- a/src/test/java/teammates/test/pageobjects/AdminSessionsPage.java +++ /dev/null @@ -1,28 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.e2e.pageobjects.Browser; - -public class AdminSessionsPage extends AppPage { - - public AdminSessionsPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("Ongoing Sessions"); - } - - public void clickDetailButton() { - click(getDetailButton()); - waitForPageToLoad(); - } - - private WebElement getDetailButton() { - return browser.driver.findElement(By.id("detailButton")); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/AppPage.java b/src/test/java/teammates/test/pageobjects/AppPage.java deleted file mode 100644 index e80db909007..00000000000 --- a/src/test/java/teammates/test/pageobjects/AppPage.java +++ /dev/null @@ -1,1619 +0,0 @@ -package teammates.test.pageobjects; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.base.Preconditions.checkState; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - -import org.openqa.selenium.By; -import org.openqa.selenium.Dimension; -import org.openqa.selenium.InvalidElementStateException; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.Keys; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.TimeoutException; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebDriverException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.remote.RemoteWebElement; -import org.openqa.selenium.remote.UselessFileDetector; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.PageFactory; -import org.openqa.selenium.support.ui.ExpectedCondition; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.Select; -import org.openqa.selenium.support.ui.WebDriverWait; - -import com.google.common.collect.ObjectArrays; - -import teammates.common.util.Const; -import teammates.common.util.ThreadHelper; -import teammates.common.util.Url; -import teammates.common.util.retry.MaximumRetriesExceededException; -import teammates.common.util.retry.RetryManager; -import teammates.common.util.retry.RetryableTask; -import teammates.e2e.pageobjects.Browser; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.AssertHelper; - -/** - * An abstract class that represents a browser-loaded page of the app and - * provides ways to interact with it. Also contains methods to validate some - * aspects of the page. .e.g, html page source.
    - * - *

    Note: We are using the PageObjects pattern here. - * - * @see https://code.google.com/p/selenium/wiki/PageObjects - */ -public abstract class AppPage { - - /** Browser instance the page is loaded into. */ - protected Browser browser; - - /** Use for retrying due to persistence delays. */ - protected RetryManager persistenceRetryManager = new RetryManager(TestProperties.PERSISTENCE_RETRY_PERIOD_IN_S / 2); - - /** Use for retrying due to transient UI issues. */ - protected RetryManager uiRetryManager = new RetryManager((TestProperties.TEST_TIMEOUT + 1) / 2); - - /** Firefox change handler for handling when `change` events are not fired in Firefox. */ - private final FirefoxChangeHandler firefoxChangeHandler; - - /** Handler for tracking the state of a JQuery AJAX request. */ - private final JQueryAjaxHandler jQueryAjaxHandler; - - // These are elements common to most pages in our app - @FindBy(id = "statusMessagesToUser") - private WebElement statusMessage; - - @FindBy(xpath = "//*[@id=\"contentLinks\"]/ul[1]/li[1]/a") - private WebElement instructorHomeTab; - - @FindBy(xpath = "//*[@id=\"contentLinks\"]/ul[1]/li[2]/a") - private WebElement instructorCoursesTab; - - @FindBy(xpath = "//*[@id=\"contentLinks\"]/ul[1]/li[4]/a") - private WebElement instructorStudentsTab; - - @FindBy(xpath = "//*[@id=\"contentLinks\"]/ul[1]/li[6]/a") - private WebElement instructorHelpTab; - - @FindBy(id = "studentHomeNavLink") - private WebElement studentHomeTab; - - @FindBy(id = "studentProfileNavLink") - private WebElement studentProfileTab; - - @FindBy(id = "btnLogout") - private WebElement logoutButton; - - @FindBy(xpath = "(//*[@class=\"htCore\"]/tbody/tr/td[@class =\"enroll-handsontable\"])[1]") - private WebElement enrollSpreadsheetFirstCell; - - /** - * Used by subclasses to create a {@code AppPage} object to wrap around the - * given {@code browser} object. Fails if the page content does not match - * the page type, as defined by the sub-class. - */ - public AppPage(Browser browser) { - this.browser = browser; - this.firefoxChangeHandler = new FirefoxChangeHandler(); - jQueryAjaxHandler = new JQueryAjaxHandler(); - - boolean isCorrectPageType = containsExpectedPageContents(); - - if (isCorrectPageType) { - return; - } - - // To minimize test failures due to eventual consistency, we try to - // reload the page and compare once more. - System.out.println("#### Incorrect page type: going to try reloading the page."); - - ThreadHelper.waitFor(2000); - - this.reloadPage(); - isCorrectPageType = containsExpectedPageContents(); - - if (isCorrectPageType) { - return; - } - - System.out.println("######### Not in the correct page! ##########"); - throw new IllegalStateException("Not in the correct page!"); - } - - /** - * Fails if the new page content does not match content expected in a page of - * the type indicated by the parameter {@code typeOfPage}. - */ - public static T getNewPageInstance(Browser currentBrowser, Url url, Class typeOfPage) { - currentBrowser.driver.get(url.toAbsoluteString()); - return getNewPageInstance(currentBrowser, typeOfPage); - } - - /** - * Fails if the new page content does not match content expected in a page of - * the type indicated by the parameter {@code typeOfPage}. - */ - public static T getNewPageInstance(Browser currentBrowser, Class typeOfPage) { - try { - Constructor constructor = typeOfPage.getConstructor(Browser.class); - T page = constructor.newInstance(currentBrowser); - PageFactory.initElements(currentBrowser.driver, page); - return page; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Gives an AppPage instance based on the given Browser. - */ - public static AppPage getNewPageInstance(Browser currentBrowser) { - return getNewPageInstance(currentBrowser, GenericAppPage.class); - } - - JQueryAjaxHandler getjQueryAjaxHandler() { - return jQueryAjaxHandler; - } - - /** - * Simply loads the given URL. - */ - public AppPage navigateTo(Url url) { - browser.driver.get(url.toAbsoluteString()); - return this; - } - - /** - * Fails if the new page content does not match content expected in a page of - * the type indicated by the parameter {@code newPageType}. - */ - public T changePageType(Class newPageType) { - return getNewPageInstance(browser, newPageType); - } - - /** - * Gives a {@link LoginPage} instance based on the given {@link Browser} and test configuration. - * Fails if the page content does not match the content of the expected login page. - */ - public static LoginPage createCorrectLoginPageType(Browser browser) { - Class cls = - TestProperties.isDevServer() ? DevServerLoginPage.class : GoogleLoginPage.class; - return getNewPageInstance(browser, cls); - } - - /** - * Checks whether the URL currently loaded in the browser corresponds to the given page {@code uri}. - */ - public boolean isPageUri(String uri) { - Url currentPageUrl; - try { - currentPageUrl = new Url(browser.driver.getCurrentUrl()); - } catch (AssertionError e) { // due to MalformedURLException - return false; - } - return currentPageUrl.getRelativeUrl().equals(uri); - } - - public E waitFor(ExpectedCondition expectedCondition) { - WebDriverWait wait = new WebDriverWait(browser.driver, TestProperties.TEST_TIMEOUT); - return wait.until(expectedCondition); - } - - /** - * Waits until the page is fully loaded. - */ - public void waitForPageToLoad() { - waitFor(driver -> { - // Check https://developer.mozilla.org/en/docs/web/api/document/readystate - // to understand more on a web document's readyState - JavascriptExecutor javascriptExecutor = (JavascriptExecutor) checkNotNull(driver); - return "complete".equals(javascriptExecutor.executeScript("return document.readyState")); - }); - } - - /** - * Waits until TinyMCE editor is fully loaded. - */ - public void waitForRichTextEditorToLoad(String id) { - waitFor(driver -> { - String script = "return tinymce.get('" + id + "') !== null"; - JavascriptExecutor javascriptExecutor = (JavascriptExecutor) checkNotNull(driver); - return (Boolean) javascriptExecutor.executeScript(script); - }); - } - - /** - * Waits until the element is not covered by any other element. - */ - public void waitForElementNotCovered(WebElement element) { - waitFor(d -> !isElementCovered(element)); - } - - public void waitForElementVisibility(WebElement element) { - waitFor(ExpectedConditions.visibilityOf(element)); - } - - public void waitForElementVisibility(By by) { - waitFor(ExpectedConditions.visibilityOfElementLocated(by)); - } - - public void waitForElementToBeClickable(WebElement element) { - waitFor(ExpectedConditions.elementToBeClickable(element)); - } - - public void waitForElementsVisibility(List elements) { - waitFor(ExpectedConditions.visibilityOfAllElements(elements)); - } - - /** - * {@code locator} is mapped to an actual {@link WebElement}. - * @param locator used to find the element - * @see AppPage#waitForElementStaleness(WebElement) - */ - public void waitForElementStaleness(By locator) { - waitForElementStaleness(browser.driver.findElement(locator)); - } - - /** - * Waits until an element is no longer attached to the DOM or the timeout expires. - * @param element the WebElement - * @throws org.openqa.selenium.TimeoutException if the timeout defined in - * {@link TestProperties#TEST_TIMEOUT} expires - * @see org.openqa.selenium.support.ui.FluentWait#until(java.util.function.Function) - */ - public void waitForElementStaleness(WebElement element) { - waitFor(ExpectedConditions.stalenessOf(element)); - } - - /** - * Waits until an element belongs to the class or the timeout expires. - * @param element the WebElement - * @param elementClass the class that the element must belong to - * @throws org.openqa.selenium.TimeoutException if the timeout defined in - * {@link TestProperties#TEST_TIMEOUT} expires - * @see org.openqa.selenium.support.ui.FluentWait#until(java.util.function.Function) - */ - void waitForElementToBeMemberOfClass(WebElement element, String elementClass) { - waitFor(driver -> { - String classAttribute = element.getAttribute("class"); - List classes = Arrays.asList(classAttribute.split(" ")); - - return classes.contains(elementClass); - }); - } - - /** - * Waits for element to be invisible or not present, or timeout. - */ - public void waitForElementToDisappear(By by) { - waitFor(ExpectedConditions.invisibilityOfElementLocated(by)); - } - - /** - * Waits for a list of elements to be invisible or not present, or timeout. - */ - public void waitForElementsToDisappear(List elements) { - waitFor(ExpectedConditions.invisibilityOfAllElements(elements)); - } - - /** - * Waits until scrolling on the page is complete. Note: The detection of whether the page is scrolling is coupled to our - * own implementation of scrolling {@code (scrollTo.js)} and is not a true detection. - * @throws org.openqa.selenium.TimeoutException if the timeout defined in {@link TestProperties#TEST_TIMEOUT} expires - */ - void waitForScrollingToComplete() { - // Note: The implementation compares previous and current scroll positions so the polling interval should not be - // changed or set to too low a value or the comparisons may unexpectedly be equal. - waitFor(new ExpectedCondition() { - private static final String SCROLL_POSITION_PROPERTY = "scrollTop"; - - private boolean isFirstEvaluation = true; - - private final WebElement htmlElement = browser.driver.findElement(By.tagName("html")); - private final WebElement bodyElement = browser.driver.findElement(By.tagName("body")); - - private String prevHtmlScrollPosition; - private String prevBodyScrollPosition; - - private boolean isPreviouslyEqual; - - @Override - public Boolean apply(WebDriver input) { - // The first evaluation has no previous scrolling positions to compare to - if (isFirstEvaluation) { - prevHtmlScrollPosition = htmlElement.getAttribute(SCROLL_POSITION_PROPERTY); - prevBodyScrollPosition = bodyElement.getAttribute(SCROLL_POSITION_PROPERTY); - - isFirstEvaluation = false; - return false; - } - - return isCurrentScrollingPositionSameAsPrevious(); - } - - private Boolean isCurrentScrollingPositionSameAsPrevious() { - String currentHtmlScrollPosition = htmlElement.getAttribute(SCROLL_POSITION_PROPERTY); - String currentBodyScrollPosition = bodyElement.getAttribute(SCROLL_POSITION_PROPERTY); - - if (currentHtmlScrollPosition.equals(prevHtmlScrollPosition) - && currentBodyScrollPosition.equals(prevBodyScrollPosition)) { - // Because we are not truly detecting if the page has stopped scrolling, - // we make sure the scroll positions is the same for one more iteration - if (isPreviouslyEqual) { - return true; - } else { - isPreviouslyEqual = true; - return false; - } - } - - prevHtmlScrollPosition = currentHtmlScrollPosition; - prevBodyScrollPosition = currentBodyScrollPosition; - - return false; - } - }); - } - - /** - * Waits for an alert modal to appear and dismisses it. - */ - public void waitForAndDismissAlertModal() { - waitForConfirmationModalAndClickOk(); - } - - /** - * Waits for a confirmation modal to appear and click the confirm button. - */ - public void waitForConfirmationModalAndClickOk() { - waitForModalShown(); - WebElement okayButton = browser.driver.findElement(By.className("modal-btn-ok")); - waitForElementToBeClickable(okayButton); - clickDismissModalButtonAndWaitForModalHidden(okayButton); - } - - /** - * Waits for a confirmation modal to appear and click the No button. - */ - public void clickNoOnModal() { - waitForModalShown(); - WebElement noButton = browser.driver.findElement(By.cssSelector("[data-bb-handler='no']")); - waitForElementToBeClickable(noButton); - clickDismissModalButtonAndWaitForModalHidden(noButton); - } - - public void cancelModalForm(WebElement modal) { - clickDismissModalButtonAndWaitForModalHidden(modal.findElement(By.tagName("button"))); - } - - public void checkCheckboxesInForm(WebElement form, String elementsName) { - List formElements = form.findElements(By.name(elementsName)); - for (WebElement e : formElements) { - markCheckBoxAsChecked(e); - } - } - - /** - * Waits for a confirmation modal to appear and click the cancel button. - */ - public void waitForConfirmationModalAndClickCancel() { - waitForModalShown(); - WebElement cancelButton = browser.driver.findElement(By.className("modal-btn-cancel")); - waitForElementToBeClickable(cancelButton); - clickDismissModalButtonAndWaitForModalHidden(cancelButton); - } - - private void waitForModalShown() { - // Possible exploration: Change to listening to modal shown event as - // this is based on the implementation detail assumption that once modal-backdrop is added the modal is shown - waitForElementVisibility(By.className("modal-backdrop")); - } - - void waitForModalHidden(WebElement modalBackdrop) { - // Possible exploration: Change to listening to modal hidden event as - // this is based on the implementation detail assumption that once modal-backdrop is removed the modal is hidden - waitForElementStaleness(modalBackdrop); - } - - /** - * Waits for the element to appear in the page, up to the timeout specified. - */ - public WebElement waitForElementPresence(By by) { - return waitFor(ExpectedConditions.presenceOfElementLocated(by)); - } - - /** - * Waits for text contained in the element to appear in the page, or timeout. - */ - public void waitForTextContainedInElementPresence(By by, String text) { - waitFor(ExpectedConditions.textToBePresentInElementLocated(by, text)); - } - - /** - * Waits for text contained in the element to disappear from the page, or timeout. - */ - public void waitForTextContainedInElementAbsence(By by, String text) { - waitFor(ExpectedConditions.not(ExpectedConditions.textToBePresentInElementLocated(by, text))); - } - - /** - * Switches to the new browser window just opened. - */ - protected void switchToNewWindow() { - browser.switchToNewWindow(); - } - - public void closeCurrentWindowAndSwitchToParentWindow() { - browser.closeCurrentWindowAndSwitchToParentWindow(); - } - - public void reloadPage() { - browser.driver.get(browser.driver.getCurrentUrl()); - waitForPageToLoad(); - } - - protected Object executeScript(String script, Object... args) { - JavascriptExecutor javascriptExecutor = (JavascriptExecutor) browser.driver; - return javascriptExecutor.executeScript(script, args); - } - - /** - * Equivalent to pressing the 'back' button of the browser.
    - * Fails if the page content does not match content expected in a page of - * the type indicated by the parameter {@code typeOfPreviousPage}. - */ - public T goToPreviousPage(Class typeOfPreviousPage) { - browser.driver.navigate().back(); - waitForPageToLoad(); - return changePageType(typeOfPreviousPage); - } - - /** - * Equivalent to clicking the 'Courses' tab on the top menu of the page. - * @return the loaded page. - */ - public InstructorCoursesPage loadCoursesTab() { - click(instructorCoursesTab); - waitForPageToLoad(); - return changePageType(InstructorCoursesPage.class); - } - - /** - * Equivalent to clicking the 'Students' tab on the top menu of the page. - * @return the loaded page. - */ - public InstructorStudentListPage loadStudentsTab() { - click(instructorStudentsTab); - waitForPageToLoad(); - return changePageType(InstructorStudentListPage.class); - } - - /** - * Equivalent to clicking the 'Home' tab on the top menu of the page. - * @return the loaded page. - */ - public InstructorHomePage loadInstructorHomeTab() { - click(instructorHomeTab); - waitForPageToLoad(); - return changePageType(InstructorHomePage.class); - } - - /** - * Equivalent to clicking the 'Help' tab on the top menu of the page. - * @return the loaded page. - */ - public InstructorHelpPage loadInstructorHelpTab() { - click(instructorHelpTab); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorHelpPage.class); - } - - /** - * Equivalent of clicking the 'Profile' tab on the top menu of the page. - * @return the loaded page - */ - public StudentProfilePage loadProfileTab() { - click(studentProfileTab); - waitForPageToLoad(); - return changePageType(StudentProfilePage.class); - } - - /** - * Equivalent of student clicking the 'Home' tab on the top menu of the page. - * @return the loaded page - */ - public StudentHomePage loadStudentHomeTab() { - click(studentHomeTab); - waitForPageToLoad(); - return changePageType(StudentHomePage.class); - } - - /** - * Click the 'logout' link in the top menu of the page. - */ - public AppPage logout() { - click(logoutButton); - waitForPageToLoad(); - return this; - } - - /** - * Returns the HTML source of the currently loaded page. - */ - public String getPageSource() { - return browser.driver.getPageSource(); - } - - public void click(By by) { - WebElement element = browser.driver.findElement(by); - click(element); - } - - protected void click(WebElement element) { - executeScript("arguments[0].click();", element); - } - - /** - * Simulates the clearing and sending of keys to an element. - * - *

    Note: This method is not the same as using {@link WebElement#clear} followed by {@link WebElement#sendKeys}. - * It avoids double firing of the {@code change} event which may occur when {@link WebElement#clear} is followed by - * {@link WebElement#sendKeys}. - * - * @see AppPage#clearWithoutEvents(WebElement) - */ - private void clearAndSendKeys(WebElement element, CharSequence... keysToSend) { - Map result = clearWithoutEvents(element); - @SuppressWarnings("unchecked") - Map errors = (Map) result.get("errors"); - if (errors != null) { - throw new InvalidElementStateException(errors.get("detail")); - } - - element.sendKeys(keysToSend); - } - - /** - * Clears any kind of editable element, but without firing the {@code change} event (unlike {@link WebElement#clear()}). - * Avoid using this method if {@link WebElement#clear()} meets the requirements as this method depends on implementation - * details. - */ - private Map clearWithoutEvents(WebElement element) { - // This method is a close mirror of HtmlUnitWebElement#clear(), except that events are not handled. Note that - // HtmlUnitWebElement is mirrored as opposed to RemoteWebElement (which is used with actual browsers) for convenience - // and the implementation can differ. - checkNotNull(element); - - // Adapted from ExpectedConditions#stalenessOf which forces a staleness check. This allows a meaningful - // StaleElementReferenceException to be thrown rather than just getting a boolean from ExpectedConditions. - element.isEnabled(); - - // Fail safe in case the implementation of staleness checks is changed - if (isExpectedCondition(ExpectedConditions.stalenessOf(element))) { - throw new AssertionError( - "Element is stale but should have been caught earlier by element.isEnabled()."); - } - - @SuppressWarnings("unchecked") - Map result = (Map) executeScript( - "const element = arguments[0];" - + "if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {" - + " if (element.readOnly) {" - + " return { " - + " errors: {" - + " detail: 'You may only edit editable elements'" - + " }" - + " };" - + " }" - + " if (element.disabled) {" - + " return { " - + " errors: {" - + " detail: 'You may only interact with enabled elements'" - + " }" - + " };" - + " }" - + " element.value='';" - + "} else if (element.isContentEditable) {" - + " while (element.firstChild) {" - + " element.removeChild(element.firstChild);" - + " }" - + "}" - + "return { " - + " data: {" - + " detail: 'Success'" - + " }" - + "};", element); - return result; - } - - public String getElementAttribute(By locator, String attrName) { - return browser.driver.findElement(locator).getAttribute(attrName); - } - - protected void fillSpreadsheet(String value) { - try { - scrollElementToFirstCellAndSendKeys(enrollSpreadsheetFirstCell, value); - } catch (WebDriverException e) { - System.out.println("Unexpectedly not able to click on the spreadsheet element because of: "); - System.out.println(e); - } - } - - protected void fillTextBox(WebElement textBoxElement, String value) { - try { - scrollElementToCenterAndClick(textBoxElement); - } catch (WebDriverException e) { - // It is important that a text box element is clickable before we fill it but due to legacy reasons we continue - // attempting to fill the text box element even if it's not clickable (which may lead to an unexpected failure - // later on) - System.out.println("Unexpectedly not able to click on the text box element because of: "); - System.out.println(e); - } - - // If the intended value is empty `clear` works well enough for us - if (value.isEmpty()) { - textBoxElement.clear(); - return; - } - - // Otherwise we need to do special handling of entering input because `clear` and `sendKeys` work differently. - // See documentation for `clearAndSendKeys` for more details. - clearAndSendKeys(textBoxElement, value); - - // Add event hook before blurring the text box element so we can detect the event. - firefoxChangeHandler.addChangeEventHook(textBoxElement); - - textBoxElement.sendKeys(Keys.TAB); // blur the element to receive events - - // Although events should not be manually fired, the `change` event does not fire when text input is changed if - // Firefox is not in focus. Setting profile option `focusmanager.testmode = true` does not help as well. - // A temporary solution is to fire the `change` event until the buggy behavior is fixed. - // More details can be found in the umbrella issue of related bugs in the following link: - // https://github.com/mozilla/geckodriver/issues/906 - // The firing of `change` event is also imperfect because no check for the type of the elements is done before firing - // the event, for instance a `change` event will be wrongly fired on any content editable element. The firing time of - // `change` events is also incorrect for several `input` types such as `checkbox` and `date`. - // See: https://developer.mozilla.org/en-US/docs/Web/Events/change - firefoxChangeHandler.fireChangeEventIfNotFired(textBoxElement); - } - - protected void fillRichTextEditor(String id, String content) { - String preparedContent = content.replace("\n", "
    "); - - clearAndSetNewValueForTinyMce(id, preparedContent); - } - - /** - * Simulates the clearing and setting of value for a TinyMCE Editor. This method is a legacy helper for filling rich text - * editors and should not be used unless necessary. - */ - private void clearAndSetNewValueForTinyMce(String id, String preparedContent) { - executeScript( - // clear content programmatically; one implication is that an undo level is not added to the TinyMCE editor - "tinyMCE.get(arguments[0]).setContent('');" - // insert like a user does (one implication is that an undo level is added); - // this may result in some events (e.g. `Change`) firing immediately - + "tinyMCE.get(arguments[0]).insertContent(arguments[1]);" - + "tinyMCE.get(arguments[0]).focus();", // for consistent HTML verification across browsers - id, preparedContent); - } - - protected String getRichTextEditorContent(String id) { - return (String) executeScript(" if (typeof tinyMCE !== 'undefined') {" - + " return tinyMCE.get('" + id + "').getContent();" - + "}"); - } - - protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) { - if (fileName.isEmpty()) { - fileBoxElement.clear(); - } else { - fileBoxElement.setFileDetector(new UselessFileDetector()); - String newFilePath = new File(fileName).getAbsolutePath(); - fileBoxElement.sendKeys(newFilePath); - } - } - - protected String getTextBoxValue(WebElement textBox) { - return textBox.getAttribute("value"); - } - - protected boolean checkEmptyTextBoxValue(WebElement textBox) { - String textInsideInputBox = textBox.getAttribute("value"); - return textInsideInputBox.isEmpty(); - } - - /** - * 'check' the check box, if it is not already 'checked'. - * No action taken if it is already 'checked'. - */ - protected void markCheckBoxAsChecked(WebElement checkBox) { - waitForElementVisibility(checkBox); - if (!checkBox.isSelected()) { - click(checkBox); - } - } - - /** - * 'uncheck' the check box, if it is already 'checked'. - * No action taken if it is not already 'checked'. - */ - protected void markCheckBoxAsUnchecked(WebElement checkBox) { - if (checkBox.isSelected()) { - click(checkBox); - } - } - - /** - * 'check' the radio button, if it is not already 'checked'. - * No action taken if it is already 'checked'. - */ - protected void markRadioButtonAsChecked(WebElement radioButton) { - waitForElementVisibility(radioButton); - if (!radioButton.isSelected()) { - click(radioButton); - } - } - - /** - * Selects the option by visible text and returns whether the dropdown value has changed. - * - * @throws AssertionError if the selected option is not the one we wanted to select - * - * @see Select#selectByVisibleText(String) - */ - boolean selectDropdownByVisibleValue(WebElement element, String text) { - Select select = new Select(element); - - WebElement originalSelectedOption = select.getFirstSelectedOption(); - - select.selectByVisibleText(text); - - WebElement newSelectedOption = select.getFirstSelectedOption(); - - assertEquals(text, newSelectedOption.getText().trim()); - - return !newSelectedOption.equals(originalSelectedOption); - } - - /** - * Waits for all ongoing AJAX requests to complete if any before selecting the option by visible text, then - * waits for the associated AJAX request to complete. - * - * @see AppPage#selectDropdownByVisibleValue(WebElement, String) - */ - void selectDropdownByVisibleValueAndHandleAjaxRequests(WebElement element, String text) { - jQueryAjaxHandler.waitForAjaxIfPresentThenRegisterHandlers(); - - if (selectDropdownByVisibleValue(element, text)) { - jQueryAjaxHandler.waitForRequestComplete(); - } else { - // No AJAX request will be made if the value did not change - jQueryAjaxHandler.unregisterHandlers(); - } - } - - /** - * Selects the option by value and returns whether the dropdown value has changed. - * - * @throws AssertionError if the selected option is not the one we wanted to select - * - * @see Select#selectByValue(String) - */ - boolean selectDropdownByActualValue(WebElement element, String value) { - Select select = new Select(element); - - WebElement originalSelectedOption = select.getFirstSelectedOption(); - - select.selectByValue(value); - - WebElement newSelectedOption = select.getFirstSelectedOption(); - - assertEquals(value, newSelectedOption.getAttribute("value")); - - return !newSelectedOption.equals(originalSelectedOption); - } - - /** - * Waits for all ongoing AJAX requests to complete if any before selecting the option by actual value, then - * waits for the associated AJAX request to complete. - * - * @see AppPage#selectDropdownByActualValue(WebElement, String) - */ - void selectDropdownByActualValueAndHandleAjaxRequests(WebElement element, String value) { - jQueryAjaxHandler.waitForAjaxIfPresentThenRegisterHandlers(); - - if (selectDropdownByActualValue(element, value)) { - jQueryAjaxHandler.waitForRequestComplete(); - } else { - // No AJAX request will be made if the value did not change - jQueryAjaxHandler.unregisterHandlers(); - } - } - - public String getDropdownSelectedValue(WebElement element) { - Select select = new Select(element); - return select.getFirstSelectedOption().getAttribute("value"); - } - - /** - * Returns a list containing the texts of the user status messages in the page. - * @see WebElement#getText() - */ - public List getTextsForAllStatusMessagesToUser() { - List statusMessagesToUser = statusMessage.findElements(By.tagName("div")); - List statusMessageTexts = new ArrayList<>(); - for (WebElement statusMessage : statusMessagesToUser) { - statusMessageTexts.add(statusMessage.getText()); - } - return statusMessageTexts; - } - - /** - * Returns the value of the cell located at {@code (row, column)} - * from the nth(0-index-based) table (which is of type {@code class=table}) in the page. - */ - public String getCellValueFromDataTable(int tableNum, int row, int column) { - WebElement tableElement = browser.driver.findElements(By.className("table")).get(tableNum); - WebElement trElement = tableElement.findElements(By.tagName("tr")).get(row); - WebElement tdElement = trElement.findElements(By.tagName("td")).get(column); - return tdElement.getText(); - } - - /** - * Returns the value of the header located at {@code (row, column)} - * from the nth(0-index-based) table (which is of type {@code class=table}) in the page. - */ - public String getHeaderValueFromDataTable(int tableNum, int row, int column) { - WebElement tableElement = browser.driver.findElements(By.className("table")).get(tableNum); - WebElement trElement = tableElement.findElements(By.tagName("tr")).get(row); - WebElement tdElement = trElement.findElements(By.tagName("th")).get(column); - return tdElement.getText(); - } - - /** - * Returns the number of rows from the nth(0-index-based) table - * (which is of type {@code class=table}) in the page. - */ - public int getNumberOfRowsFromDataTable(int tableNum) { - WebElement tableElement = browser.driver.findElements(By.className("table")).get(tableNum); - return tableElement.findElements(By.tagName("tr")).size(); - } - - /** - * Returns the number of columns from the header in the table - * (which is of type {@code class=table}) in the page. - */ - public int getNumberOfColumnsFromDataTable(int tableNum) { - WebElement tableElement = browser.driver.findElements(By.className("table")).get(tableNum); - WebElement trElement = tableElement.findElement(By.tagName("tr")); - return trElement.findElements(By.tagName("th")).size(); - } - - /** - * Returns the id of the table - * (which is of type {@code class=table}) in the page. - */ - public String getDataTableId(int tableNum) { - WebElement tableElement = browser.driver.findElements(By.className("table")).get(tableNum); - return tableElement.getAttribute("id"); - } - - public void clickElementById(String elementId) { - WebElement element = browser.driver.findElement(By.id(elementId)); - click(element); - } - - /** - * Clicks the element and clicks 'Yes' in the follow up dialog box. - * Fails if there is no dialog box. - * @return the resulting page. - */ - public AppPage clickAndConfirm(WebElement elementToClick) { - click(elementToClick); - waitForConfirmationModalAndClickOk(); - waitForPageToLoad(); - return this; - } - - /** - * Clicks the element and clicks 'Yes' in the follow up dialog box and will not wait for modal to disappear - * Fails if there is no dialog box. - */ - public void clickAndConfirmWithoutWaitingForModalDisappearance(WebElement elementToClick) { - click(elementToClick); - waitForModalShown(); - WebElement okayButton = browser.driver.findElement(By.className("modal-btn-ok")); - waitForElementToBeClickable(okayButton); - click(okayButton); - } - - /** - * Clicks the element and clicks 'No' in the follow up dialog box. - * Fails if there is no dialog box. - */ - public void clickAndCancel(WebElement elementToClick) { - click(elementToClick); - waitForConfirmationModalAndClickCancel(); - waitForPageToLoad(); - } - - /** - * Returns True if the page contains some basic elements expected in a page of the - * specific type. e.g., the top heading. - */ - protected abstract boolean containsExpectedPageContents(); - - /** - * Returns True if there is a corresponding element for the given locator. - */ - public boolean isElementPresent(By by) { - return browser.driver.findElements(by).size() != 0; - } - - /** - * Returns True if there is a corresponding element for the given id or name. - */ - public boolean isElementPresent(String elementId) { - try { - browser.driver.findElement(By.id(elementId)); - return true; - } catch (NoSuchElementException e) { - return false; - } - } - - public boolean isElementVisible(String elementId) { - try { - return browser.driver.findElement(By.id(elementId)).isDisplayed(); - } catch (NoSuchElementException e) { - return false; - } - } - - public boolean isElementVisible(By by) { - try { - return browser.driver.findElement(by).isDisplayed(); - } catch (NoSuchElementException e) { - return false; - } - } - - /** - * Returns true if the expected condition is evaluated to true immediately. - * @see ExpectedConditions - */ - private boolean isExpectedCondition(ExpectedCondition expectedCondition) { - Object value = expectedCondition.apply(browser.driver); - if (value == null) { - return false; - } - - if (value.getClass() == Boolean.class) { - return (boolean) value; - } else { - return true; - } - } - - /** - * Returns true if the element is invisible or stale as defined in the WebDriver specification. - * @param locator used to find the element - */ - public boolean isElementInvisibleOrStale(By locator) { - return isExpectedCondition(ExpectedConditions.invisibilityOfElementLocated(locator)); - } - - /** - * Returns true if there exists an element with the given id and class name. - * - * @param elementId - * Id of the element - * @param targetClass - * className - */ - public boolean isElementHasClass(String elementId, String targetClass) { - List elementsMatched = - browser.driver.findElements(By.cssSelector("#" + elementId + "." + targetClass)); - return !elementsMatched.isEmpty(); - } - - public boolean isNamedElementVisible(String elementName) { - try { - return browser.driver.findElement(By.name(elementName)).isDisplayed(); - } catch (NoSuchElementException e) { - return false; - } - } - - public boolean isElementEnabled(String elementId) { - try { - return browser.driver.findElement(By.id(elementId)).isEnabled(); - } catch (NoSuchElementException e) { - return false; - } - } - - public boolean isNamedElementEnabled(String elementName) { - try { - return browser.driver.findElement(By.name(elementName)).isEnabled(); - } catch (NoSuchElementException e) { - return false; - } - } - - public boolean isElementSelected(String elementId) { - try { - return browser.driver.findElement(By.id(elementId)).isSelected(); - } catch (NoSuchElementException e) { - return false; - } - } - - /** - * Checks if the midpoint of an element is covered by any other element. - * @return true if element is covered, false otherwise. - */ - public boolean isElementCovered(WebElement element) { - int x = element.getLocation().x + element.getSize().width / 2; - int y = element.getLocation().y + element.getSize().height / 2; - WebElement topElem = (WebElement) executeScript("return document.elementFromPoint(" + x + "," + y + ");"); - return !topElem.equals(element); - } - - public void verifyUnclickable(WebElement element) { - if (element.getTagName().equals("a")) { - assertTrue(element.getAttribute("class").contains("disabled")); - } else { - assertNotNull(element.getAttribute("disabled")); - } - } - - /** - * Compares selected column's rows with patternString to check the order of rows. - * This can be useful in checking if the table is sorted in a particular order. - * Separate rows using {*} - * e.g., {@code "value 1{*}value 2{*}value 3" } - * The header row will be ignored - */ - public void verifyTablePattern(int column, String patternString) { - verifyTablePattern(0, column, patternString); - } - - /** - * Compares selected column's rows with patternString to check the order of rows. - * This can be useful in checking if the table is sorted in a particular order. - * Separate rows using {*} - * e.g., {@code "value 1{*}value 2{*}value 3" } - * The header row will be ignored - */ - public void verifyTablePattern(int tableNum, int column, String patternString) { - String[] splitString = patternString.split(Pattern.quote("{*}")); - int expectedNumberOfRowsInTable = splitString.length + 1; - assertEquals(expectedNumberOfRowsInTable, getNumberOfRowsFromDataTable(tableNum)); - for (int row = 1; row < splitString.length; row++) { - String tableCellString = this.getCellValueFromDataTable(tableNum, row, column); - assertEquals(splitString[row - 1], tableCellString); - } - } - - /** - * Verifies that the currently loaded page has the same HTML content as - * the content given in the file at {@code filePath}.
    - * The HTML is checked for logical equivalence, not text equivalence. - * @param filePath - * If this starts with "/" (e.g., "/expected.html"), the - * folder is assumed to be {@link TestProperties#TEST_PAGES_FOLDER}. - * @return The page (for chaining method calls). - */ - @Deprecated - public AppPage verifyHtml(String filePath) throws IOException { - return verifyHtmlPart(null, filePath); - } - - /** - * Verifies that element specified in currently loaded page has the same HTML content as - * the content given in the file at {@code filePath}.
    - * The HTML is checked for logical equivalence, not text equivalence. - * @param filePathParam - * If this starts with "/" (e.g., "/expected.html"), the - * folder is assumed to be {@link TestProperties#TEST_PAGES_FOLDER}. - * @return The page (for chaining method calls). - */ - @Deprecated - public AppPage verifyHtmlPart(By by, String filePathParam) throws IOException { - return this; - } - - /** - * Verifies that main content specified id "mainContent" in currently - * loaded page has the same HTML content as - * the content given in the file at {@code filePath}.
    - * The HTML is checked for logical equivalence, not text equivalence. - * @param filePath - * If this starts with "/" (e.g., "/expected.html"), the - * folder is assumed to be {@link TestProperties#TEST_PAGES_FOLDER}. - * @return The page (for chaining method calls). - */ - @Deprecated - public AppPage verifyHtmlMainContent(String filePath) throws IOException { - return verifyHtmlPart(By.id("mainContent"), filePath); - } - - /** - * Verifies that the title of the loaded page is the same as {@code expectedTitle}. - */ - public void verifyTitle(String expectedTitle) { - assertEquals(expectedTitle, browser.driver.getTitle()); - } - - /** - * Also supports the expression "{*}" which will match any text. - * e.g. "team 1{*}team 2" will match "team 1 xyz team 2" - */ - public AppPage verifyContains(String searchString) { - AssertHelper.assertContainsRegex(searchString, getPageSource()); - return this; - } - - public void verifyContainsElement(By childBy) { - assertFalse(browser.driver.findElements(childBy).isEmpty()); - } - - public void verifyElementContainsElement(WebElement parentElement, By childBy) { - assertFalse(parentElement.findElements(childBy).isEmpty()); - } - - public void verifyElementDoesNotContainElement(WebElement parentElement, By childBy) { - assertTrue(parentElement.findElements(childBy).isEmpty()); - } - - /** - * Waits and verifies that the texts of user status messages in the page are equal to the expected texts. - * The check is done multiple times with waiting times in between to account for - * timing issues due to page load, inconsistencies in Selenium API, etc. - */ - public void waitForTextsForAllStatusMessagesToUserEquals(String firstExpectedText, String... remainingExpectedTexts) { - List expectedTexts = Arrays.asList(ObjectArrays.concat(firstExpectedText, remainingExpectedTexts)); - try { - uiRetryManager.runUntilNoRecognizedException(new RetryableTask("Verify status to user") { - @Override - public void run() { - // Scroll to status message because it must be visible in order to get its text - new Actions(browser.driver).moveToElement(statusMessage).perform(); - waitForElementVisibility(statusMessage); - - assertEquals(expectedTexts, getTextsForAllStatusMessagesToUser()); - } - }, WebDriverException.class, AssertionError.class); - } catch (MaximumRetriesExceededException e) { - assertEquals(expectedTexts, getTextsForAllStatusMessagesToUser()); - } - } - - /** - * As of now, this simply verifies that the link is not broken. It does - * not verify whether the file content is as expected. To be improved. - */ - public void verifyDownloadLink(Url url) { - //TODO: implement a better way to download a file and check content - // (may be using HtmlUnit as the Webdriver?) - String beforeReportDownloadUrl = browser.driver.getCurrentUrl(); - browser.driver.get(url.toAbsoluteString()); - String afterReportDownloadUrl = browser.driver.getCurrentUrl(); - assertEquals(beforeReportDownloadUrl, afterReportDownloadUrl); - } - - public void verifyFieldValue(String fieldId, String expectedValue) { - assertEquals(expectedValue, - browser.driver.findElement(By.id(fieldId)).getAttribute("value")); - } - - /** - * Verifies that the page source does not contain the given searchString. - * - * @param searchString the substring that we want to omit from the page source - * @return the AppPage - */ - public AppPage verifyNotContain(String searchString) { - String pageSource = getPageSource(); - assertFalse(pageSource.contains(searchString)); - return this; - } - - public void waitForAjaxLoaderGifToDisappear() { - try { - waitForElementToDisappear(By.xpath("//img[@src='/images/ajax-loader.gif' or @src='/images/ajax-preload.gif']")); - } catch (NoSuchElementException alreadydisappears) { - // ok to ignore - return; - } - } - - public void verifyImageUrl(String urlRegex, String imgSrc) { - if (Const.SystemParams.DEFAULT_PROFILE_PICTURE_PATH.equals(urlRegex)) { - verifyDefaultImageUrl(imgSrc); - } else { - AssertHelper.assertContainsRegex(urlRegex, imgSrc); - } - } - - public void verifyDefaultImageUrl(String imgSrc) { - openNewWindow(imgSrc); - switchToNewWindow(); - assertEquals(TestProperties.TEAMMATES_URL + Const.SystemParams.DEFAULT_PROFILE_PICTURE_PATH, - browser.driver.getCurrentUrl()); - browser.closeCurrentWindowAndSwitchToParentWindow(); - } - - /** - * Returns if the input element is valid (satisfies constraint validation). Note: This method will return false if the - * input element is not a candidate for constraint validation (e.g. when input element is disabled). - */ - public boolean isInputElementValid(WebElement inputElement) { - checkArgument(inputElement.getAttribute("nodeName").equals("INPUT")); - - return (boolean) executeScript("return arguments[0].willValidate && arguments[0].checkValidity();", inputElement); - } - - public void changeToMobileView() { - browser.driver.manage().window().setSize(new Dimension(360, 640)); - } - - public void changeToDesktopView() { - browser.driver.manage().window().maximize(); - } - - /** - * Returns true if the element is in the user's visible area of a web page. - */ - public boolean isElementInViewport(String id) { - String script = "return isWithinView(document.getElementById('" + id + "'));"; - return (boolean) executeScript(script); - } - - private void openNewWindow(String url) { - executeScript("$(window.open('" + url + "'))"); - } - - /** - * Clicks a button (can be inside or outside the modal) that dismisses the modal and waits for the modal to be hidden. - * The caller must ensure the button is in the modal or a timeout will occur while waiting for the modal to be hidden. - * @param dismissModalButton a button that dismisses the modal - */ - public void clickDismissModalButtonAndWaitForModalHidden(WebElement dismissModalButton) { - // Note: Should first check if the button can actually dismiss the modal otherwise the state will be consistent. - // However, it is too difficult to check. - - WebElement modalBackdrop = browser.driver.findElement(By.className("modal-backdrop")); - - click(dismissModalButton); - waitForModalHidden(modalBackdrop); - } - - /** - * Scrolls element to center and clicks on it. - * - *

    As compared to {@link Actions#moveToElement(WebElement)}, this method is more reliable as the element will not get - * blocked by elements such as the header. - * - *

    Furthermore, {@link Actions#moveToElement(WebElement)} is currently not working in Geckodriver. - * - *

    Note: A "scroll into view" Actions primitive is in progress and may allow scrolling element to center. - * Tracking issue: - * Missing "scroll into view" Actions primitive. - * - *

    Also note that there are some other caveats, for example - * {@code new Actions(browser.driver).moveToElement(...).click(...).perform()} does not behave consistently across - * browsers. - *

      - *
    • In FirefoxDriver, the element is scrolled to and then a click is attempted on the element. - *
    • In ChromeDriver, the mouse is scrolled to the element and then a click is attempted on the mouse coordinate, - * which means another element can actually be clicked (such as the header or a blocking pop-up). - *
    - * - *

    ChromeDriver also automatically scrolls to an element when clicking an element if it is not in the viewport. - */ - void scrollElementToCenterAndClick(WebElement element) { - // TODO: migrate to `scrollIntoView` when Geckodriver is adopted - executeScript("const elementRect = arguments[0].getBoundingClientRect();" - + "const elementAbsoluteTop = elementRect.top + window.pageYOffset;" - + "const center = elementAbsoluteTop - (window.innerHeight / 2);" - + "window.scrollTo(0, center);", element); - element.click(); - } - - /** - * Scrolls element to first cell in spreadsheet, clicks on it and sends the value as keystrokes. - */ - void scrollElementToFirstCellAndSendKeys(WebElement spreadsheetElement, String value) { - new Actions(browser.driver).moveToElement(spreadsheetElement) - .click().sendKeys(value).build().perform(); - } - - /** - * Verifies that comment row doesn't exist for given rowIdSuffix. - * - * @param rowIdSuffix suffix id of comment row - */ - public void verifyCommentRowMissing(String rowIdSuffix) { - try { - waitForAjaxLoaderGifToDisappear(); - browser.driver.findElement(By.id("responseCommentRow" + rowIdSuffix)); - fail("Row expected to be missing found."); - } catch (NoSuchElementException expected) { - // row expected to be missing - } - } - - /** - * Verifies the comment text. - * - * @param commentRowIdSuffix suffix id of comment delete button - * @param commentText comment text to be verified - */ - public void verifyCommentRowContent(String commentRowIdSuffix, String commentText) { - waitForTextContainedInElementPresence(By.id("plainCommentText" + commentRowIdSuffix), commentText); - } - - /** - * Helper methods for detecting the state of a single JQuery AJAX request in the page. If more than one AJAX request is - * made at the same time, the behavior is undefined. - * - *

    Note: If {@code $.ajax()} or {@code $.ajaxSetup()} is called with the {@code global} option set to - * {@code false},the methods cannot work correctly. - */ - class JQueryAjaxHandler { - /** - * The attribute that tracks if an AJAX request is started and not yet complete, - * i.e. {@code ajaxStart} is triggered and {@code ajaxStop} is not yet triggered. - */ - private static final String START_ATTRIBUTE = "__ajaxStart__"; - /** - * The attribute that tracks if an AJAX request is complete, - * i.e. {@code ajaxStop} is triggered. - */ - private static final String STOP_ATTRIBUTE = "__ajaxStop__"; - - /** - * The attribute that tracks if an AJAX request is started, and may or may not be complete, - * i.e. {@code ajaxStart} is triggered. - */ - private static final String START_OCCURRED_ATTRIBUTE = "__ajaxStartOccurred__"; - - /** - * Waits until there is no ongoing jQuery AJAX requests. - */ - void waitForNoActiveAjaxRequests() { - // `$.active` is a counter for holding the number of active AJAX requests - // but is not documented because it is used by JQuery internally. - // see https://stackoverflow.com/questions/3148225/jquery-active-function/3148506#3148506 - waitFor(driver -> (Boolean) ((JavascriptExecutor) driver).executeScript("return $.active === 0")); - } - - /** - * Waits for all AJAX requests to complete if any is present and registers `ajaxStart` and `ajaxStop` handlers to - * track the state of an AJAX request. - * - * @throws IllegalStateException if the handlers are already registered in the document - */ - void waitForAjaxIfPresentThenRegisterHandlers() { - checkState(!hasHandlers(), "`ajaxStart` and `ajaxStop` handlers need only be added once to the document."); - - waitForNoActiveAjaxRequests(); - - executeScript("const seleniumArguments = arguments;" - + "$(document).ajaxStart(function() {" - + " document.body.setAttribute(seleniumArguments[0], true);" - + " document.body.setAttribute(seleniumArguments[1], false);" - + " document.body.setAttribute(seleniumArguments[2], true);" - + "});" - + "$(document).ajaxStop(function() {" - + " document.body.setAttribute(seleniumArguments[0], false);" - + " document.body.setAttribute(seleniumArguments[1], true);" - + "});" - + "document.body.setAttribute(seleniumArguments[0], false);" - + "document.body.setAttribute(seleniumArguments[1], false);" - + "document.body.setAttribute(seleniumArguments[2], false);", - START_ATTRIBUTE, STOP_ATTRIBUTE, START_OCCURRED_ATTRIBUTE); - } - - /** - * Unregisters `ajaxStart` and `ajaxStop` handlers. - * - * @throws IllegalStateException if there are no registered handlers to unregister - */ - private void unregisterHandlers() { - checkState(hasHandlers(), "`ajaxStart` and `ajaxStop` handlers are not registered. Cannot unregister!"); - - executeScript("$(document).off('ajaxStart');" - + "$(document).off('ajaxStop');" - + "document.body.removeAttribute(arguments[0]);" - + "document.body.removeAttribute(arguments[1]);" - + "document.body.removeAttribute(arguments[2]);", - START_ATTRIBUTE, STOP_ATTRIBUTE, START_OCCURRED_ATTRIBUTE); - } - - /** - * Returns true if `ajaxStart` and `ajaxStop` handlers exist. - */ - private boolean hasHandlers() { - WebElement bodyElement = browser.driver.findElement(By.tagName("body")); - - return isExpectedCondition(ExpectedConditions.and( - ExpectedConditions.attributeToBeNotEmpty(bodyElement, START_ATTRIBUTE), - ExpectedConditions.attributeToBeNotEmpty(bodyElement, STOP_ATTRIBUTE), - ExpectedConditions.attributeToBeNotEmpty(bodyElement, START_OCCURRED_ATTRIBUTE))); - } - - /** - * Waits for an AJAX request to complete and automatically unregisters the handlers. - * Note: The behavior is undefined if more than one AJAX request was made after the the registration of the - * handlers. - */ - void waitForRequestComplete() { - checkState(hasHandlers(), - "`ajaxStart` and `ajaxStop` handlers are not registered. Cannot detect if AJAX request is complete!"); - - WebElement bodyElement = browser.driver.findElement(By.tagName("body")); - - waitFor(ExpectedConditions.and( - // Make sure that only a single AJAX request has previously occurred, this will be false if an AJAX - // request was made while there are other outstanding AJAX requests. - ExpectedConditions.attributeContains(bodyElement, START_OCCURRED_ATTRIBUTE, "true"), - ExpectedConditions.attributeContains(bodyElement, START_ATTRIBUTE, "false"), - ExpectedConditions.attributeContains(bodyElement, STOP_ATTRIBUTE, "true"))); - - // Any AJAX requests made while executing the following script will result in undefined behavior. - executeScript("document.body.setAttribute(arguments[0], false);" - + "document.body.setAttribute(arguments[1], false);" - + "document.body.setAttribute(arguments[2], false);", - START_ATTRIBUTE, STOP_ATTRIBUTE, START_OCCURRED_ATTRIBUTE); - - unregisterHandlers(); - } - } - - /** - * Encapsulates methods for handling Firefox {@code change} events. The methods can only handle one {@value CHANGE_EVENT} - * event at a time and will only do something useful if test browser is Firefox. Note that the class does not check if - * the {@value CHANGE_EVENT} event should be fired on the element. - */ - private class FirefoxChangeHandler { - - private static final String CHANGE_EVENT = "change"; - /** - * The attribute that the hook will modify to indicate if the {@value CHANGE_EVENT} event is detected. - */ - private static final String HOOK_ATTRIBUTE = "__change__"; - /** - * The maximum number of seconds required for all hardware (including slow ones) to fire the event. - */ - private static final int MAXIMUM_SECONDS_REQUIRED_FOR_ALL_CPUS_TO_FIRE_EVENT = 1; - - private final boolean isFirefox; - - FirefoxChangeHandler() { - isFirefox = TestProperties.BROWSER_FIREFOX.equals(TestProperties.BROWSER); - } - - /** - * Returns true if the {@value CHANGE_EVENT} event hook has already been added. - * Note that there can only be one hook (linked to a particular element) at a time for each page. - */ - private boolean isChangeEventHookAdded() { - WebElement bodyElement = browser.driver.findElement(By.tagName("body")); - return isExpectedCondition(ExpectedConditions.attributeToBeNotEmpty(bodyElement, HOOK_ATTRIBUTE)); - } - - /** - * Adds a {@value CHANGE_EVENT} event hook for the element. - * The hook allows detection of the event required for {@link FirefoxChangeHandler#fireChangeEventIfNotFired}. - * - * @param element the element for which the hook will track whether the event is fired on the element - * - * @throws IllegalStateException if there is already a hook in the document - */ - private void addChangeEventHook(WebElement element) { - if (!isFirefox) { - return; - } - - checkState(!isChangeEventHookAdded(), - "The `%1$s` event hook can only be added once in the document.", CHANGE_EVENT); - - executeScript( - "const seleniumArguments = arguments;" - + "seleniumArguments[0].addEventListener(seleniumArguments[1], function onchange() {" - + " this.removeEventListener(seleniumArguments[1], onchange);" - + " document.body.setAttribute(seleniumArguments[2], true);" - + "});" - + "document.body.setAttribute(seleniumArguments[2], false);", - element, CHANGE_EVENT, HOOK_ATTRIBUTE); - } - - /** - * Fires a {@value CHANGE_EVENT} event on the element if not already fired. - * Requires a hook ({@link FirefoxChangeHandler#addChangeEventHook(WebElement)}) to be added before to detect - * events. - * Note that sometimes the {@value CHANGE_EVENT} event may need to be fired multiple times but this method only fires - * one {@value CHANGE_EVENT} event in place of multiple {@value CHANGE_EVENT} events. This reinforces the notion that - * events should not be fired manually so this method is to be avoided if possible. - * - * @param element the element for which the change event will be fired if it is not fired. - * - * @throws IllegalStateException if `change` event hook is not added - * - * @see FirefoxChangeHandler#isChangeEventNotFired() - */ - private void fireChangeEventIfNotFired(WebElement element) { - if (!isFirefox) { - return; - } - - checkState(isChangeEventHookAdded(), - "A `%s` hook has to be added previously to detect event firing.", CHANGE_EVENT); - - if (isChangeEventNotFired()) { - fireChangeEvent(element); - } - - removeHookAttribute(); - } - - /** - * Removes the attribute associated with a hook. - */ - private void removeHookAttribute() { - executeScript(String.format("document.body.removeAttribute('%s');", HOOK_ATTRIBUTE)); - } - - /** - * Returns if a {@value CHANGE_EVENT} event has not been fired for the element to which the hook is associated. - * Note that this only detects the presence of firing of {@value CHANGE_EVENT} events and not does not keep track of - * how many {@value CHANGE_EVENT} events are fired. - */ - private boolean isChangeEventNotFired() { - WebDriverWait wait = new WebDriverWait(browser.driver, MAXIMUM_SECONDS_REQUIRED_FOR_ALL_CPUS_TO_FIRE_EVENT); - try { - wait.until(ExpectedConditions.attributeContains(By.tagName("body"), HOOK_ATTRIBUTE, "true")); - return false; - } catch (TimeoutException e) { - return true; - } - } - - /** - * Fires the {@value CHANGE_EVENT} event on the element. - * Note that this method should not usually be called because events should not be fired manually, - * and may also result in unexpected multiple firings of the event. - */ - private void fireChangeEvent(WebElement element) { - if (!isFirefox) { - return; - } - // The `change` event is fired with bubbling enabled to simulate how browsers fire them. - // See: https://developer.mozilla.org/en-US/docs/Web/Events/change - executeScript("const event = new Event(arguments[1], {bubbles: true});" - + "arguments[0].dispatchEvent(event);", element, CHANGE_EVENT); - } - } -} diff --git a/src/test/java/teammates/test/pageobjects/DevServerLoginPage.java b/src/test/java/teammates/test/pageobjects/DevServerLoginPage.java deleted file mode 100644 index 4eab1c5cd01..00000000000 --- a/src/test/java/teammates/test/pageobjects/DevServerLoginPage.java +++ /dev/null @@ -1,102 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -public class DevServerLoginPage extends LoginPage { - - @FindBy(id = "email") - private WebElement emailTextBox; - - @FindBy(id = "isAdmin") - private WebElement isAdminCheckBox; - - @FindBy(xpath = "/html/body/form/div/p[3]/input[1]") - private WebElement loginButton; - - public DevServerLoginPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Not logged in

    "); - } - - @Override - public InstructorHomePage loginAsInstructor(String username, String password) { - return loginAsInstructor(username, password, InstructorHomePage.class); - } - - @Override - public T loginAsInstructor(String username, String password, Class typeOfPage) { - fillTextBox(emailTextBox, username); - click(loginButton); - waitForPageToLoad(); - browser.isAdminLoggedIn = false; - return changePageType(typeOfPage); - } - - @Override - public AppPage loginAsInstructorUnsuccessfully(String userName, String password) { - fillTextBox(emailTextBox, userName); - click(loginButton); - waitForPageToLoad(); - browser.isAdminLoggedIn = false; - return this; - } - - @Override - public void loginAdminAsInstructor( - String adminUsername, String adminPassword, String instructorUsername) { - fillTextBox(emailTextBox, instructorUsername); - click(isAdminCheckBox); - click(loginButton); - waitForPageToLoad(); - browser.isAdminLoggedIn = true; - } - - @Override - public StudentHomePage loginAsStudent(String username, String password) { - return loginAsStudent(username, password, StudentHomePage.class); - } - - @Override - public T loginAsStudent(String username, String password, Class typeOfPage) { - fillTextBox(emailTextBox, username); - click(loginButton); - waitForPageToLoad(); - browser.isAdminLoggedIn = false; - return changePageType(typeOfPage); - } - - @Override - public StudentCourseJoinConfirmationPage loginAsJoiningStudent(String username, String password) { - fillTextBox(emailTextBox, username); - click(loginButton); - waitForPageToLoad(); - browser.isAdminLoggedIn = false; - return changePageType(StudentCourseJoinConfirmationPage.class); - } - - @Override - public InstructorCourseJoinConfirmationPage loginAsJoiningInstructor(String username, String password) { - fillTextBox(emailTextBox, username); - click(loginButton); - waitForPageToLoad(); - browser.isAdminLoggedIn = false; - return changePageType(InstructorCourseJoinConfirmationPage.class); - } - - @Override - public InstructorHomePage loginAsJoiningInstructorByPassConfirmation(String username, String password) { - fillTextBox(emailTextBox, username); - click(loginButton); - waitForPageToLoad(); - browser.isAdminLoggedIn = false; - return changePageType(InstructorHomePage.class); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/FeedbackSessionNotVisiblePage.java b/src/test/java/teammates/test/pageobjects/FeedbackSessionNotVisiblePage.java deleted file mode 100644 index 26ce1d99c55..00000000000 --- a/src/test/java/teammates/test/pageobjects/FeedbackSessionNotVisiblePage.java +++ /dev/null @@ -1,16 +0,0 @@ -package teammates.test.pageobjects; - -import teammates.e2e.pageobjects.Browser; - -public class FeedbackSessionNotVisiblePage extends AppPage { - - public FeedbackSessionNotVisiblePage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("Sorry, this session is currently not open for submission."); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/FeedbackSubmitPage.java b/src/test/java/teammates/test/pageobjects/FeedbackSubmitPage.java deleted file mode 100644 index 807126fcc28..00000000000 --- a/src/test/java/teammates/test/pageobjects/FeedbackSubmitPage.java +++ /dev/null @@ -1,323 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.ui.Select; - -import teammates.common.util.Const; -import teammates.common.util.SanitizationHelper; -import teammates.e2e.pageobjects.Browser; - -public class FeedbackSubmitPage extends AppPage { - - public FeedbackSubmitPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Submit Feedback

    "); - } - - public String getCourseId() { - return browser.driver.findElement(By.name("courseid")).getAttribute("value"); - } - - public String getFeedbackSessionName() { - return browser.driver.findElement(By.name("fsname")).getAttribute("value"); - } - - public boolean isCorrectPage(String courseId, String feedbackSessionName) { - boolean isCorrectCourseId = this.getCourseId().equals(courseId); - boolean isCorrectFeedbackSessionName = this.getFeedbackSessionName().equals(feedbackSessionName); - return isCorrectCourseId && isCorrectFeedbackSessionName && containsExpectedPageContents(); - } - - public void selectRecipient(int qnNumber, int responseNumber, String recipientName) { - Select selectElement = new Select(browser.driver.findElement( - By.name(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" + qnNumber + "-" + responseNumber))); - selectElement.selectByVisibleText(recipientName); - } - - public void fillResponseRichTextEditor(int qnNumber, int responseNumber, String text) { - String id = Const.ParamsNames.FEEDBACK_RESPONSE_TEXT - + "-" + qnNumber + "-" + responseNumber; - fillRichTextEditor(id, text); - } - - public void fillResponseTextBox(int qnNumber, int responseNumber, String text) { - WebElement element = browser.driver.findElement( - By.name(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber)); - fillTextBox(element, text); - } - - public void fillResponseTextBox(int qnNumber, int responseNumber, int responseSubNumber, String text) { - WebElement element = browser.driver.findElement( - By.id(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT - + "-" + qnNumber + "-" + responseNumber + "-" + responseSubNumber)); - fillTextBox(element, text); - } - - public String getResponseTextBoxValue(int qnNumber, int responseNumber) { - WebElement element = browser.driver.findElement( - By.name(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber)); - return element.getAttribute("value"); - } - - public String getResponseTextBoxValue(int qnNumber, int responseNumber, int responseSubNumber) { - WebElement element = browser.driver.findElement( - By.id(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT - + "-" + qnNumber + "-" + responseNumber + "-" + responseSubNumber)); - return element.getAttribute("value"); - } - - public void clearResponseTextBoxValue(int qnNumber, int responseNumber, int responseSubNumber) { - WebElement element = browser.driver.findElement( - By.id(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT - + "-" + qnNumber + "-" + responseNumber + "-" + responseSubNumber)); - element.clear(); - } - - public boolean isTextBoxValueEmpty(int qnNumber, int responseNumber, int responseSubNumber) { - WebElement element = browser.driver.findElement( - By.id(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT - + "-" + qnNumber + "-" + responseNumber + "-" + responseSubNumber)); - return checkEmptyTextBoxValue(element); - } - - public int getResponseTextBoxLengthLabelValue(int qnNumber, int responseNumber) { - WebElement element = browser.driver.findElement( - By.id("responseLength" + "-" + qnNumber + "-" + responseNumber)); - return Integer.parseInt(element.getText()); - } - - public void selectResponseTextDropdown(int qnNumber, int responseNumber, int responseSubNumber, String text) { - WebElement element = browser.driver.findElement( - By.id(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" - + qnNumber + "-" + responseNumber - + "-" + responseSubNumber)); - Select dropdown = new Select(element); - dropdown.selectByVisibleText(text); - } - - public String getConstSumInstruction(int qnNumber) { - WebElement element = browser.driver.findElement( - By.id("constSumInstruction-" + qnNumber)); - return element.getText(); - } - - public String getConstSumMessage(int qnNumber, int responseNumber) { - WebElement element = browser.driver.findElement( - By.id("constSumMessage-" + qnNumber + "-" + responseNumber)); - return element.getText(); - } - - public void chooseMcqOption(int qnNumber, int responseNumber, String choiceName) { - String name = Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber; - name = SanitizationHelper.sanitizeStringForXPath(name); - String sanitizedChoiceName = SanitizationHelper.sanitizeStringForXPath(choiceName); - WebElement element = browser.driver.findElement( - By.xpath("//input[@name=" + name + " and @value=" + sanitizedChoiceName + "]")); - click(element); - } - - public boolean checkIfMcqOrMsqChoiceExists(int qnNumber, int responseNumber, String choiceName) { - String name = Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber; - name = SanitizationHelper.sanitizeStringForXPath(name); - String sanitizedChoiceName = SanitizationHelper.sanitizeStringForXPath(choiceName); - try { - browser.driver.findElement( - By.xpath("//input[@name=" + name + " and @value=" + sanitizedChoiceName + "]")); - } catch (NoSuchElementException e) { - return false; - } - return true; - } - - public void fillMcqOtherOptionTextBox(int qnNumber, int responseNumber, String otherOptionText) { - String elementId = "otherOptionText-" + qnNumber + "-" + responseNumber; - WebElement otherOptionTextBox = browser.driver.findElement(By.id(elementId)); - fillTextBox(otherOptionTextBox, otherOptionText); - } - - public void toggleMsqOption(int qnNumber, int responseNumber, String choiceName) { - String name = Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber; - name = SanitizationHelper.sanitizeStringForXPath(name); - String sanitizedChoiceName = SanitizationHelper.sanitizeStringForXPath(choiceName); - WebElement element = browser.driver.findElement( - By.xpath("//input[@name=" + name + " and @value=" + sanitizedChoiceName + "]")); - click(element); - } - - public void fillMsqOtherOptionTextBox(int qnNumber, int responseNumber, String otherOptionText) { - String elementId = "msqOtherOptionText-" + qnNumber + "-" + responseNumber; - WebElement otherOptionTextBox = browser.driver.findElement(By.id(elementId)); - fillTextBox(otherOptionTextBox, otherOptionText); - } - - public void chooseContribOption(int qnNumber, int responseNumber, String choiceName) { - String name = Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber; - name = SanitizationHelper.sanitizeStringForXPath(name); - WebElement selectElement = browser.driver.findElement(By.xpath("//select[@name=" + name + "]")); - selectDropdownByVisibleValue(selectElement, choiceName); - } - - public void clickRubricRadio(int qnIndex, int respIndex, int row, int col) { - WebElement radio = browser.driver.findElement( - By.id(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE - + "-" + qnIndex + "-" + respIndex + "-" + row + "-" + col)); - click(radio); - } - - public void clickRubricRadioMobile(int qnIndex, int respIndex, int row, int col) { - WebElement radio = browser.driver.findElement( - By.id("mobile-" + Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE - + "-" + qnIndex + "-" + respIndex + "-" + row + "-" + col)); - click(radio); - } - - public boolean isRubricRadioMobileChecked(int qnIndex, int respIndex, int row, int col) { - WebElement radio = browser.driver.findElement( - By.id("mobile-" + Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE - + "-" + qnIndex + "-" + respIndex + "-" + row + "-" + col)); - String isChecked = radio.getAttribute("checked"); - return "true".equals(isChecked); - } - - public boolean isRubricRadioChecked(int qnIndex, int respIndex, int row, int col) { - WebElement radio = browser.driver.findElement( - By.id(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE - + "-" + qnIndex + "-" + respIndex + "-" + row + "-" + col)); - String isChecked = radio.getAttribute("checked"); - return "true".equals(isChecked); - } - - public String getRankMessage(int qnNumber, int responseNumber) { - WebElement element = browser.driver.findElement( - By.id("rankMessage-" + qnNumber + "-" + responseNumber)); - return element.getText(); - } - - public void submitWithoutConfirmationEmail() { - WebElement sendEmailCheckbox = browser.driver.findElement(By.name(Const.ParamsNames.SEND_SUBMISSION_EMAIL)); - if (sendEmailCheckbox.isSelected()) { - click(sendEmailCheckbox); - } - clickSubmitButton(); - } - - public boolean isConfirmationEmailBoxTicked() { - WebElement sendEmailCheckbox = browser.driver.findElement(By.name(Const.ParamsNames.SEND_SUBMISSION_EMAIL)); - return sendEmailCheckbox.isSelected(); - } - - public void clickSubmitButton() { - WebElement submitButton = browser.driver.findElement(By.id("response_submit_button")); - click(submitButton); - waitForPageToLoad(); - } - - public void verifyOtherOptionTextUnclickable(int qnNumber, int responseNumber) { - WebElement element = browser.driver.findElement( - By.cssSelector("input[id$='OptionText-" + qnNumber + "-" + responseNumber + "']")); - verifyUnclickable(element); - } - - public void waitForCellHoverToDisappear() { - waitForElementToDisappear(By.className("cell-hover")); - } - - public void waitForOtherOptionTextToBeClickable(int qnNumber, int responseNumber) { - WebElement element = browser.driver.findElement( - By.cssSelector("input[id$='OptionText-" + qnNumber + "-" + responseNumber + "']")); - waitForElementToBeClickable(element); - } - - public void verifyVisibilityAndCloseMoreInfoAboutEqualShareModal() { - WebElement moreInfoAboutEqualShareModalLink = browser.driver.findElement(By.id("more-info-equal-share-modal-link")); - click(moreInfoAboutEqualShareModalLink); - WebElement moreInfoAboutEqualShareModal = browser.driver.findElement(By.id("more-info-equal-share-modal")); - waitForElementVisibility(moreInfoAboutEqualShareModal); - closeMoreInfoAboutEqualShareModal(); - } - - public void verifyAndCloseSuccessfulSubmissionModal(String unansweredQuestionsMessage) { - // Waiting for modal visibility - WebElement closeButton = browser.driver.findElement(By.className("bootbox-close-button")); - waitForElementToBeClickable(closeButton); - - // Verify modal header has success class - WebElement modalHeader = closeButton.findElement(By.xpath("..")); - assertTrue(modalHeader.getAttribute("class").contains("success")); - - // Verify title content - WebElement modalTitle = browser.driver.findElement(By.xpath("//h4[@class='modal-title icon-success']")); - assertEquals(modalTitle.getText(), Const.StatusMessages.FEEDBACK_RESPONSES_SAVED); - - // Verify modal message content - StringBuilder expectedModalMessage = new StringBuilder("All your responses have been successfully recorded! " - + "You may now leave this page.\n" - + "Note that you can change your responses and submit them again any time before the session closes."); - if (!unansweredQuestionsMessage.isEmpty()) { - expectedModalMessage.insert(0, "❗ Note that some questions are yet to be answered. They are: " - + unansweredQuestionsMessage + "\n"); - } - WebElement modalMessage = browser.driver.findElement(By.xpath("//div[@class='bootbox-body']")); - assertEquals(modalMessage.getText(), expectedModalMessage.toString()); - - clickDismissModalButtonAndWaitForModalHidden(closeButton); - } - - /** - * Adds feedback participant comment. - * - * @param addResponseCommentId suffix id of comment add form - * @param commentText comment text - */ - public void addFeedbackParticipantComment(String addResponseCommentId, String commentText) { - WebElement showResponseCommentAddFormButton = - browser.driver.findElement(By.id("button_add_comment" + addResponseCommentId)); - click(showResponseCommentAddFormButton); - WebElement editorElement = - waitForElementPresence(By.cssSelector("#" + "showResponseCommentAddForm" - + addResponseCommentId + " .mce-content-body")); - waitForRichTextEditorToLoad(editorElement.getAttribute("id")); - fillRichTextEditor(editorElement.getAttribute("id"), commentText); - } - - /** - * Edits feedback participant comment. - * - * @param commentIdSuffix suffix id of comment edit form - * @param newCommentText new comment text - */ - public void editFeedbackParticipantComment(String commentIdSuffix, String newCommentText) { - WebElement commentRow = browser.driver.findElement(By.id("responseCommentRow" + commentIdSuffix)); - click(commentRow.findElements(By.tagName("a")).get(1)); - fillRichTextEditor("responsecommenttext" + commentIdSuffix, newCommentText); - } - - /** - * Deletes feedback participant comment. - * - * @param commentIdSuffix suffix id of comment delete button - */ - public void deleteFeedbackResponseComment(String commentIdSuffix) { - WebElement deleteCommentButton = browser.driver.findElement(By.id("commentdelete" + commentIdSuffix)); - click(deleteCommentButton); - waitForConfirmationModalAndClickOk(); - } - - private void closeMoreInfoAboutEqualShareModal() { - WebElement closeButton = browser.driver - .findElement(By.xpath("//div[@id='more-info-equal-share-modal']//button[@class='close']")); - waitForElementToBeClickable(closeButton); - click(closeButton); - waitForElementToDisappear(By.id("more-info-equal-share-modal")); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/GenericAppPage.java b/src/test/java/teammates/test/pageobjects/GenericAppPage.java deleted file mode 100644 index b560b1dc80e..00000000000 --- a/src/test/java/teammates/test/pageobjects/GenericAppPage.java +++ /dev/null @@ -1,20 +0,0 @@ -package teammates.test.pageobjects; - -import teammates.e2e.pageobjects.Browser; - -/** - * This is used as the page type when we want to navigate to a Url without - * bothering about the exact type of the page. - */ -public class GenericAppPage extends AppPage { - - public GenericAppPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return true; - } - -} diff --git a/src/test/java/teammates/test/pageobjects/GoogleLoginPage.java b/src/test/java/teammates/test/pageobjects/GoogleLoginPage.java deleted file mode 100644 index 6580adae3fd..00000000000 --- a/src/test/java/teammates/test/pageobjects/GoogleLoginPage.java +++ /dev/null @@ -1,173 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.ExpectedConditions; - -import com.google.common.base.Preconditions; - -import teammates.e2e.pageobjects.Browser; -import teammates.e2e.util.TestProperties; - -public class GoogleLoginPage extends LoginPage { - - private static final String EXPECTED_SNIPPET_SIGN_IN = "Sign in – Google accounts"; - private static final String EXPECTED_SNIPPET_APPROVAL = "requesting permission to access your Google Account"; - - @FindBy(id = "initialView") - private WebElement loginPanel; - - @FindBy(id = "identifierId") - private WebElement identifierTextBox; - - @FindBy(id = "identifierNext") - private WebElement identifierNextButton; - - @FindBy(css = "input[type=password]") - private WebElement passwordTextBox; - - @FindBy(id = "passwordNext") - private WebElement passwordNextButton; - - public GoogleLoginPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains(EXPECTED_SNIPPET_SIGN_IN); - } - - @Override - public InstructorHomePage loginAsInstructor(String username, String password) { - return loginAsInstructor(username, password, InstructorHomePage.class); - } - - @Override - public T loginAsInstructor(String username, String password, Class typeOfPage) { - completeGoogleLoginSteps(username, password); - browser.isAdminLoggedIn = false; - return changePageType(typeOfPage); - } - - @Override - public AppPage loginAsInstructorUnsuccessfully(String userName, String password) { - completeGoogleLoginSteps(userName, password); - browser.isAdminLoggedIn = false; - return this; - } - - @Override - public void loginAdminAsInstructor( - String adminUsername, String adminPassword, String instructorUsername) { - completeGoogleLoginSteps(adminUsername, adminPassword); - browser.isAdminLoggedIn = true; - } - - @Override - public StudentHomePage loginAsStudent(String username, String password) { - return loginAsStudent(username, password, StudentHomePage.class); - } - - @Override - public T loginAsStudent(String username, String password, Class typeOfPage) { - completeGoogleLoginSteps(username, password); - browser.isAdminLoggedIn = false; - return changePageType(typeOfPage); - } - - private void completeGoogleLoginSteps(String username, String password) { - submitCredentials(username, password); - dealWithSignIntoChromePage(); - handleApprovalPageIfAny(); - } - - private void dealWithSignIntoChromePage() { - try { - click(By.id("no-button")); - waitForPageToLoad(); - } catch (NoSuchElementException e) { - System.out.println("No 'sign into chrome' option"); - } - } - - private void handleApprovalPageIfAny() { - waitForPageToLoad(); - waitForRedirectIfAny(); - boolean isPageRequestingAccessApproval = getPageSource().contains(EXPECTED_SNIPPET_APPROVAL); - if (isPageRequestingAccessApproval) { - markCheckBoxAsChecked(browser.driver.findElement(By.id("persist_checkbox"))); - click(By.id("approve_button")); - waitForPageToLoad(); - } - } - - private void waitForRedirectIfAny() { - String loginRedirectUrl = TestProperties.TEAMMATES_URL + "/_ah/conflogin"; - waitFor(d -> { - String url = Preconditions.checkNotNull(d).getCurrentUrl(); - boolean isTeammatesPage = url.startsWith(TestProperties.TEAMMATES_URL) && !url.startsWith(loginRedirectUrl); - boolean isApprovalPage = d.getPageSource().contains(EXPECTED_SNIPPET_APPROVAL); - return isTeammatesPage || isApprovalPage; - }); - } - - private void waitForLoginPanelAnimationToComplete() { - // the login panel will have attribute `aria-busy="true"` while in animation - waitFor(ExpectedConditions.attributeToBe(loginPanel, "aria-busy", "")); - } - - private void submitCredentials(String username, String password) { - completeFillIdentifierSteps(username); - click(identifierNextButton); - - waitForLoginPanelAnimationToComplete(); - fillTextBox(passwordTextBox, password); - - click(passwordNextButton); - waitForPageToLoad(); - } - - private void completeFillIdentifierSteps(String identifier) { - By switchAccountButtonBy = By.cssSelector("div[aria-label='Switch account']"); - By useAnotherAccountButtonBy = By.xpath("//div[contains(text(), 'Use another account')]"); - - if (isElementPresent(switchAccountButtonBy)) { - click(switchAccountButtonBy); - waitForLoginPanelAnimationToComplete(); - } - - if (isElementPresent(useAnotherAccountButtonBy)) { - click(useAnotherAccountButtonBy); - waitForLoginPanelAnimationToComplete(); - } - - fillTextBox(identifierTextBox, identifier); - } - - @Override - public StudentCourseJoinConfirmationPage loginAsJoiningStudent( - String username, String password) { - completeGoogleLoginSteps(username, password); - browser.isAdminLoggedIn = false; - return changePageType(StudentCourseJoinConfirmationPage.class); - } - - @Override - public InstructorCourseJoinConfirmationPage loginAsJoiningInstructor( - String username, String password) { - completeGoogleLoginSteps(username, password); - browser.isAdminLoggedIn = false; - return changePageType(InstructorCourseJoinConfirmationPage.class); - } - - @Override - public InstructorHomePage loginAsJoiningInstructorByPassConfirmation( - String username, String password) { - completeGoogleLoginSteps(username, password); - browser.isAdminLoggedIn = false; - return changePageType(InstructorHomePage.class); - } -} diff --git a/src/test/java/teammates/test/pageobjects/HomePage.java b/src/test/java/teammates/test/pageobjects/HomePage.java deleted file mode 100644 index 564d26e4f1a..00000000000 --- a/src/test/java/teammates/test/pageobjects/HomePage.java +++ /dev/null @@ -1,58 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -/** - * Represents the home page of the website (i.e., index.jsp). - */ -public class HomePage extends AppPage { - - @FindBy(id = "btnInstructorLogin") - private WebElement instructorLoginLink; - - @FindBy(id = "btnStudentLogin") - private WebElement studentLoginLink; - - public HomePage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("Designed for Simplicity, Flexibility, and Power:"); - } - - public LoginPage clickInstructorLogin() { - - click(instructorLoginLink); - waitForPageToLoad(); - String pageSource = getPageSource(); - if (InstructorHomePage.containsExpectedPageContents(pageSource)) { - //already logged in. We need to logout because the return type of - // this method is a LoginPage - logout(); - click(instructorLoginLink); - waitForPageToLoad(); - } - return createCorrectLoginPageType(browser); - - } - - public LoginPage clickStudentLogin() { - click(studentLoginLink); - waitForPageToLoad(); - String pageSource = getPageSource(); - if (StudentHomePage.containsExpectedPageContents(pageSource)) { - //already logged in. We need to logout because the return type of - // this method is a LoginPage - logout(); - click(studentLoginLink); - waitForPageToLoad(); - } - return createCorrectLoginPageType(browser); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCopyFsToModal.java b/src/test/java/teammates/test/pageobjects/InstructorCopyFsToModal.java deleted file mode 100644 index 2dd3cbdf9bf..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCopyFsToModal.java +++ /dev/null @@ -1,110 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.common.util.Const; -import teammates.e2e.pageobjects.Browser; - -/** - * Page Object class for handling the modal for copying a feedback session to multiple courses. - */ -public class InstructorCopyFsToModal extends AppPage { - - private static final String FEEDBACK_COPY_MODAL_STATUS = "feedback-copy-modal-status"; - public WebElement copyModalStatusMessage; - - public InstructorCopyFsToModal(Browser browser) { - super(browser); - } - - /** - * Returns true if the modal for copying feedback sessions to multiple courses, - * identified by its html id, is present, otherwise false. - */ - public static boolean isPresentOnPage(Browser browser) { - return !browser.driver.findElements(By.id("fsCopyModal")).isEmpty(); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("Copy this feedback session to other courses"); - } - - public void waitForModalToLoad() { - By byCopiedFsNameField = By.id(Const.ParamsNames.COPIED_FEEDBACK_SESSION_NAME); - waitForElementPresence(byCopiedFsNameField); - waitForElementVisibility(browser.driver.findElement(byCopiedFsNameField)); - - copyModalStatusMessage = browser.driver.findElement(By.id(FEEDBACK_COPY_MODAL_STATUS)); - } - - /** - * Populates the fields of the form by using the provided name, and selecting every course. - * @param newFsName feedback session name of the new session - */ - public void fillFormWithAllCoursesSelected(String newFsName) { - WebElement fsCopyModal = browser.driver.findElement(By.id("fsCopyModal")); - List coursesCheckBoxes = fsCopyModal.findElements(By.name(Const.ParamsNames.COPIED_COURSES_ID)); - for (WebElement e : coursesCheckBoxes) { - markCheckBoxAsChecked(e); - } - - WebElement fsNameInput = fsCopyModal.findElement(By.id(Const.ParamsNames.COPIED_FEEDBACK_SESSION_NAME)); - fillTextBox(fsNameInput, newFsName); - } - - /** - * Unchecks every course in the course list. - */ - public void resetCoursesCheckboxes() { - WebElement fsCopyModal = browser.driver.findElement(By.id("fsCopyModal")); - List coursesCheckBoxes = fsCopyModal.findElements(By.name(Const.ParamsNames.COPIED_COURSES_ID)); - for (WebElement e : coursesCheckBoxes) { - markCheckBoxAsUnchecked(e); - } - } - - /** - * Returns true if the status message modal is visible. - */ - public boolean isFormSubmissionStatusMessageVisible() { - return copyModalStatusMessage.isDisplayed(); - } - - public void waitForFormSubmissionErrorMessagePresence() { - waitForElementPresence(By.cssSelector("#" + FEEDBACK_COPY_MODAL_STATUS + ".alert-danger")); - } - - /** - * Verifies that the status message on the copy modal is the {@code expectedStatusMessage}. - */ - public void verifyStatusMessage(String expectedStatusMessage) { - assertEquals(expectedStatusMessage, getFsCopyStatus()); - } - - private String getFsCopyStatus() { - return copyModalStatusMessage.getText(); - } - - public void clickSubmitButton() { - WebElement fsCopySubmitButton = browser.driver.findElement(By.id("fscopy_submit")); - click(fsCopySubmitButton); - } - - public void clickCloseButton() { - WebElement closeButton = browser.driver.findElement(By.cssSelector("#fsCopyModal .close")); - clickDismissModalButtonAndWaitForModalHidden(closeButton); - } - - /** - * Waits for the error message indicating that the loading of the form modal has failed. - */ - public void waitForModalLoadingError() { - waitForElementPresence(By.id("fs-copy-modal-error")); - } -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCourseDetailsPage.java b/src/test/java/teammates/test/pageobjects/InstructorCourseDetailsPage.java deleted file mode 100644 index 6ff7b24a45f..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCourseDetailsPage.java +++ /dev/null @@ -1,189 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.common.util.Const; -import teammates.e2e.pageobjects.Browser; - -public class InstructorCourseDetailsPage extends AppPage { - - @FindBy (id = "button_sortstudentstatus") - private WebElement sortByStatusIcon; - - @FindBy (id = "button_sortstudentname-0") - private WebElement sortByNameIcon; - - @FindBy (id = "button_sortteam-0") - private WebElement sortByTeamIcon; - - @FindBy (id = "button_remind") - private WebElement remindAllButton; - - public InstructorCourseDetailsPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Course Details

    "); - } - - public String getCourseId() { - return browser.driver.findElement(By.id("courseid")).getText(); - } - - public InstructorCourseDetailsPage verifyIsCorrectPage(String courseId) { - assertEquals(courseId, this.getCourseId()); - return this; - } - - public InstructorCourseDetailsPage sortByStatus() { - click(sortByStatusIcon); - return this; - } - - public InstructorCourseDetailsPage sortByName() { - click(sortByNameIcon); - return this; - } - - public InstructorCourseDetailsPage sortByTeam() { - click(sortByTeamIcon); - return this; - } - - public InstructorCourseDetailsPage clickRemindAllAndCancel() { - click(remindAllButton); - waitForConfirmationModalAndClickCancel(); - return this; - } - - public InstructorCourseDetailsPage clickRemindAllAndConfirm() { - click(remindAllButton); - waitForConfirmationModalAndClickOk(); - return this; - } - - public InstructorCourseStudentDetailsViewPage clickViewStudent(String studentName) { - int rowId = getStudentRowId(studentName); - click(getViewLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorCourseStudentDetailsViewPage.class); - } - - public InstructorCourseStudentDetailsEditPage clickEditStudent(String studentName) { - int rowId = getStudentRowId(studentName); - click(getEditLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorCourseStudentDetailsEditPage.class); - } - - public InstructorStudentRecordsPage clickAllRecordsLink(String studentName) { - int rowId = getStudentRowId(studentName); - click(getAllRecordsLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorStudentRecordsPage.class); - } - - public InstructorCourseDetailsPage clickRemindStudentAndCancel(String studentName) { - int rowId = getStudentRowId(studentName); - click(getRemindLink(rowId)); - waitForConfirmationModalAndClickCancel(); - return this; - } - - public InstructorCourseDetailsPage clickRemindStudentAndConfirm(String studentName) { - int rowId = getStudentRowId(studentName); - click(getRemindLink(rowId)); - waitForConfirmationModalAndClickOk(); - return this; - } - - public InstructorCourseDetailsPage clickDeleteAndCancel(String studentName) { - int rowId = getStudentRowId(studentName); - click(getDeleteLink(rowId)); - waitForConfirmationModalAndClickCancel(); - return this; - } - - public InstructorCourseDetailsPage clickDeleteAndConfirm(String studentName) { - int rowId = getStudentRowId(studentName); - click(getDeleteLink(rowId)); - waitForConfirmationModalAndClickOk(); - return this; - } - - public InstructorCourseDetailsPage clickDeleteAllAndCancel() { - click(getDeleteAllLink()); - waitForConfirmationModalAndClickCancel(); - return this; - } - - public InstructorCourseDetailsPage clickDeleteAllAndConfirm() { - click(getDeleteAllLink()); - waitForConfirmationModalAndClickOk(); - return this; - } - - private WebElement getViewLink(int studentNum) { - WebElement studentRow = browser.driver.findElement(By.id("student-c0." + studentNum)); - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(1)")); - } - - private WebElement getEditLink(int studentNum) { - WebElement studentRow = browser.driver.findElement(By.id("student-c0." + studentNum)); - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(2)")); - } - - private WebElement getRemindLink(int studentNum) { - WebElement studentRow = browser.driver.findElement(By.id("student-c0." + studentNum)); - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(3)")); - } - - private WebElement getDeleteLink(int studentNum) { - WebElement studentRow = browser.driver.findElement(By.id("student-c0." + studentNum)); - WebElement thirdLink = studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(3)")); - - if ("Delete".equals(thirdLink.getText())) { - return thirdLink; - } - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(4)")); - } - - private WebElement getDeleteAllLink() { - return browser.driver.findElement(By.id("button-delete-all")); - } - - private WebElement getAllRecordsLink(int studentNum) { - WebElement studentRow = browser.driver.findElement(By.id("student-c0." + studentNum)); - WebElement fourthLink = studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(4)")); - - if ("All Records".equals(fourthLink.getText())) { - return fourthLink; - } - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(5)")); - } - - private int getStudentRowId(String studentName) { - int studentCount = browser.driver.findElements(By.className("student_row")).size(); - for (int i = 0; i < studentCount; i++) { - String studentNameInRow = getStudentNameInRow(i); - if (studentNameInRow.equals(studentName)) { - return i; - } - } - return -1; - } - - private String getStudentNameInRow(int studentNum) { - return browser.driver.findElement(By.id(Const.ParamsNames.STUDENT_NAME + "-c0." + studentNum)).getText(); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCourseEditPage.java b/src/test/java/teammates/test/pageobjects/InstructorCourseEditPage.java deleted file mode 100644 index 5a93b9385d9..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCourseEditPage.java +++ /dev/null @@ -1,607 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.common.util.Const; -import teammates.e2e.pageobjects.Browser; - -public class InstructorCourseEditPage extends AppPage { - - public static final int INSTRUCTOR_TYPE_COOWNER = 0; - public static final int INSTRUCTOR_TYPE_MANAGER = 1; - public static final int INSTRUCTOR_TYPE_OBSERVER = 2; - public static final int INSTRUCTOR_TYPE_TUTOR = 3; - public static final int INSTRUCTOR_TYPE_CUSTOM = 4; - - public static final int COURSE_MODIFY_COURSE = 0; - public static final int COURSE_MODIFY_INSTRUCTORS = 1; - public static final int COURSE_MODIFY_SESSIONS = 2; - public static final int COURSE_MODIFY_STUDENTS = 3; - public static final int COURSE_VIEW_STUDENTS = 4; - public static final int COURSE_GIVE_RESPONSES_IN_SESSION = 5; - public static final int COURSE_VIEW_RESPONSES_IN_SESSION = 6; - public static final int COURSE_MODIFY_RESPONSES_IN_SESSION = 7; - - public static final int SECTION_VIEW_STUDENTS = 0; - public static final int SECTION_GIVE_RESPONSES_IN_SESSION = 1; - public static final int SECTION_VIEW_RESPONSES_IN_SESSION = 2; - public static final int SECTION_MODIFY_RESPONSES_IN_SESSION = 3; - - public static final int SESSION_GIVE_RESPONSES = 0; - public static final int SESSION_VIEW_RESPONSES = 1; - public static final int SESSION_MODIFY_RESPONSES = 2; - - @FindBy(id = "courseid") - private WebElement courseIdTextBox; - - @FindBy(id = "coursename") - private WebElement courseNameTextBox; - - @FindBy(id = "btnSaveCourse") - private WebElement saveCourseButton; - - @FindBy(id = "courseEditLink") - private WebElement editCourseLink; - - @FindBy(id = "courseDeleteLink") - private WebElement deleteCourseLink; - - @FindBy(id = "btnShowNewInstructorForm") - private WebElement showNewInstructorFormButton; - - @FindBy(id = "instructorname") - private WebElement newInstructorNameTextBox; - - @FindBy(id = "instructoremail") - private WebElement newInstructorEmailTextBox; - - @FindBy(xpath = "//form[@name='formAddInstructor']" - + "//input[@name='instructordisplayname']") - private WebElement newInstructorDisplayNameTextBox; - - @FindBy(id = "btnAddInstructor") - private WebElement addInstructorButton; - - public InstructorCourseEditPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Edit Course Details

    "); - } - - public String getCourseId() { - return courseIdTextBox.getAttribute("value"); - } - - public InstructorCourseEditPage verifyIsCorrectPage(String courseId) { - assertEquals(courseId, getCourseId()); - return this; - } - - public void addNewInstructor(String name, String email) { - clickShowNewInstructorFormButton(); - - fillNewInstructorName(name); - fillNewInstructorEmail(email); - - click(addInstructorButton); - waitForPageToLoad(); - } - - /** - * Clicks edit button, changes and saves instructor details for given instructor index - * Instructor email will not be edited when editing a yet-to-join instructor. - * Instructor display name will not be edited if instructor is not displayed to other students. - */ - public void editInstructor(int instrNum, String name, String email, - Boolean isDisplayedToStudents, String displayName, String role) { - clickEditInstructorLink(instrNum); - - editInstructorName(instrNum, name); - if (getEmailField(instrNum).getAttribute("readonly") == null) { - editInstructorEmail(instrNum, email); - } - editInstructorDisplayedToStudents(instrNum, isDisplayedToStudents); - if (isDisplayedToStudents) { - editInstructorDisplayName(instrNum, displayName); - } - selectRoleForInstructor(instrNum, role); - - saveEditInstructor(instrNum); - waitForPageToLoad(); - } - - public void clickSaveInstructorButton(int instrNum) { - WebElement button = browser.driver.findElement(By.id("btnSaveInstructor" + instrNum)); - click(button); - waitForPageToLoad(); - } - - public String editInstructorName(int instrNum, String value) { - WebElement editPanelNameTextBox = getNameField(instrNum); - fillTextBox(editPanelNameTextBox, value); - return getTextBoxValue(editPanelNameTextBox); - } - - public String editInstructorEmail(int instrNum, String value) { - WebElement editPanelEmailTextBox = getEmailField(instrNum); - fillTextBox(editPanelEmailTextBox, value); - return getTextBoxValue(editPanelEmailTextBox); - } - - public boolean editInstructorDisplayedToStudents(int instrNum, Boolean isDisplayedToStudents) { - WebElement editPanelDisplayedToStudentsCheckbox = getDisplayedToStudentCheckBox(instrNum); - if (isDisplayedToStudents) { - markCheckBoxAsChecked(editPanelDisplayedToStudentsCheckbox); - } else { - markCheckBoxAsUnchecked(editPanelDisplayedToStudentsCheckbox); - } - return editPanelDisplayedToStudentsCheckbox.isSelected(); - } - - public String editInstructorDisplayName(int instrNum, String value) { - WebElement editPanelDisplayNameTextBox = getDisplayNameField(instrNum); - fillTextBox(editPanelDisplayNameTextBox, value); - return getTextBoxValue(editPanelDisplayNameTextBox); - } - - public String fillNewInstructorName(String value) { - fillTextBox(newInstructorNameTextBox, value); - return getTextBoxValue(newInstructorNameTextBox); - } - - public String getNewInstructorName() { - return getTextBoxValue(newInstructorNameTextBox); - } - - public String fillNewInstructorEmail(String value) { - fillTextBox(newInstructorEmailTextBox, value); - return getTextBoxValue(newInstructorEmailTextBox); - } - - public String getNewInstructorEmail() { - return getTextBoxValue(newInstructorEmailTextBox); - } - - public String fillNewInstructorDisplayName(String value) { - fillTextBox(newInstructorDisplayNameTextBox, value); - return getTextBoxValue(newInstructorDisplayNameTextBox); - } - - public void clickEditInstructorLink(int instrNum) { - click(getEditInstructorLink(instrNum)); - WebElement saveButton = getSaveInstructorButton(instrNum); - waitForElementVisibility(saveButton); - } - - public void clickEditInstructorLinkUnsuccessfully(int instrNum) { - click(getEditInstructorLink(instrNum)); - } - - public boolean isInstructorEditable(int instrNum) { - WebElement editInstructorNameTextBox = getNameField(instrNum); - WebElement editInstructorEmailTextBox = getEmailField(instrNum); - - return editInstructorNameTextBox.isEnabled() && editInstructorEmailTextBox.isEnabled(); - } - - public void clickCancelEditInstructorLink(int instrNum) { - click(getCancelEditInstructorLink(instrNum)); - } - - public void clickCancelAddInstructorLink() { - click(getCancelAddInstructorLink()); - } - - public void verifyInstructorEditFormDisabled(int instrNum) { - waitForElementToDisappear(By.id("btnSaveInstructor" + instrNum)); - - WebElement editInstructorNameTextBox = getNameField(instrNum); - WebElement editInstructorEmailTextBox = getEmailField(instrNum); - - boolean isNotEditable = !editInstructorNameTextBox.isEnabled() - && !editInstructorEmailTextBox.isEnabled(); - - assertTrue(isNotEditable); - } - - public boolean verifyAddInstructorFormDisplayed() { - WebElement newInstructorForm = browser.driver.findElement(By.id("panelAddInstructor")); - return newInstructorForm.isDisplayed(); - } - - public boolean verifyAddInstructorFormDefaultValues(int newInstructorIndex) { - String checkbox = browser.driver.findElement(By.name( - Const.ParamsNames.INSTRUCTOR_IS_DISPLAYED_TO_STUDENT)).getAttribute("value"); - String instructorName = browser.driver.findElement(By.name( - Const.ParamsNames.INSTRUCTOR_DISPLAY_NAME)).getAttribute("value"); - String instructorRole = browser.driver.findElement(By.id( - Const.ParamsNames.INSTRUCTOR_ROLE_NAME + "forinstructor" - + newInstructorIndex)).getAttribute("value"); - - return "true".equals(checkbox) && "Instructor".equals(instructorName) - && instructorRole.equals(Const.InstructorPermissionRoleNames - .INSTRUCTOR_PERMISSION_ROLE_COOWNER); // default values taken from courseEditAddInstructorPanel.tag - } - - /** - * Verifies that the instructor details fields for the given {@code instrNum} contain the updated values. - * If {@code newIsDisplayedToStudents} is true, the display name field is checked against {@code newDisplayName}. - * Otherwise, it is verified that the display name field's placeholder is shown as expected. - */ - public void verifyInstructorDetails(int instrNum, String newName, String newEmail, - boolean newIsDisplayedToStudents, String newDisplayName, String newRole) { - assertEquals(newName, getInstructorName(instrNum)); - assertEquals(newEmail, getInstructorEmail(instrNum)); - assertEquals(newIsDisplayedToStudents, getInstructorDisplayedToStudents(instrNum)); - if (newIsDisplayedToStudents) { - assertEquals(newDisplayName, getInstructorDisplayName(instrNum)); - } else { - assertEquals("(This instructor will NOT be displayed to students)", - getDisplayNameField(instrNum).getAttribute("placeholder")); - } - assertEquals(newRole, getInstructorAccessLevel(instrNum)); - } - - public void saveEditInstructor(int instrNum) { - click(getSaveInstructorButton(instrNum)); - } - - public void clickDisplayedToStudentCheckBox(int instrNum) { - click(getDisplayedToStudentCheckBox(instrNum)); - } - - public void selectRoleForInstructor(int instrNum, String role) { - WebElement roleRadioButton = browser.driver.findElement(By.cssSelector( - "input[id='instructorroleforinstructor" + instrNum + "'][value='" + role + "']")); - click(roleRadioButton); - } - - public void selectRoleForNewInstructor(int newInstructorIndex, String role) { - WebElement roleRadioButton = browser.driver.findElement(By.cssSelector( - "input[id='instructorroleforinstructor" + newInstructorIndex + "'][value='" + role + "']")); - click(roleRadioButton); - } - - public boolean isRoleSelectedForInstructor(int instrNum, String role) { - return browser.driver.findElement(By.cssSelector( - "input[id='instructorroleforinstructor" + instrNum + "'][value='" + role + "']")).isSelected(); - } - - public void clickViewDetailsLinkForInstructor(int instrNum, int viewLinkNum) { - /* - * There are groups of 3 elements: - * : radio button - * : the details link - *
    : break line - * Therefore the formula for the position of the details link of the group i-th (count from 0) is i * 3 + 2 - */ - int cssLinkNum = viewLinkNum * 3 + 2; - WebElement viewLink = - browser.driver.findElement( - By.cssSelector("#accessControlEditDivForInstr" + instrNum - + " > div.form-group > div.col-sm-9 > a:nth-child(" + cssLinkNum + ")")); - - click(viewLink); - waitForPageToLoad(); - } - - public void closeModal() { - WebElement closeButton = browser.driver.findElement(By.className("close")); - waitForElementToBeClickable(closeButton); - click(closeButton); - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - } - - public boolean isPrivilegeCheckboxInModalChecked(String privilege) { - By selector = By.cssSelector("#tunePermissionsDivForInstructorAll input[type='checkbox'][name='" - + privilege + "']"); - WebElement checkbox = browser.driver.findElement(selector); - return checkbox.isSelected(); - } - - public boolean isPrivilegeCheckboxInPermissionDivChecked(int instructorIndex, String privilege) { - By selector = By.cssSelector("#tunePermissionsDivForInstructor" + instructorIndex - + " input[type='checkbox'][name='" + privilege + "']"); - WebElement checkbox = browser.driver.findElement(selector); - return checkbox.isSelected(); - } - - public void clickCourseLevelPrivilegesLink(int instrNum, int linkNum) { - WebElement coursePanel = getCourseLevelPanel(instrNum); - click(coursePanel.findElements(By.cssSelector("input[type='checkbox']")).get(linkNum)); - } - - public void clickAddSectionLevelPrivilegesLink(int instrNum) { - click(getAddSectionLevelPrivilegesLink(instrNum)); - } - - public void clickSectionSelectionCheckBox(int instrNum, int sectionLevelIndex, int sectionNum) { - click(getSectionSelectionCheckBox(instrNum, sectionLevelIndex, sectionNum)); - } - - public void clickSectionLevelPrivilegeLink(int instrNum, int sectionLevelIndex, int linkNum) { - click(getSectionLevelPanelCheckBox(instrNum, sectionLevelIndex, linkNum)); - } - - public boolean isSectionLevelPrivilegeLinkClicked(int instrNum, int sectionLevelIndex, int linkNum) { - return getSectionLevelPanelCheckBox(instrNum, sectionLevelIndex, linkNum).isSelected(); - } - - public void clickSessionLevelPrivilegeLink(int instrNum, int sectionLevelIndex, - int sessionIndex, int linkNum) { - click(getSessionLevelTableCheckbox(instrNum, sectionLevelIndex, sessionIndex, linkNum)); - } - - public boolean isSessionLevelPrivilegeLinkClicked(int instrNum, int sectionLevelIndex, - int sessionIndex, int linkNum) { - return getSessionLevelTableCheckbox(instrNum, sectionLevelIndex, sessionIndex, linkNum).isSelected(); - } - - public void clickSessionLevelInSectionLevel(int instrNum, int sectionLevelIndex) { - String linkId = "toggleSessionLevelInSection" + sectionLevelIndex + "ForInstructor" + instrNum; - click(browser.driver.findElement(By.id(linkId))); - } - - public void clickHideSectionLevelPrivileges(int instrNum, int sectionLevelIndex) { - click(getSectionLevelPanel(instrNum, sectionLevelIndex).findElement(By.cssSelector(".glyphicon-trash"))); - } - - public boolean isTuneSessionPermissionsDivVisible(int instrNum, int sectionLevelIndex) { - String sessionPermissionsDivId = "tuneSessionPermissionsDiv" + sectionLevelIndex - + "ForInstructor" + instrNum; - return isElementVisible(By.id(sessionPermissionsDivId)); - } - - public boolean isTunePermissionsDivVisible(int instrNum) { - String sessionPermissionsDivId = "tunePermissionsDivForInstructor" + instrNum; - return isElementVisible(By.id(sessionPermissionsDivId)); - } - - public boolean clickShowNewInstructorFormButton() { - click(showNewInstructorFormButton); - - return newInstructorNameTextBox.isEnabled() - && newInstructorEmailTextBox.isEnabled() - && addInstructorButton.isDisplayed(); - } - - public boolean isInstructorListSortedByName() { - boolean isSorted = true; - List instructorNames = new ArrayList<>(); - List elements = browser.driver.findElements(By.xpath("//*[starts-with(@id, 'instructorname')]")); - for (int i = 1; i < elements.size(); i++) { - instructorNames.add(browser.driver.findElement(By.id("instructorname" + i)).getAttribute("value")); - } - for (int i = 1; i < instructorNames.size(); i++) { - if (instructorNames.get(i - 1).compareTo(instructorNames.get(i)) > 0) { - isSorted = false; - } - } - return isSorted; - } - - public boolean clickOnNewInstructorAccessLevelViewDetails(String role) { - WebElement instructorForm = browser.driver.findElement(By.id("formAddInstructor")); - - WebElement viewDetailsLink = instructorForm.findElement(By.xpath( - "//a[contains(@class, 'view-role-details')][@data-role='" + role + "']")); - click(viewDetailsLink); - - WebElement viewDetailsModal = browser.driver.findElement(By.cssSelector( - "div#tunePermissionsDivForInstructorAll")); - waitForElementVisibility(viewDetailsModal); - - if ("display: block;".equals(viewDetailsModal.getAttribute("style"))) { - closeModal(); - return true; - } - return false; - } - - public void clickAddInstructorButton() { - click(addInstructorButton); - waitForPageToLoad(); - } - - public void clickInviteInstructorLink(int instrNum) { - click(getInviteInstructorLink(instrNum)); - waitForConfirmationModalAndClickOk(); - waitForPageToLoad(); - } - - /** - * Clicks the button to edit the course. - */ - public void clickEditCourseLink() { - click(editCourseLink); - waitForElementVisibility(saveCourseButton); - } - - /** - * Clicks the save changes button to save the changes made to the course. - */ - public void clickSaveCourseButton() { - click(saveCourseButton); - waitForPageToLoad(); - } - - public void editCourseName(String value) { - fillTextBox(courseNameTextBox, value); - } - - public InstructorCoursesPage clickDeleteCourseLink() { - click(deleteCourseLink); - waitForPageToLoad(); - return changePageType(InstructorCoursesPage.class); - } - - /** - * Click the delete instructor button at position {@code instrNum} and click "Yes" in the follow up dialog. - * @param instrNum is the position of the instructor (e.g. 1, 2, 3, ...) - */ - public void clickDeleteInstructorLinkAndConfirm(int instrNum) { - WebElement deleteInstructorLink = getDeleteInstructorLink(instrNum); - clickAndConfirm(deleteInstructorLink); - waitForPageToLoad(); - } - - /** - * Click the delete instructor button at position {@code instrNum} and click "No" in the follow up dialog. - * @param instrNum is the position of the instructor (e.g. 1, 2, 3, ...) - */ - public void clickDeleteInstructorLinkAndCancel(int instrNum) { - WebElement deleteInstructorLink = getDeleteInstructorLink(instrNum); - clickAndCancel(deleteInstructorLink); - } - - /** - * Checks if the course edit form is enabled. - * @return true if the course edit form is enabled - */ - public boolean isCourseEditFormEnabled() { - return !courseIdTextBox.isEnabled() && courseNameTextBox.isEnabled() && saveCourseButton.isDisplayed(); - } - - public void changeCourseIdInForm(int instrNum, String newCourseId) { - String selector = "$('#edit-" + instrNum + " input[name=\"" + Const.ParamsNames.COURSE_ID + "\"]')"; - String action = ".val('" + newCourseId + "')"; - executeScript(selector + action); - } - - // methods that return WebElements of the page go here - - public WebElement getEditInstructorLink(int instrNum) { - return browser.driver.findElement(By.id("instrEditLink" + instrNum)); - } - - public WebElement getCancelEditInstructorLink(int instrNum) { - return browser.driver.findElement(By.id("instrCancelLink" + instrNum)); - } - - public WebElement getCancelAddInstructorLink() { - return browser.driver.findElement(By.id("cancelAddInstructorLink")); - } - - private WebElement getInviteInstructorLink(int instrNum) { - return browser.driver.findElement(By.id("instrRemindLink" + instrNum)); - } - - public WebElement getDeleteInstructorLink(int instrNum) { - return browser.driver.findElement(By.id("instrDeleteLink" + instrNum)); - } - - public WebElement getSaveInstructorButton(int instrNum) { - return browser.driver.findElement(By.id("btnSaveInstructor" + instrNum)); - } - - public WebElement getNameField(int instrNum) { - return browser.driver.findElement(By.id("instructorname" + instrNum)); - } - - public WebElement getEmailField(int instrNum) { - return browser.driver.findElement(By.id("instructoremail" + instrNum)); - } - - public WebElement getDisplayedToStudentCheckBox(int instrNum) { - return browser.driver.findElement(By.cssSelector("#instructorTable" + instrNum + " input[name='" - + Const.ParamsNames.INSTRUCTOR_IS_DISPLAYED_TO_STUDENT - + "']")); - } - - public WebElement getDisplayNameField(int instrNum) { - String displayNameFieldSelector = "#instructorTable" + instrNum + " input[name='" - + Const.ParamsNames.INSTRUCTOR_DISPLAY_NAME - + "']"; - return browser.driver.findElement(By.cssSelector(displayNameFieldSelector)); - } - - public String getInstructorName(int instrNum) { - return browser.driver.findElement(By.id("instructorname" + instrNum)).getAttribute("value"); - } - - public String getInstructorEmail(int instrNum) { - return browser.driver.findElement(By.id("instructoremail" + instrNum)).getAttribute("value"); - } - - public boolean getInstructorDisplayedToStudents(int instrNum) { - String isDisplayedToStudentsCheckboxSelector = "#instructorTable" + instrNum + " input[name='" - + Const.ParamsNames.INSTRUCTOR_IS_DISPLAYED_TO_STUDENT - + "']"; - return browser.driver.findElement(By.cssSelector(isDisplayedToStudentsCheckboxSelector)).isSelected(); - } - - public String getInstructorDisplayName(int instrNum) { - String displayNameFieldSelector = "#instructorTable" + instrNum + " input[name='" - + Const.ParamsNames.INSTRUCTOR_DISPLAY_NAME - + "']"; - return browser.driver.findElement(By.cssSelector(displayNameFieldSelector)).getAttribute("value"); - } - - public String getInstructorAccessLevel(int instrNum) { - return browser.driver.findElement(By.cssSelector("#accessControlInfoForInstr" + instrNum + " span")).getText(); - } - - public WebElement getCourseLevelPanel(int instrNum) { - String permissionDivId = "tunePermissionsDivForInstructor" + instrNum; - return browser.driver.findElement(By.id(permissionDivId)) - .findElement(By.cssSelector("div.form-group>div>div.panel")); - } - - public WebElement getAddSectionLevelPrivilegesLink(int instrNum) { - return browser.driver.findElement(By.id("addSectionLevelForInstructor" + instrNum)); - } - - public WebElement getSectionLevelPanel(int instrNum, int sectionLevelIndex) { - String permissionDivId = "tuneSectionPermissionsDiv" + sectionLevelIndex + "ForInstructor" + instrNum; - return browser.driver.findElement(By.id(permissionDivId)); - } - - private WebElement getSectionLevelPanelBody(int instrNum, int sectionLevelIndex) { - WebElement sectionPanel = getSectionLevelPanel(instrNum, sectionLevelIndex); - return sectionPanel.findElement(By.cssSelector("div[class='panel-body']")); - } - - private WebElement getSectionSelectionCheckBox(int instrNum, int sectionLevelIndex, int sectionNum) { - WebElement sectionPanel = getSectionLevelPanel(instrNum, sectionLevelIndex); - String cssSelector = "input[name='" + Const.ParamsNames.INSTRUCTOR_SECTION_GROUP - + sectionLevelIndex + Const.ParamsNames.INSTRUCTOR_SECTION + sectionNum + "']"; - return sectionPanel.findElement(By.cssSelector(cssSelector)); - } - - private WebElement getSectionLevelPanelCheckBox(int instrNum, int sectionLevelIndex, int checkBoxIndex) { - WebElement sectionPanelBody = getSectionLevelPanelBody(instrNum, sectionLevelIndex); - return sectionPanelBody.findElements(By.cssSelector("input[type='checkbox']")).get(checkBoxIndex); - } - - private WebElement getSessionLevelTableBody(int instrNum, int sectionLevelIndex) { - WebElement sectionPanelBody = getSectionLevelPanelBody(instrNum, sectionLevelIndex); - return sectionPanelBody.findElement(By.cssSelector("table")); - } - - private WebElement getSessionLevelTableRow(int instrNum, int sectionLevelIndex, int sessionIndex) { - WebElement sessionLevelTableBody = getSessionLevelTableBody(instrNum, sectionLevelIndex); - return sessionLevelTableBody.findElements(By.cssSelector("tbody tr")).get(sessionIndex); - } - - private WebElement getSessionLevelTableCheckbox(int instrNum, int sectionLevelIndex, - int sessionIndex, int checkBoxIndex) { - WebElement sessionLevelTableRow = getSessionLevelTableRow(instrNum, sectionLevelIndex, sessionIndex); - return sessionLevelTableRow.findElements(By.cssSelector("input[type='checkbox']")).get(checkBoxIndex); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCourseEnrollPage.java b/src/test/java/teammates/test/pageobjects/InstructorCourseEnrollPage.java deleted file mode 100644 index 1e28d0a3045..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCourseEnrollPage.java +++ /dev/null @@ -1,51 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertTrue; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -public class InstructorCourseEnrollPage extends AppPage { - - @FindBy(id = "enrollstudents") - private WebElement enrollTextBox; - - @FindBy(id = "button_enroll") - private WebElement enrollButton; - - public InstructorCourseEnrollPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - // Intentional check for opening h1 and not closing h1 because the following content is not static - return getPageSource().contains("

    Enroll Students for"); - } - - public InstructorCourseEnrollPage verifyIsCorrectPage(String courseId) { - assertTrue(getPageSource().contains("Enroll Students for " + courseId)); - return this; - } - - public String getEnrollText() { - return getTextBoxValue(enrollTextBox); - } - - public InstructorCourseEnrollResultPage enroll(String enrollString) { - fillSpreadsheet(enrollString); - click(enrollButton); - waitForPageToLoad(); - return changePageType(InstructorCourseEnrollResultPage.class); - } - - public InstructorCourseEnrollPage enrollUnsuccessfully(String enrollString) { - fillSpreadsheet(enrollString); - click(enrollButton); - waitForPageToLoad(); - return this; - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCourseEnrollResultPage.java b/src/test/java/teammates/test/pageobjects/InstructorCourseEnrollResultPage.java deleted file mode 100644 index ae70a5026f8..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCourseEnrollResultPage.java +++ /dev/null @@ -1,29 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -public class InstructorCourseEnrollResultPage extends AppPage { - - @FindBy(id = "edit_enroll") - private WebElement editLink; - - public InstructorCourseEnrollResultPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - // Intentional check for opening h1 and not closing h1 because the following content is not static - return getPageSource().contains("

    Enrollment Results for"); - } - - public InstructorCourseEnrollPage clickEditLink() { - click(editLink); - waitForPageToLoad(); - return changePageType(InstructorCourseEnrollPage.class); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCourseJoinConfirmationPage.java b/src/test/java/teammates/test/pageobjects/InstructorCourseJoinConfirmationPage.java deleted file mode 100644 index fe8a9ce818a..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCourseJoinConfirmationPage.java +++ /dev/null @@ -1,62 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.common.util.Const; -import teammates.common.util.retry.MaximumRetriesExceededException; -import teammates.common.util.retry.RetryableTask; -import teammates.e2e.pageobjects.Browser; - -public class InstructorCourseJoinConfirmationPage extends AppPage { - @FindBy(id = "button_confirm") - private WebElement confirmButton; - - @FindBy(id = "button_cancel") - private WebElement cancelButton; - - public InstructorCourseJoinConfirmationPage(Browser browser) { - super(browser); - } - - @Override - public boolean containsExpectedPageContents() { - return getPageSource().contains("

    Confirm your Google account

    "); - } - - public InstructorHomePage clickConfirmButton() { - clickConfirmButtonAndWaitForPageToLoad(); - return changePageType(InstructorHomePage.class); - } - - public InstructorHomePage clickConfirmButtonWithRetry() throws MaximumRetriesExceededException { - persistenceRetryManager.runUntilSuccessful(new RetryableTask("Course join") { - @Override - public void run() { - clickConfirmButtonAndWaitForPageToLoad(); - } - - @Override - public boolean isSuccessful() { - return isPageUri(Const.WebPageURIs.INSTRUCTOR_HOME_PAGE); - } - - @Override - public void beforeRetry() { - browser.driver.navigate().back(); - } - }); - return changePageType(InstructorHomePage.class); - } - - private void clickConfirmButtonAndWaitForPageToLoad() { - click(confirmButton); - waitForPageToLoad(); - } - - public HomePage clickCancelButton() { - click(cancelButton); - waitForPageToLoad(); - return changePageType(HomePage.class); - } -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCourseStudentDetailsEditPage.java b/src/test/java/teammates/test/pageobjects/InstructorCourseStudentDetailsEditPage.java deleted file mode 100644 index df16e46450b..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCourseStudentDetailsEditPage.java +++ /dev/null @@ -1,102 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -public class InstructorCourseStudentDetailsEditPage extends AppPage { - - @FindBy (id = "studentname") - private WebElement studentNameTextbox; - - @FindBy (id = "teamname") - private WebElement teamNameTextbox; - - @FindBy (id = "newstudentemail") - private WebElement studentEmailTextbox; - - @FindBy (id = "studentemail") - private WebElement studentEmailTextboxOriginal; - - @FindBy (id = "comments") - private WebElement commentsTextbox; - - @FindBy (id = "button_submit") - private WebElement submitButton; - - public InstructorCourseStudentDetailsEditPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Edit Student Details

    "); - } - - /** - * If the parameter value is not null, the value will be filled into the - * relevent input filed. - */ - public InstructorCourseDetailsPage submitSuccessfully(String studentName, String teamName, - String studentEmail, String comments) { - fillStudentDetailsForm(studentName, teamName, studentEmail, comments); - return changePageType(InstructorCourseDetailsPage.class); - } - - /** - * If the parameter value is not null, the value will be filled into the - * relevent input field. - */ - public InstructorCourseStudentDetailsEditPage submitUnsuccessfully( - String studentName, String teamName, String studentEmail, String comments) { - fillStudentDetailsForm(studentName, teamName, studentEmail, comments); - return this; - } - - /** - * If the parameter value is not null, the value will be filled into the - * relevant input field. - */ - private void fillStudentDetailsForm(String studentName, String teamName, String studentEmail, String comments) { - if (studentName != null) { - fillTextBox(studentNameTextbox, studentName); - } - if (teamName != null) { - fillTextBox(teamNameTextbox, teamName); - } - if (studentEmail != null) { - fillTextBox(studentEmailTextbox, studentEmail); - } - if (comments != null) { - fillTextBox(commentsTextbox, comments); - } - if (teamName == null) { - if (studentEmail == null) { - click(submitButton); - } else { - clickAndConfirm(submitButton); - } - - } else { - // if team name is edited, the confirmation dialog will pop up - clickAndConfirmWithoutWaitingForModalDisappearance(submitButton); - if (studentEmail != null) { - clickNoOnModal(); - } - } - } - - public void verifyIsCorrectPage(String email) { - assertTrue(containsExpectedPageContents()); - assertEquals(email, studentEmailTextboxOriginal.getAttribute("value")); - } - - public InstructorCourseDetailsPage submitButtonClicked() { - click(submitButton); - return changePageType(InstructorCourseDetailsPage.class); - } -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCourseStudentDetailsViewPage.java b/src/test/java/teammates/test/pageobjects/InstructorCourseStudentDetailsViewPage.java deleted file mode 100644 index 10994469da6..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCourseStudentDetailsViewPage.java +++ /dev/null @@ -1,30 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -public class InstructorCourseStudentDetailsViewPage extends AppPage { - - @FindBy (id = "studentemail") - private WebElement studentEmail; - - public InstructorCourseStudentDetailsViewPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("Enrollment Details"); - } - - public void verifyIsCorrectPage(String email) { - assertTrue(containsExpectedPageContents()); - assertEquals(email, studentEmail.getText()); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCoursesDetailsPage.java b/src/test/java/teammates/test/pageobjects/InstructorCoursesDetailsPage.java deleted file mode 100644 index 1d83ac0fe75..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCoursesDetailsPage.java +++ /dev/null @@ -1,24 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.e2e.pageobjects.Browser; - -public class InstructorCoursesDetailsPage extends AppPage { - - public InstructorCoursesDetailsPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Course Details

    "); - } - - public int getStudentCountForCourse() { - WebElement cellWithStudentCount = browser.driver.findElement(By.id("total_students")); - return Integer.parseInt(cellWithStudentCount.getText()); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorCoursesPage.java b/src/test/java/teammates/test/pageobjects/InstructorCoursesPage.java deleted file mode 100644 index 4534d9a77f6..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorCoursesPage.java +++ /dev/null @@ -1,317 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -/** Represents the "Courses" page for Instructors. */ -public class InstructorCoursesPage extends AppPage { - /* Explanation: This class follows the 'Page Objects Pattern' and as - * explained in https://code.google.com/p/selenium/wiki/PageObjects - * This class represents an abstraction for the 'Courses' page as - * shown in the Browser. The test class interact with this object when it - * wants to perform an action on the web page (e.g., click a button). - */ - - /* Explanation: These are the elements in the page that we want to interact - * with. The @FindBy annotation tells the PageFactory class - * (see https://code.google.com/p/selenium/wiki/PageFactory) how to find - * the element. - */ - @FindBy (id = "button_sortcoursename") - private WebElement sortByCourseNameIcon; - - @FindBy (id = "button_sortcourseid") - private WebElement sortByCourseIdIcon; - - @FindBy(id = "courseid") - private WebElement courseIdTextBox; - - @FindBy(id = "coursename") - private WebElement courseNameTextBox; - - @FindBy(id = "btnAddCourse") - private WebElement submitButton; - - @FindBy(id = "softDeletedPanelHeading") - private WebElement panelHeading; - - public InstructorCoursesPage(Browser browser) { - super(browser); - } - - /** Used to check if the loaded page is indeed the 'Courses' page. */ - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Add New Course

    "); - } - - /** - * If instructorsList is null, the current value in the page will be used instead. - */ - public InstructorCoursesPage addCourse(String courseId, String courseName) { - fillTextBox(courseIdTextBox, courseId); - fillTextBox(courseNameTextBox, courseName); - - click(submitButton); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage deleteCourse(String courseId) { - click(getDeleteLink(courseId)); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage archiveCourse(String courseId) { - click(getArchiveLink(courseId)); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage unarchiveCourse(String courseId) { - click(getUnarchiveLink(courseId)); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage moveCourseToRecycleBin(String courseId) { - click(getMoveToRecycleBinLink(courseId)); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage restoreCourse(String courseId) { - click(getRestoreLink(courseId)); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage restoreAllCourses() { - click(getRestoreAllLink()); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage deleteCourseAndCancel(String courseId) { - clickAndCancel(getDeleteLink(courseId)); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage deleteCourseAndConfirm(String courseId) { - clickAndConfirm(getDeleteLink(courseId)); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage deleteAllCoursesAndCancel() { - clickAndCancel(getDeleteAllLink()); - waitForPageToLoad(); - return this; - } - - public InstructorCoursesPage deleteAllCoursesAndConfirm() { - clickAndConfirm(getDeleteAllLink()); - waitForPageToLoad(); - return this; - } - - public String fillCourseIdTextBox(String value) { - fillTextBox(courseIdTextBox, value); - return getTextBoxValue(courseIdTextBox); - } - - public String fillCourseNameTextBox(String value) { - fillTextBox(courseNameTextBox, value); - return getTextBoxValue(courseNameTextBox); - } - - public void submitAndConfirm() { - clickAndConfirm(submitButton); - waitForPageToLoad(); - } - - public void submitAndCancel() { - clickAndCancel(submitButton); - waitForPageToLoad(); - } - - public WebElement getMoveToRecycleBinLink(String courseId) { - int courseRowNumber = getRowNumberOfCourse(courseId); - return getMoveToRecycleBinLinkInRow(courseRowNumber); - } - - public WebElement getArchiveLink(String courseId) { - int courseRowNumber = getRowNumberOfCourse(courseId); - return getArchiveLinkInRow(courseRowNumber); - } - - public WebElement getUnarchiveLink(String courseId) { - int courseRowNumber = getRowNumberOfCourse(courseId); - return getUnarchiveLinkInRow(courseRowNumber); - } - - public WebElement getRestoreLink(String courseId) { - click(panelHeading); - waitForElementVisibility(browser.driver.findElement(By.id("softdeletedcourseid0"))); - int courseRowNumber = getRowNumberOfSoftDeletedCourse(courseId); - return getRestoreLinkInRow(courseRowNumber); - } - - public WebElement getRestoreAllLink() { - return browser.driver.findElement(By.id("btn-course-restoreall")); - } - - public WebElement getDeleteLink(String courseId) { - click(panelHeading); - waitForElementVisibility(browser.driver.findElement(By.id("softdeletedcourseid0"))); - int courseRowNumber = getRowNumberOfSoftDeletedCourse(courseId); - return getDeleteLinkInRow(courseRowNumber); - } - - public WebElement getDeleteAllLink() { - return browser.driver.findElement(By.id("btn-course-deleteall")); - } - - public InstructorCoursesPage sortByCourseName() { - click(sortByCourseNameIcon); - return this; - } - - public InstructorCoursesPage sortByCourseId() { - click(sortByCourseIdIcon); - return this; - } - - public InstructorCourseEnrollPage loadEnrollLink(String courseId) { - int courseRowNumber = getRowNumberOfCourse(courseId); - return goToLinkInRow( - By.className("t_course_enroll" + courseRowNumber), - InstructorCourseEnrollPage.class); - } - - public InstructorCourseDetailsPage loadViewLink(String courseId) { - int courseRowNumber = getRowNumberOfCourse(courseId); - return goToLinkInRow( - By.className("t_course_view" + courseRowNumber), - InstructorCourseDetailsPage.class); - } - - public InstructorCourseEditPage loadEditLink(String courseId) { - int courseRowNumber = getRowNumberOfCourse(courseId); - return goToLinkInRow( - By.className("t_course_edit" + courseRowNumber), - InstructorCourseEditPage.class); - } - - public void changeUserIdInAjaxLoadCoursesForm(String newUserId) { - By element = By.id("ajaxForCourses"); - waitForElementPresence(element); - executeScript("$('#ajaxForCourses [name=\"user\"]').val('" + newUserId + "')"); - } - - public void changeHrefInAjaxLoadCourseStatsLink(String newLink) { - By element = By.id("ajaxForCourses"); - waitForElementPresence(element); - executeScript("$('td[id^=\"course-stats\"] > a').attr('href', '" + newLink + "')"); - } - - public void triggerAjaxLoadCourses() { - By element = By.id("ajaxForCourses"); - waitForElementPresence(element); - executeScript("$('#ajaxForCourses').trigger('submit')"); - } - - public void triggerAjaxLoadCourseStats(int rowIndex) { - executeScript("$('.course-stats-link-" + rowIndex + "').first().trigger('click')"); - } - - public void waitForAjaxLoadCoursesError() { - By element = By.id("retryAjax"); - waitForElementPresence(element); - WebElement statusMessage = - browser.driver.findElement(By.id("statusMessagesToUser")).findElement(By.className("statusMessage")); - assertEquals("Courses could not be loaded. Click here to retry.", statusMessage.getText()); - } - - public void waitForAjaxLoadCoursesSuccess() { - By element = By.id("tableActiveCourses"); - waitForElementPresence(element); - } - - private int getCourseCount() { - By activeCoursesTable = By.id("tableActiveCourses"); - waitForElementPresence(activeCoursesTable); - return browser.driver.findElement(activeCoursesTable).findElements(By.tagName("tr")).size(); - } - - private int getSoftDeletedCourseCount() { - By softDeletedCoursesTable = By.id("tableSoftDeletedCourses"); - waitForElementPresence(softDeletedCoursesTable); - return browser.driver.findElement(softDeletedCoursesTable).findElements(By.tagName("tr")).size(); - } - - private int getRowNumberOfCourse(String courseId) { - for (int i = 0; i < getCourseCount(); i++) { - if (getCourseIdCell(i).getText().equals(courseId)) { - return i; - } - } - return -1; - } - - private int getRowNumberOfSoftDeletedCourse(String courseId) { - for (int i = 0; i < getSoftDeletedCourseCount(); i++) { - if (getSoftDeletedCourseIdCell(i).getText().equals(courseId)) { - return i; - } - } - return -1; - } - - private WebElement getCourseIdCell(int rowId) { - return browser.driver.findElement(By.id("courseid" + rowId)); - } - - private WebElement getSoftDeletedCourseIdCell(int rowId) { - return browser.driver.findElement(By.id("softdeletedcourseid" + rowId)); - } - - private WebElement getMoveToRecycleBinLinkInRow(int rowId) { - By moveToRecycleBinLink = By.className("t_course_delete" + rowId); - return browser.driver.findElement(moveToRecycleBinLink); - } - - private WebElement getArchiveLinkInRow(int rowId) { - By archiveLink = By.className("t_course_archive" + rowId); - return browser.driver.findElement(archiveLink); - } - - private WebElement getUnarchiveLinkInRow(int rowId) { - By archiveLink = By.id("t_course_unarchive" + rowId); - return browser.driver.findElement(archiveLink); - } - - private WebElement getRestoreLinkInRow(int rowId) { - By restoreLink = By.className("t_course_restore" + rowId); - return browser.driver.findElement(restoreLink); - } - - private WebElement getDeleteLinkInRow(int rowId) { - By deleteLink = By.className("t_course_delete_permanently" + rowId); - return browser.driver.findElement(deleteLink); - } - - private T goToLinkInRow(By locator, Class destinationPageType) { - click(browser.driver.findElement(locator)); - waitForPageToLoad(); - return changePageType(destinationPageType); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorEditStudentFeedbackPage.java b/src/test/java/teammates/test/pageobjects/InstructorEditStudentFeedbackPage.java deleted file mode 100644 index 7500136e9f2..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorEditStudentFeedbackPage.java +++ /dev/null @@ -1,48 +0,0 @@ -package teammates.test.pageobjects; - -import java.io.IOException; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -/** - * InstructorEditStudentFeedbackPage is a page object to represent the page seen by a instructor - * when moderating feedback. - * - *

    It inherits the methods and attributes from {@link FeedbackSubmitPage} as the page is - * built upon the feedback submission page seen by students/instructors. - * - * @see FeedbackSubmitPage - */ -public class InstructorEditStudentFeedbackPage extends FeedbackSubmitPage { - - @FindBy(id = "moderationHintButton") - private WebElement moderationHintButton; - - @FindBy(id = "moderationHint") - private WebElement moderationHint; - - public InstructorEditStudentFeedbackPage(Browser browser) { - super(browser); - } - - public void clickModerationHintButton() { - click(moderationHintButton); - } - - public boolean isModerationHintVisible() { - return moderationHint.isDisplayed(); - } - - public void verifyModerationHeaderHtml(String filePathParam) throws IOException { - verifyHtmlPart(By.className("navbar"), filePathParam); - } - - public String getModerationHintButtonText() { - return moderationHintButton.getText(); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorFeedbackEditPage.java b/src/test/java/teammates/test/pageobjects/InstructorFeedbackEditPage.java deleted file mode 100644 index 438ea0c7959..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorFeedbackEditPage.java +++ /dev/null @@ -1,2305 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.text.ParseException; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.format.TextStyle; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.Select; -import org.openqa.selenium.support.ui.WebDriverWait; - -import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.util.Const; -import teammates.common.util.StringHelper; -import teammates.common.util.TimeHelper; -import teammates.e2e.pageobjects.Browser; -import teammates.e2e.util.TestProperties; -import teammates.test.driver.TimeHelperExtension; - -public class InstructorFeedbackEditPage extends AppPage { - - public static final int NEW_QUESTION_NUM = -1; - - @FindBy(id = "starttime") - private WebElement startTimeDropdown; - - @FindBy(id = "startdate") - private WebElement startDateBox; - - @FindBy(id = "endtime") - private WebElement endTimeDropdown; - - @FindBy(id = "enddate") - private WebElement endDateBox; - - @FindBy(id = "timezone") - private WebElement timezoneDropDown; - - @FindBy(id = "graceperiod") - private WebElement gracePeriodDropdown; - - @FindBy(id = "editUncommonSettingsSessionResponsesVisibleButton") - private WebElement uncommonSettingsSessionResponsesVisibleButton; - - @FindBy(id = "editUncommonSettingsSendEmailsButton") - private WebElement uncommonSettingsSendEmailsButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON + "_custom") - private WebElement customSessionVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + "_custom") - private WebElement customResultsVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON + "_atopen") - private WebElement defaultSessionVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + "_atvisible") - private WebElement defaultResultsVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + "_later") - private WebElement manualResultsVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SENDREMINDEREMAIL + "_closing") - private WebElement closingSessionEmailReminderButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SENDREMINDEREMAIL + "_published") - private WebElement publishedSessionEmailReminderButton; - - @FindBy(id = "fsEditLink") - private WebElement fsEditLink; - - @FindBy(id = "fsSaveLink") - private WebElement fsSaveLink; - - @FindBy(id = "button_fsdelete") - private WebElement fsDeleteLink; - - @FindBy(id = "button_openframe") - private WebElement openNewQuestionButton; - - @FindBy(id = "button_submit_add") - private WebElement addNewQuestionButton; - - @FindBy(id = "button_add_template_modal") - private WebElement addTemplateModalLoadButton; - - @FindBy(id = "button_add_template_submit") - private WebElement addTemplateQuestionButton; - - @FindBy(id = "button_done_editing") - private WebElement doneEditingButton; - - @FindBy(id = "questiontext-" + NEW_QUESTION_NUM) - private WebElement questionTextBoxForNewQuestion; - - @FindBy(id = "mcqOtherOptionFlag-" + NEW_QUESTION_NUM) - private WebElement addMcqOtherOptionCheckboxForNewQuestion; - - @FindBy(id = "msqOtherOptionFlag-" + NEW_QUESTION_NUM) - private WebElement addMsqOtherOptionCheckboxForNewQuestion; - - @FindBy(id = "givertype-" + NEW_QUESTION_NUM) - private WebElement giverDropdownForNewQuestion; - - @FindBy(id = "recipienttype-" + NEW_QUESTION_NUM) - private WebElement recipientDropdownForNewQuestion; - - @FindBy(xpath = "//input[@name='numofrecipientstype' and @value='max']") - private WebElement maxNumOfRecipients; - - @FindBy(xpath = "//input[@name='numofrecipientstype' and @value='custom']") - private WebElement customNumOfRecipients; - - @FindBy(id = "button_fscopy") - private WebElement fscopyButton; - - @FindBy(id = "button_copy") - private WebElement copyQuestionLoadButton; - - @FindBy(id = "button_copy_submit") - private WebElement copyQuestionSubmitButton; - - @FindBy(id = "button_preview_student") - private WebElement previewAsStudentButton; - - @FindBy(id = "button_preview_instructor") - private WebElement previewAsInstructorButton; - - private InstructorCopyFsToModal fsCopyToModal; - - public InstructorFeedbackEditPage(Browser browser) { - super(browser); - fsCopyToModal = new InstructorCopyFsToModal(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Edit Feedback Session

    "); - } - - public InstructorCopyFsToModal getFsCopyToModal() { - return fsCopyToModal; - } - - public String getCourseId() { - return browser.driver.findElement(By.name("courseid")).getAttribute("value"); - } - - public String getFeedbackSessionName() { - return browser.driver.findElement(By.name("fsname")).getAttribute("value"); - } - - /** - * Returns number of question edit forms + question add form. - */ - public int getNumberOfQuestionEditForms() { - return browser.driver.findElements(By.className("questionTable")).size(); - } - - public boolean isCorrectPage(String courseId, String feedbackSessionName) { - boolean isCorrectCourseId = this.getCourseId().equals(courseId); - boolean isCorrectFeedbackSessionName = this.getFeedbackSessionName().equals(feedbackSessionName); - return isCorrectCourseId && isCorrectFeedbackSessionName && containsExpectedPageContents(); - } - - public void fillQuestionTextBox(String qnText, int qnIndex) { - WebElement questionTextBox = browser.driver.findElement(By.id("questiontext-" + qnIndex)); - fillTextBox(questionTextBox, qnText); - } - - public void fillQuestionTextBoxForNewQuestion(String qnText) { - fillTextBox(questionTextBoxForNewQuestion, qnText); - } - - public void fillQuestionDescription(String qnDescription, int qnIndex) { - fillRichTextEditor(Const.ParamsNames.FEEDBACK_QUESTION_DESCRIPTION + "-" + qnIndex, qnDescription); - } - - public void fillQuestionDescriptionForNewQuestion(String qnDescription) { - fillQuestionDescription(qnDescription, NEW_QUESTION_NUM); - } - - public void fillNumOfEntitiesToGiveFeedbackToBoxForNewQuestion(String num) { - WebElement questionForm = browser.driver.findElement(By.id("form_editquestion-" + NEW_QUESTION_NUM)); - WebElement numberOfRecipients = questionForm.findElement(By.className("numberOfEntitiesBox")); - fillTextBox(numberOfRecipients, num); - } - - public String getQuestionBoxText(int qnIndex) { - WebElement questionEditTextBox = browser.driver.findElement(By.id("questiontext-" + qnIndex)); - return getTextBoxValue(questionEditTextBox); - } - - private String getIdSuffix(int qnNumber) { - boolean isValid = qnNumber > 0 || qnNumber == NEW_QUESTION_NUM; - return isValid ? "-" + qnNumber : ""; - } - - public void fillMinNumScaleBox(String minScale, int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - - WebElement minScaleBox = browser.driver.findElement(By.id("minScaleBox" + idSuffix)); - fillTextBox(minScaleBox, minScale); - - executeScript("$(arguments[0]).change();", minScaleBox); - } - - public void fillMinNumScaleBox(int minScale, int qnNumber) { - fillMinNumScaleBox(Integer.toString(minScale), qnNumber); - } - - public void fillMinNumScaleBoxForNewQuestion(String minScale) { - fillMinNumScaleBox(minScale, NEW_QUESTION_NUM); - } - - public void fillMinNumScaleBoxForNewQuestion(int minScale) { - fillMinNumScaleBox(minScale, NEW_QUESTION_NUM); - } - - public void fillMaxNumScaleBox(String maxScale, int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - - WebElement maxScaleBox = browser.driver.findElement(By.id("maxScaleBox" + idSuffix)); - fillTextBox(maxScaleBox, maxScale); - - executeScript("$(arguments[0]).change();", maxScaleBox); - } - - public void fillMaxNumScaleBox(int maxScale, int qnNumber) { - fillMaxNumScaleBox(Integer.toString(maxScale), qnNumber); - } - - public void fillMaxNumScaleBoxForNewQuestion(String maxScale) { - fillMaxNumScaleBox(maxScale, NEW_QUESTION_NUM); - } - - public void fillMaxNumScaleBoxForNewQuestion(int maxScale) { - fillMaxNumScaleBox(maxScale, NEW_QUESTION_NUM); - } - - public String getMaxNumScaleBox(int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - WebElement maxScaleBox = browser.driver.findElement(By.id("maxScaleBox" + idSuffix)); - return maxScaleBox.getAttribute("value"); - } - - public String getMaxNumScaleBoxForNewQuestion() { - return getMaxNumScaleBox(NEW_QUESTION_NUM); - } - - public void fillStepNumScaleBox(String step, int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - - WebElement stepBox = browser.driver.findElement(By.id("stepBox" + idSuffix)); - fillTextBox(stepBox, step); - - executeScript("$(arguments[0]).change();", stepBox); - } - - public void fillStepNumScaleBox(double step, int qnNumber) { - fillStepNumScaleBox(StringHelper.toDecimalFormatString(step), qnNumber); - } - - public void fillStepNumScaleBoxForNewQuestion(String step) { - fillStepNumScaleBox(step, NEW_QUESTION_NUM); - } - - public void fillStepNumScaleBoxForNewQuestion(double step) { - fillStepNumScaleBox(step, NEW_QUESTION_NUM); - } - - public String getNumScalePossibleValuesString(int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - WebElement possibleValuesSpan = browser.driver.findElement(By.id("numScalePossibleValues" + idSuffix)); - return possibleValuesSpan.getText(); - } - - public String getNumScalePossibleValuesStringForNewQuestion() { - return getNumScalePossibleValuesString(-1); - } - - public void fillConstSumPointsBox(String points, int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - - WebElement pointsBox = browser.driver.findElement(By.id("constSumPoints" + idSuffix)); - // Backspace to clear the extra 100 when box is cleared. - fillTextBox(pointsBox, Keys.RIGHT + " " + Keys.BACK_SPACE + Keys.BACK_SPACE + Keys.BACK_SPACE + points); - - executeScript("$(arguments[0]).change();", pointsBox); - } - - public void fillConstSumPointsBoxForNewQuestion(String points) { - fillConstSumPointsBox(points, NEW_QUESTION_NUM); - } - - public String getConstSumPointsBox(int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - WebElement constSumPointsBox = browser.driver.findElement(By.id("constSumPoints" + idSuffix)); - return constSumPointsBox.getAttribute("value"); - } - - public String getConstSumPointsBoxForNewQuestion() { - return getConstSumPointsBox(NEW_QUESTION_NUM); - } - - public void fillConstSumPointsForEachOptionBox(String points, int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - - WebElement pointsBox = browser.driver.findElement(By.id("constSumPointsForEachOption" + idSuffix)); - // Backspace to clear the extra 100 when box is cleared. - fillTextBox(pointsBox, Keys.RIGHT + " " + Keys.BACK_SPACE + Keys.BACK_SPACE + Keys.BACK_SPACE + points); - - executeScript("$(arguments[0]).change();", pointsBox); - } - - public void fillConstSumPointsForEachOptionBoxForNewQuestion(String points) { - fillConstSumPointsForEachOptionBox(points, NEW_QUESTION_NUM); - } - - public String getConstSumPointsForEachOptionBox(int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - WebElement constSumPointsBox = browser.driver.findElement(By.id("constSumPointsForEachOption" + idSuffix)); - return constSumPointsBox.getAttribute("value"); - } - - public String getConstSumPointsForEachOptionBoxForNewQuestion() { - return getConstSumPointsForEachOptionBox(NEW_QUESTION_NUM); - } - - public void fillConstSumPointsForEachRecipientBox(String points, int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - - WebElement pointsBox = browser.driver.findElement(By.id("constSumPointsForEachRecipient" + idSuffix)); - // Backspace to clear the extra 100 when box is cleared. - fillTextBox(pointsBox, Keys.RIGHT + " " + Keys.BACK_SPACE + Keys.BACK_SPACE + Keys.BACK_SPACE + points); - - executeScript("$(arguments[0]).change();", pointsBox); - } - - public void fillConstSumPointsForEachRecipientBoxForNewQuestion(String points) { - fillConstSumPointsForEachRecipientBox(points, NEW_QUESTION_NUM); - } - - public String getConstSumPointsForEachRecipientBox(int qnNumber) { - String idSuffix = getIdSuffix(qnNumber); - WebElement constSumPointsBox = browser.driver.findElement(By.id("constSumPointsForEachRecipient" + idSuffix)); - return constSumPointsBox.getAttribute("value"); - } - - public String getConstSumPointsForEachRecipientBoxForNewQuestion() { - return getConstSumPointsForEachRecipientBox(NEW_QUESTION_NUM); - } - - public boolean isRubricColLeftMovable(int qnNumber, int colNumber) { - String elemId = Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_LEFT + "-" + qnNumber + "-" + colNumber; - WebElement moveColButton = browser.driver.findElement(By.id(elemId)); - - return moveColButton.getAttribute("disabled") == null; - } - - public boolean isRubricColRightMovable(int qnNumber, int colNumber) { - String elemId = Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_RIGHT + "-" + qnNumber + "-" + colNumber; - WebElement moveColButton = browser.driver.findElement(By.id(elemId)); - - return moveColButton.getAttribute("disabled") == null; - } - - /** - * Returns true if button is enabled and click was successful. - */ - public boolean moveRubricColLeft(int qnNumber, int colNumber) { - return moveRubricCol(qnNumber, colNumber, true); - } - - /** - * Returns true if button is enabled and click was successful. - */ - public boolean moveRubricColRight(int qnNumber, int colNumber) { - return moveRubricCol(qnNumber, colNumber, false); - } - - private boolean moveRubricCol(int qnNumber, int colNumber, boolean isMoveLeft) { - String elemId; - - if (isMoveLeft) { - elemId = Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_LEFT + "-" + qnNumber + "-" + colNumber; - } else { - elemId = Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_MOVE_COL_RIGHT + "-" + qnNumber + "-" + colNumber; - } - - WebElement moveColButton = browser.driver.findElement(By.id(elemId)); - - if (moveColButton.isEnabled()) { - click(moveColButton); - - return true; - } - - return false; - } - - private String getRubricSubQuestionSelectorId(int qnNumber, int subQnIndex) { - String idSuffix = getIdSuffix(qnNumber); - - return Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_SUBQUESTION + idSuffix + "-" + subQnIndex; - } - - public WebElement getRubricSubQuestionBox(int qnNumber, int subQnIndex) { - return browser.driver.findElement(By.id(getRubricSubQuestionSelectorId(qnNumber, subQnIndex))); - } - - private String getRubricChoice(int qnNumber, int colNumber) { - String idSuffix = getIdSuffix(qnNumber); - String elemId = Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE + idSuffix + "-" + colNumber; - - return browser.driver.findElement(By.id(elemId)).getAttribute("value"); - } - - private String getRubricWeight(int qnNumber, int subQnIndex, int colNumber) { - String idSuffix = getIdSuffix(qnNumber); - String elemId = - Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_WEIGHT + idSuffix + "-" + subQnIndex + "-" + colNumber; - - return browser.driver.findElement(By.id(elemId)).getAttribute("value"); - } - - private String getRubricDescription(int qnNumber, int subQnIndex, int choiceIndex) { - return getRubricDescriptionBox(qnNumber, subQnIndex, choiceIndex).getAttribute("value"); - } - - private boolean isRubricWeightsEnabled(int qnNumber) { - return browser.driver.findElement(By.id("rubricAssignWeights-" + qnNumber)).isSelected(); - } - - private boolean isRubricDescriptionBoxPresent(int qnNumber, int subQnIndex, int choiceIndex) { - return !browser.driver.findElements(By.id(getRubricDescriptionBoxId(qnNumber, subQnIndex, choiceIndex))).isEmpty(); - } - - /** - * Returns an array of the specified rubric column values. - * The values are organized in the array in the following manner: - *

    - * If weights are assigned: - * [rubricChoice, rubricDescription-0, rubricWeight-0, rubricDescription-1, rubricWeights-1,...] - *

    - *

    - * If weights are not assigned: - * [rubricChoice, rubricDescription-0, rubricDescription-1, ...] - *

    - */ - public String[] getRubricColValues(int qnNumber, int choiceIndex) { - List col = new ArrayList<>(); - - col.add(getRubricChoice(qnNumber, choiceIndex)); - - int subQnIndex = 0; - - while (isRubricDescriptionBoxPresent(qnNumber, subQnIndex, choiceIndex)) { - col.add(getRubricDescription(qnNumber, subQnIndex, choiceIndex)); - - if (isRubricWeightsEnabled(qnNumber)) { - col.add(getRubricWeight(qnNumber, subQnIndex, choiceIndex)); - } - subQnIndex++; - } - - return col.toArray(new String[0]); - } - - /** - * Checks if move left button of leftmost column is disabled. - * Checks if move right button of rightmost column is disabled. - * Checks if all other move column buttons are enabled. - * @param qnNumber question number. - * @param colIndexes An array containing column indexes in the order displayed in the UI. - */ - public void verifyRubricColumnsMovability(int qnNumber, int[] colIndexes) { - int leftMostColIndex = colIndexes[0]; - int rightMostColIndex = colIndexes[colIndexes.length - 1]; - - // checking move buttons of leftmost column - assertFalse(isRubricColLeftMovable(qnNumber, leftMostColIndex)); - assertTrue(isRubricColRightMovable(qnNumber, leftMostColIndex)); - - // checking move buttons of last column - assertTrue(isRubricColLeftMovable(qnNumber, rightMostColIndex)); - assertFalse(isRubricColRightMovable(qnNumber, rightMostColIndex)); - - // checking move buttons of remaining columns - for (int i = 1; i < colIndexes.length - 1; i++) { - assertTrue(isRubricColLeftMovable(qnNumber, colIndexes[i])); - assertTrue(isRubricColRightMovable(qnNumber, colIndexes[i])); - } - } - - /** - * Checks if the values given in {@code columns} argument match with the - * actual values displayed. Also checks if move left/right buttons for - * each column is properly enabled or disabled. Assumes that there are - * at least 2 columns. - * @param qnNumber question number. - * @param colIndexes An array containing column indexes in the order displayed in the UI. - * @param columns Varargs parameter, where each parameter is {@code String[]} which denotes values - * of a rubric column. Column values must be given in the order displayed in the UI. - */ - public void verifyRubricQuestion(int qnNumber, int[] colIndexes, String[]... columns) { - // checking rubric column values - choice, description-0, weight-0, description-1, weight-1,.... - for (int i = 0; i < colIndexes.length; i++) { - int colIndex = colIndexes[i]; - String[] colValues = columns[i]; - assertTrue(getRubricChoice(qnNumber, colIndex).equals(colValues[0])); - - int index = 1; - int subQnIndex = 0; - - while (index < colValues.length) { - assertTrue(getRubricDescription(qnNumber, subQnIndex, colIndex).equals(colValues[index])); - index++; - - if (isRubricWeightsEnabled(qnNumber)) { - assertTrue(getRubricWeight(qnNumber, subQnIndex, colIndex).equals(colValues[index])); - index++; - } - subQnIndex++; - } - } - - verifyRubricColumnsMovability(qnNumber, colIndexes); - } - - /** - * Fills a single rubric column of index given by - * {@code choiceIndex}, with the values given in {@code values}. - * @param qnNumber question number. - * @param choiceIndex index of the column as in UI. - * @param values {@code String[]} which holds all column values from top to bottom. - */ - public void fillRubricColumn(int qnNumber, int choiceIndex, String[] values) { - fillRubricChoiceBox(values[0], qnNumber, choiceIndex); - - int index = 1; - int subQnIndex = 0; - - // If weights are assigned, then rubric description values are at the odd indexes (i.e. 1,3,5,..), - // and rubric weights are at the even indexes (i.e. 2,4,..). - // Otherwise rubric description starts with index 1. - while (index < values.length) { - fillRubricDescriptionBox(values[index], qnNumber, subQnIndex, choiceIndex); - index++; - - if (isRubricWeightsEnabled(qnNumber)) { - fillRubricWeightBox(values[index], qnNumber, subQnIndex, choiceIndex); - index++; - } - subQnIndex++; - } - } - - /** - * Fills all rubric columns with respective indexes given in - * {@code colIndexes}, with respective values given in @{code colValues}. - * @param qnNumber question number. - * @param colIndexes An array containing column indexes in the order displayed in the UI. - * @param colValues Varargs parameter, where each parameter is {@code String[]} which denotes values - * of a rubric column. Column values must be given in the order displayed in the UI. - */ - public void fillAllRubricColumns(int qnNumber, int[] colIndexes, String[]... colValues) { - assertEquals(colIndexes.length, colValues.length); - - for (int i = 0; i < colIndexes.length; i++) { - fillRubricColumn(qnNumber, colIndexes[i], colValues[i]); - } - } - - public boolean isRubricSubQuestionBoxFocused(int qnNumber, int subQnIndex) { - WebElement subQnBox = getRubricSubQuestionBox(qnNumber, subQnIndex); - - return subQnBox.equals(browser.driver.switchTo().activeElement()); - } - - public void fillRubricSubQuestionBox(String subQuestion, int qnNumber, int subQnIndex) { - WebElement subQnBox = getRubricSubQuestionBox(qnNumber, subQnIndex); - - fillTextBox(subQnBox, subQuestion); - } - - public void fillRubricChoiceBox(String choice, int qnNumber, int choiceIndex) { - String idSuffix = getIdSuffix(qnNumber); - - String elemId = Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE + idSuffix + "-" + choiceIndex; - - WebElement subQnBox = browser.driver.findElement(By.id(elemId)); - fillTextBox(subQnBox, choice); - } - - public WebElement getRubricWeightBox(int qnNumber, int subQnIndex, int choiceIndex) { - String idSuffix = getIdSuffix(qnNumber); - String elementId = - Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_WEIGHT + idSuffix + "-" + subQnIndex + "-" + choiceIndex; - - return browser.driver.findElement(By.id(elementId)); - } - - public void fillRubricWeightBox(String weight, int qnNumber, int subQnIndex, int choiceIndex) { - WebElement weightBox = getRubricWeightBox(qnNumber, subQnIndex, choiceIndex); - fillTextBox(weightBox, weight); - } - - public boolean isRubricWeightBoxFocused(int qnNumber, int subQnIndex, int choiceIndex) { - WebElement weightBox = getRubricWeightBox(qnNumber, subQnIndex, choiceIndex); - - return weightBox.equals(browser.driver.switchTo().activeElement()); - } - - public void fillRubricWeightBoxForNewQuestion(String weight, int subQnIndex, int choiceIndex) { - fillRubricWeightBox(weight, NEW_QUESTION_NUM, subQnIndex, choiceIndex); - } - - private String getRubricDescriptionBoxId(int qnNumber, int subQnIndex, int choiceIndex) { - String idSuffix = getIdSuffix(qnNumber); - - return Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_DESCRIPTION + idSuffix + "-" + subQnIndex + "-" + choiceIndex; - } - - private WebElement getRubricDescriptionBox(int qnNumber, int subQnIndex, int choiceIndex) { - return browser.driver.findElement(By.id(getRubricDescriptionBoxId(qnNumber, subQnIndex, choiceIndex))); - } - - public void fillRubricDescriptionBox(String description, int qnNumber, int subQnIndex, int choiceIndex) { - WebElement descriptionBox = getRubricDescriptionBox(qnNumber, subQnIndex, choiceIndex); - fillTextBox(descriptionBox, description); - } - - public void clickQuestionEditForQuestion(int qnNumber) { - WebElement qnEdit = browser.driver.findElement(By.id("questionedittext-" + qnNumber)); - waitForElementToBeClickable(qnEdit); - click(qnEdit); - } - - public void clickMaxNumberOfRecipientsButton() { - click(maxNumOfRecipients); - } - - public void clickCustomNumberOfRecipientsButton() { - click(customNumOfRecipients); - } - - public void clickEditUncommonSettingsSessionResponsesVisibleButton() { - click(uncommonSettingsSessionResponsesVisibleButton); - } - - public void clickEditUncommonSettingsSendEmailsButton() { - click(uncommonSettingsSendEmailsButton); - } - - public void clickDefaultVisibleTimeButton() { - click(defaultSessionVisibleTimeButton); - } - - public void clickDefaultPublishTimeButton() { - click(defaultResultsVisibleTimeButton); - } - - public void clickManualPublishTimeButton() { - click(manualResultsVisibleTimeButton); - } - - public void toggleClosingSessionEmailReminderCheckbox() { - click(closingSessionEmailReminderButton); - } - - public void clickFsCopyButton() { - fscopyButton.click(); - } - - /** - * Changes the value of actionlink of the copy question button. - * @param actionLink value to change to - */ - public void changeActionLinkOnCopyButton(String actionLink) { - String selector = "$('#button_copy')"; - String action = ".data('actionlink', '" + actionLink + "')"; - executeScript(selector + action); - } - - public void clickCopyButton() { - click(copyQuestionLoadButton); - } - - /** - * Returns true if submission button of the 'copy question' modal is enabled. - */ - public boolean isCopySubmitButtonEnabled() { - return copyQuestionSubmitButton.isEnabled(); - } - - public void clickCopySubmitButton() { - click(copyQuestionSubmitButton); - waitForPageToLoad(); - } - - public void clickAddMcqOtherOptionCheckboxForNewQuestion() { - click(addMcqOtherOptionCheckboxForNewQuestion); - } - - public void clickAddMcqOtherOptionCheckbox(int qnNumber) { - WebElement checkbox = browser.driver.findElement(By.id("mcqOtherOptionFlag-" + qnNumber)); - click(checkbox); - } - - public boolean isMcqOtherOptionCheckboxChecked(int qnNumber) { - return browser.driver.findElement(By.id("mcqOtherOptionFlag-" + qnNumber)).isSelected(); - } - - public void clickAddMsqOtherOptionCheckboxForNewQuestion() { - click(addMsqOtherOptionCheckboxForNewQuestion); - } - - public WebElement getDeleteSessionLink() { - return fsDeleteLink; - } - - public boolean verifyDuplicateButtonIsDisplayed(int qnIndex) { - WebElement duplicateBn = browser.driver.findElement( - By.xpath("//a[contains(@class, 'btn-duplicate-qn')][@data-qnnumber='" + qnIndex + "']")); - return duplicateBn.isDisplayed(); - } - - public void clickDuplicateQuestionLink(int qnIndex) { - WebElement link = browser.driver.findElement( - By.xpath("//a[contains(@class, 'btn-duplicate-qn')][@data-qnnumber='" + qnIndex + "']")); - click(link); - } - - public void clickDeleteQuestionLink(int qnIndex) { - WebElement link = browser.driver.findElement( - By.xpath("//a[contains(@class, 'btn-delete-qn')][@data-qnnumber='" + qnIndex + "']")); - click(link); - } - - public void clickDiscardChangesLink(int qnIndex) { - WebElement link = browser.driver.findElement( - By.xpath("//a[contains(@class, 'btn-discard-changes')][@data-qnnumber='" + qnIndex + "']")); - click(link); - } - - public void clickAddMsqOtherOptionCheckbox(int qnNumber) { - WebElement checkbox = browser.driver.findElement(By.id("msqOtherOptionFlag-" + qnNumber)); - click(checkbox); - } - - public boolean isMsqOtherOptionCheckboxChecked(int qnNumber) { - return browser.driver.findElement(By.id("msqOtherOptionFlag-" + qnNumber)).isSelected(); - } - - public void clickDiscardChangesLinkForNewQuestion() { - clickDiscardChangesLink(NEW_QUESTION_NUM); - } - - public boolean isDiscardChangesButtonVisible(int qnIndex) { - WebElement discardChangesButton = - browser.driver.findElement( - By.xpath("//a[contains(@class, 'btn-discard-changes')][@data-qnnumber='" + qnIndex + "']")); - - return discardChangesButton.isDisplayed(); - } - - public void clickEditSessionButton() { - waitForElementVisibility(fsEditLink); - click(fsEditLink); - } - - public void clickSaveSessionButton() { - click(fsSaveLink); - waitForPageToLoad(); - } - - public void enableOtherVisibilityOptions(int qnNumber) { - clickVisibilityDropdownAndWaitForVisibilityMessageToLoad("OTHER", qnNumber); - } - - public void enableOtherVisibilityOptionsForNewQuestion() { - enableOtherVisibilityOptions(NEW_QUESTION_NUM); - } - - /** - * Selects the visibility option and waits for the visibility message to load. - * Note: The custom visibility options allow for more customization after the option is selected and - * the visibility message would not be loaded until the custom options are modified, which implies that there is no need - * to wait for the visibility message to load if the custom visibility options is selected. - */ - public void clickVisibilityDropdownAndWaitForVisibilityMessageToLoad(String optionValue, int qnNumber) { - String customVisibilityOptionsValue = "OTHER"; - - // If the other option is selected, no AJAX request is made - if (!optionValue.equals(customVisibilityOptionsValue)) { - getjQueryAjaxHandler().waitForAjaxIfPresentThenRegisterHandlers(); - } - - WebElement visibilityOptionsDropdown = - browser.driver.findElement(By.cssSelector("#questionTable-" + qnNumber + " .visibility-options-dropdown")); - - WebElement dropdownToggle = visibilityOptionsDropdown.findElement(By.tagName("button")); - scrollElementToCenterAndClick(dropdownToggle); - - WebElement optionElement = - visibilityOptionsDropdown.findElement(By.cssSelector("a[data-option-name=\"" + optionValue + "\"]")); - - // once the dropdown is assigned the class "open", the options should be visible unless not in the viewport - waitForElementToBeMemberOfClass(visibilityOptionsDropdown, "open"); - - // Scroll to the option because it may not be in the viewport - scrollElementToCenterAndClick(optionElement); - - WebDriverWait wait = new WebDriverWait(browser.driver, TestProperties.TEST_TIMEOUT); - wait.until(ExpectedConditions.textToBePresentInElement(dropdownToggle, optionElement.getText())); - - // If the other option is selected, no AJAX request is made - if (!optionValue.equals(customVisibilityOptionsValue)) { - getjQueryAjaxHandler().waitForRequestComplete(); - } - } - - /** - * Selects the visibility option and waits for the visibility message to load for the new question. - * - * @see InstructorFeedbackEditPage#clickVisibilityDropdownAndWaitForVisibilityMessageToLoad(String, int) - */ - public void clickVisibilityDropdownForNewQuestionAndWaitForVisibilityMessageToLoad(String optionValue) { - clickVisibilityDropdownAndWaitForVisibilityMessageToLoad(optionValue, NEW_QUESTION_NUM); - } - - public String getVisibilityDropdownLabel(int qnNumber) { - return browser.driver.findElement(By.cssSelector("#questionTable-" + qnNumber - + " .visibility-options-dropdown button")).getText().trim(); - } - - public boolean isStaticQnNumberVisible(int qnNumber) { - try { - WebElement selectQuestionNumberStatic = - browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER_STATIC + "-" + qnNumber)); - return selectQuestionNumberStatic.isDisplayed(); - - } catch (NoSuchElementException nsee) { - // new question doesn't have static question part - return false; - } - } - - public boolean isMenuQnNumberVisible(int qnNumber) { - if (qnNumber != NEW_QUESTION_NUM) { - WebElement selectQuestionNumberDropdown = - browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER + "-" + qnNumber)); - return selectQuestionNumberDropdown.isDisplayed(); - } - - WebElement retrievedQnTable = browser.driver.findElement(By.id("questionTable-" + qnNumber)); - return retrievedQnTable.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER)).isDisplayed(); - } - - public String getVisibilityDropdownLabelForNewQuestion() { - return getVisibilityDropdownLabel(NEW_QUESTION_NUM); - } - - public void clickAddQuestionButton() { - click(addNewQuestionButton); - waitForPageToLoad(); - } - - public void clickTemplateModalButton() { - addTemplateModalLoadButton.click(); - } - - public boolean isTemplateQuestionPanelExpanded(int qnNumber) { - // need to wait for the panel to be fully expanded before checking the class - By expandedPanelSelector = By.cssSelector("#addTemplateQuestion-" + qnNumber + " .in"); - waitForElementPresence(expandedPanelSelector); - return browser.driver.findElement(expandedPanelSelector).isDisplayed(); - } - - public void clickAddTemplateQuestionButton() { - click(addTemplateQuestionButton); - } - - public boolean isAddTemplateQuestionButtonEnabled() { - return addTemplateQuestionButton.isEnabled(); - } - - public void clickEditQuestionButton(int qnNumber) { - WebElement qnEditLink = browser.driver.findElement(By.id("questionedittext-" + qnNumber)); - click(qnEditLink); - } - - public boolean isQuestionEnabled(int qnNumber) { - WebElement questionTextArea = browser.driver.findElement(By.id("questiontext-" + qnNumber)); - return questionTextArea.isEnabled(); - } - - public boolean isOptionForSelectingNumberOfEntitiesVisible(int qnNumber) { - return isElementVisible(By.cssSelector("#form_editquestion-" + qnNumber + " .numberOfEntitiesElements")); - } - - public void clickSaveExistingQuestionButton(int qnNumber) { - WebElement qnSaveLink = browser.driver.findElement(By.id("button_question_submit-" + qnNumber)); - click(qnSaveLink); - waitForPageToLoad(); - } - - public WebElement getSelectQuestionNumberDropdown(int qnNumber) { - return browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER + "-" + qnNumber)); - } - - public WebElement getSelectQuestionNumberStatic(int qnNumber) { - return browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_NUMBER_STATIC + "-" + qnNumber)); - } - - public void selectQuestionNumber(int qnNumber, int newQnNumber) { - WebElement qnNumSelect = getSelectQuestionNumberDropdown(qnNumber); - selectDropdownByVisibleValue(qnNumSelect, String.valueOf(newQnNumber)); - } - - public boolean isSelectQuestionNumberEnabled(int qnNumber) { - WebElement qnNumSelect = getSelectQuestionNumberDropdown(qnNumber); - return qnNumSelect.isEnabled(); - } - - public int getSelectedQuestionNumber(int qnNumber) { - if (isQuestionEnabled(qnNumber)) { - Select qnNumSelect = new Select(getSelectQuestionNumberDropdown(qnNumber)); - return Integer.parseInt(qnNumSelect.getFirstSelectedOption().getText().trim()); - } - //substring trims colon from the retrieved question number text - String questionNumber = getSelectQuestionNumberStatic(qnNumber).getText(); - return Integer.parseInt(questionNumber.substring(0, questionNumber.length() - 1)); - } - - /** - * Returns true if all elements expected to be enabled in the edit session frame are enabled - * after edit link is clicked. - */ - public boolean verifyEditSessionBoxIsEnabled() { - boolean isEditSessionEnabled = fsSaveLink.isDisplayed() && timezoneDropDown.isEnabled() - // && "Session visible from" radio buttons - && defaultSessionVisibleTimeButton.isEnabled() - && customSessionVisibleTimeButton.isEnabled() - // && "Send emails for" checkboxes - && closingSessionEmailReminderButton.isEnabled() - && publishedSessionEmailReminderButton.isEnabled(); - - if (isEditSessionEnabled) { - isEditSessionEnabled = gracePeriodDropdown.isEnabled() // && Submission times inputs - && startDateBox.isEnabled() && startTimeDropdown.isEnabled() - && endDateBox.isEnabled() && endTimeDropdown.isEnabled() - // && "Responses visible from" radio buttons - && defaultResultsVisibleTimeButton.isEnabled() - && customResultsVisibleTimeButton.isEnabled() - && manualResultsVisibleTimeButton.isEnabled(); - } - - return isEditSessionEnabled; - } - - public boolean verifyNewEssayQuestionFormIsDisplayed() { - return addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewMcqQuestionFormIsDisplayed() { - WebElement mcqForm = browser.driver.findElement(By.id("mcqForm")); - return mcqForm.isDisplayed() && addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewMsqQuestionFormIsDisplayed() { - WebElement mcqForm = browser.driver.findElement(By.id("msqForm")); - return mcqForm.isDisplayed() && addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewNumScaleQuestionFormIsDisplayed() { - WebElement mcqForm = browser.driver.findElement(By.id("numScaleForm")); - return mcqForm.isDisplayed() && addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewConstSumQuestionFormIsDisplayed() { - WebElement constSumForm = browser.driver.findElement(By.id("constSumForm")); - return constSumForm.isDisplayed() && addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewContributionQuestionFormIsDisplayed() { - // No contribForm to check for. - return addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewRubricQuestionFormIsDisplayed() { - WebElement contribForm = browser.driver.findElement(By.id("rubricForm")); - return contribForm.isDisplayed() && addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewRankOptionsQuestionFormIsDisplayed() { - WebElement contribForm = browser.driver.findElement(By.id("rankOptionsForm")); - return contribForm.isDisplayed() && addNewQuestionButton.isDisplayed(); - } - - public boolean verifyNewRankRecipientsQuestionFormIsDisplayed() { - WebElement contribForm = browser.driver.findElement(By.id("rankRecipientsForm")); - return contribForm.isDisplayed() && addNewQuestionButton.isDisplayed(); - } - - /* - * Checks if alert class is enabled on the visibility options div for the specified question number. - */ - public boolean isAlertClassEnabledForVisibilityOptions(int questionNo) { - String visibilityOptionsDivXPath = - "//div[@id='questionTable-" + questionNo + "']//div[@class='visibility-checkbox-delegate panel-body']" - + "//b[@class='visibility-title']/../.."; - return browser.driver.findElement(By.xpath(visibilityOptionsDivXPath)) - .getAttribute("class").matches(".*\\balert alert-danger\\b.*"); - } - - public boolean areDatesOfPreviousCurrentAndNextMonthEnabled() throws ParseException { - return areDatesOfPreviousCurrentAndNextMonthEnabled(startDateBox) - && areDatesOfPreviousCurrentAndNextMonthEnabled(endDateBox); - } - - /** - * Returns true if the dates of previous, current and next month are enabled. - * - * @param dateBox is a {@link WebElement} that triggers a datepicker - * @throws ParseException if the string in {@code dateBox} cannot be parsed - */ - private boolean areDatesOfPreviousCurrentAndNextMonthEnabled(WebElement dateBox) throws ParseException { - - LocalDate previousMonth = LocalDate.now().minusMonths(1); - - // Navigate to the previous month - if (!navigate(dateBox, previousMonth)) { - return false; - } - - // Check if the dates of previous, current and next month are enabled - for (int i = 0; i < 3; i++) { - - List dates = - browser.driver.findElements(By.xpath("//div[@id='ui-datepicker-div']/table/tbody/tr/td")); - - for (WebElement date : dates) { - - boolean isDisabled = date.getAttribute("class").contains("ui-datepicker-unselectable ui-state-disabled"); - boolean isFromOtherMonth = date.getAttribute("class").contains("ui-datepicker-other-month"); - - if (isDisabled && !isFromOtherMonth) { - return false; - } - } - - // Navigate to the next month - click(browser.driver.findElement(By.className("ui-datepicker-next"))); - } - - return true; - } - - /** - * Navigate the datepicker associated with {@code dateBox} to the specified {@code date}. - * - * @param dateBox is a {@link WebElement} that triggers a datepicker - * @param date is a {@link LocalDate} that specifies the date that needs to be navigated to - * @return true if navigated to the {@code date} successfully, otherwise - * false - * @throws ParseException if the string in {@code dateBox} cannot be parsed - */ - private boolean navigate(WebElement dateBox, LocalDate date) throws ParseException { - - click(dateBox); - LocalDate selectedDate = TimeHelper.parseDateFromSessionsForm(dateBox.getAttribute("value")); - String month = date.getMonth().getDisplayName(TextStyle.FULL, Locale.ENGLISH); - String year = Integer.toString(date.getYear()); - - if (selectedDate.isAfter(date)) { - - while (!getDatepickerMonth().equals(month) || !getDatepickerYear().equals(year)) { - - WebElement previousButton = browser.driver.findElement(By.className("ui-datepicker-prev")); - if (previousButton.getAttribute("class").contains("ui-state-disabled")) { - return false; - } - click(previousButton); - } - - } else { - - while (!getDatepickerMonth().equals(month) || !getDatepickerYear().equals(year)) { - - WebElement nextButton = browser.driver.findElement(By.className("ui-datepicker-next")); - if (nextButton.getAttribute("class").contains("ui-state-disabled")) { - return false; - } - click(nextButton); - } - } - - return true; - } - - private String getDatepickerYear() { - By by = By.className("ui-datepicker-year"); - waitForElementPresence(by); - return browser.driver.findElement(by).getText(); - } - - private String getDatepickerMonth() { - By by = By.className("ui-datepicker-month"); - waitForElementPresence(by); - return browser.driver.findElement(by).getText(); - } - - public void selectNewQuestionTypeAndWaitForNewQuestionPanelReady(String questionType) { - click(browser.driver.findElement(By.cssSelector("[data-questionType=" + questionType + "]"))); - - waitForNewQuestionPanelReady(); - } - - /** - * Waits for the new question panel to be ready, that is, all states initialized and all animations complete. - */ - private void waitForNewQuestionPanelReady() { - // LEGACY IMPLEMENTATION: Coupled to the implementation instructorFeedbackEdit.js#showNewQuestionFrame - // Creating a new question will result in scrolling, so it is assumed that all initialization is completed after - // scrolling is complete. - waitForScrollingToComplete(); - } - - public void selectMcqGenerateOptionsFor(String generateFor, int questionNumber) { - selectDropdownByVisibleValue( - browser.driver.findElement(By.id("mcqGenerateForSelect-" + questionNumber)), - generateFor); - } - - public void selectMsqGenerateOptionsFor(String generateFor, int questionNumber) { - selectDropdownByVisibleValue( - browser.driver.findElement(By.id("msqGenerateForSelect-" + questionNumber)), - generateFor); - } - - /** - * Selects the points distribution scheme for a const sum question. - * - * @param pointsOption Value of "Total" will select Total number of points for all options points distribution - * scheme, or "PerOption" will select Number of points per option points distribution scheme. - * @param questionNumber question number of the const sum question. - */ - public void selectConstSumPointsOptions(String pointsOption, int questionNumber) { - markRadioButtonAsChecked( - browser.driver.findElement(By.id("constSumPoints" + pointsOption + "-" + questionNumber))); - } - - public void selectConstSumPointsOptionsForNewQuestion(String pointsOption) { - selectConstSumPointsOptions(pointsOption, NEW_QUESTION_NUM); - } - - public String getGiverTypeForQuestion(int qnNumber) { - WebElement giverDropdownForQuestion = browser.driver.findElement(By.id("givertype-" + qnNumber)); - return giverDropdownForQuestion.getAttribute("value"); - } - - public String getRecipientTypeForQuestion(int qnNumber) { - WebElement recipientDropdownForQuestion = browser.driver.findElement(By.id("recipienttype-" + qnNumber)); - return recipientDropdownForQuestion.getAttribute("value"); - } - - /** - * Selects the recipient type in the feedback path and waits for the corresponding visibility message to load. - */ - public void selectRecipientTypeForNewQuestionAndWaitForVisibilityMessageToLoad(String recipientType) { - WebElement selectElement = browser.driver.findElement(By.id("recipienttype-" + NEW_QUESTION_NUM)); - selectDropdownByVisibleValueAndHandleAjaxRequests(selectElement, recipientType); - } - - public void clickNewQuestionButton() { - scrollElementToCenterAndClick(openNewQuestionButton); - } - - public boolean isAllFeedbackPathOptionsEnabledForNewQuestion() { - List options = browser.driver.findElements(By.cssSelector("#givertype-" + NEW_QUESTION_NUM + " option")); - options.addAll(browser.driver.findElements(By.cssSelector("#recipienttype-" + NEW_QUESTION_NUM + " option"))); - for (WebElement option : options) { - if (!option.isEnabled()) { - return false; - } - } - return true; - } - - public boolean isAllVisibilityOptionsEnabledForNewQuestion() { - List visibilityDropdownItems = browser.driver.findElement(By.id("questionTable-" + NEW_QUESTION_NUM)) - .findElements(By.cssSelector(".visibility-options-dropdown .dropdown-menu li")); - for (WebElement item : visibilityDropdownItems) { - if (item.getAttribute("class").contains("hidden")) { - return false; - } - } - return true; - } - - public boolean isAllRecipientOptionsDisplayed(int questionNumber) { - List recipientOptions = - browser.driver.findElements(By.cssSelector("#recipienttype-" + questionNumber + " option")); - for (WebElement recipientOption : recipientOptions) { - if ("none".equals(recipientOption.getCssValue("display"))) { - return false; - } - } - return true; - } - - public boolean isRecipientOptionDisplayed(FeedbackParticipantType recipientType, int questionNumber) { - WebElement recipientOption = - browser.driver.findElement( - By.cssSelector("#recipienttype-" + questionNumber - + " option[value='" + recipientType + "']")); - return !"none".equals(recipientOption.getCssValue("display")); - } - - public boolean isMaxNumOfRecipientsChecked() { - return maxNumOfRecipients.isSelected(); - } - - public boolean isCustomNumOfRecipientsChecked() { - return customNumOfRecipients.isSelected(); - } - - public void selectGiverToBe(FeedbackParticipantType giverType, int questionNumber) { - WebElement giverDropdown = browser.driver.findElement(By.id("givertype-" + questionNumber)); - selectDropdownByActualValueAndHandleAjaxRequests(giverDropdown, giverType.toString()); - } - - public void selectRecipientToBe(FeedbackParticipantType recipientType, int questionNumber) { - WebElement giverDropdown = browser.driver.findElement(By.id("recipienttype-" + questionNumber)); - selectDropdownByActualValueAndHandleAjaxRequests(giverDropdown, recipientType.toString()); - } - - /** - * Selects the giver in the feedback path to be students in the course and waits for the corresponding visibility message - * to load. - */ - public void selectGiverToBeStudentsAndWaitForVisibilityMessageToLoad() { - selectDropdownByVisibleValueAndHandleAjaxRequests(giverDropdownForNewQuestion, "Students in this course"); - } - - /** - * Selects the giver in the feedback path to be instructors in the course and waits for the corresponding visibility - * message to load. - */ - public void selectGiverToBeInstructorsAndWaitForVisibilityMessageToLoad() { - selectDropdownByVisibleValueAndHandleAjaxRequests(giverDropdownForNewQuestion, "Instructors in this course"); - } - - /** - * Selects the recipients in the feedback path to be other students in the course and waits for the corresponding - * visibility message to load. - */ - public void selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad() { - selectDropdownByVisibleValueAndHandleAjaxRequests( - recipientDropdownForNewQuestion, "Other students in the course"); - } - - /** - * Selects the recipients in the feedback path to be other students in the course and waits for the corresponding - * visibility message to load. - */ - public void selectRecipientsToBeStudentsAndWaitForVisibilityMessageToLoad(int qnNumber) { - WebElement recipientDropdown = browser.driver.findElement(By.id("recipienttype-" + qnNumber)); - selectDropdownByVisibleValueAndHandleAjaxRequests(recipientDropdown, "Other students in the course"); - } - - /** - * Selects the recipients in the feedback path to be the team members and giver and waits for the corresponding - * visibility message to load. - */ - public void selectRecipientsToBeGiverTeamMembersAndGiverAndWaitForVisibilityMessageToLoad() { - selectDropdownByVisibleValueAndHandleAjaxRequests( - recipientDropdownForNewQuestion, "Giver's team members and Giver"); - } - - /** - * Selects the recipients in the feedback path to be instructors in the course and waits for the corresponding - * visibility message to load. - */ - public void selectRecipientsToBeInstructorsAndWaitForVisibilityMessageToLoad() { - selectDropdownByVisibleValueAndHandleAjaxRequests( - recipientDropdownForNewQuestion, "Instructors in the course"); - } - - public void enableOtherFeedbackPathOptions(int qnNumber) { - WebElement questionTable = browser.driver.findElement(By.id("questionTable-" + qnNumber)); - WebElement dropdownButton = questionTable.findElement(By.cssSelector(".feedback-path-dropdown > button")); - WebElement otherOption = questionTable.findElement( - By.className("feedback-path-dropdown-option-other")); - click(dropdownButton); - click(otherOption); - } - - public void enableOtherFeedbackPathOptionsForNewQuestion() { - enableOtherFeedbackPathOptions(NEW_QUESTION_NUM); - } - - public void editFeedbackSession(LocalDateTime startTime, LocalDateTime endTime, String instructions, long gracePeriod) { - // Select start date - executeScript("$('#" + Const.ParamsNames.FEEDBACK_SESSION_STARTDATE + "')[0].value='" - + TimeHelper.formatDateForSessionsForm(startTime) + "';"); - selectDropdownByVisibleValue(startTimeDropdown, - TimeHelperExtension.convertToDisplayValueInTimeDropDown(startTime)); - - // Select deadline date - executeScript("$('#" + Const.ParamsNames.FEEDBACK_SESSION_ENDDATE + "')[0].value='" - + TimeHelper.formatDateForSessionsForm(endTime) + "';"); - selectDropdownByVisibleValue(endTimeDropdown, - TimeHelperExtension.convertToDisplayValueInTimeDropDown(endTime)); - - // Fill in instructions - fillRichTextEditor("instructions", instructions); - - // Select grace period - selectDropdownByVisibleValue(gracePeriodDropdown, Long.toString(gracePeriod) + " mins"); - - click(fsSaveLink); - waitForPageToLoad(); - } - - public String getFeedbackSessionEndTimeValue() { - return getDropdownSelectedValue(endTimeDropdown); - } - - public InstructorFeedbackSessionsPage deleteSession() { - click(getDeleteSessionLink()); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackSessionsPage clickDoneEditingLink() { - click(doneEditingButton); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public boolean isMcqWeightBoxFocused(int qnNumber, int choiceIndex) { - WebElement weightBox = getMcqWeightBox(qnNumber, choiceIndex); - - return weightBox.equals(browser.driver.switchTo().activeElement()); - } - - public boolean isMcqOtherWeightBoxFocused(int qnNumber) { - WebElement weightBox = getMcqOtherWeightBox(qnNumber); - return weightBox.equals(browser.driver.switchTo().activeElement()); - } - - public void fillMcqOptionForNewQuestion(int optionIndex, String optionText) { - fillMcqOption(NEW_QUESTION_NUM, optionIndex, optionText); - } - - public void fillMcqOption(int qnNumber, int optionIndex, String optionText) { - WebElement optionBox = browser.driver.findElement(By.id("mcqOption-" + optionIndex + "-" + qnNumber)); - fillTextBox(optionBox, optionText); - } - - public void clickAddMoreMcqOptionLink(int qnNumber) { - WebElement addMoreOptionLink = browser.driver.findElement(By.id("mcqAddOptionLink-" + qnNumber)); - click(addMoreOptionLink); - } - - public void clickAddMoreMcqOptionLinkForNewQuestion() { - clickAddMoreMcqOptionLink(NEW_QUESTION_NUM); - } - - public WebElement getMcqHasAssignWeightsCheckbox(int qnNumber) { - return browser.driver.findElement(By.id("mcqHasAssignedWeights-" + qnNumber)); - } - - public void clickMcqHasAssignWeightsCheckbox(int qnNumber) { - WebElement mcqAssignWeightCheckbox = getMcqHasAssignWeightsCheckbox(qnNumber); - click(mcqAssignWeightCheckbox); - } - - public void clickMcqAssignWeightCheckboxForNewQuestion() { - clickMcqHasAssignWeightsCheckbox(NEW_QUESTION_NUM); - } - - public boolean isMcqHasAssignWeightCheckboxChecked(int qnNumber) { - WebElement checkbox = browser.driver.findElement(By.id("mcqHasAssignedWeights-" + qnNumber)); - return checkbox.isSelected(); - } - - /** - * Get the specified Mcq weight WebElement. - * @param qnNumber Question number - * @param choiceIndex The index of the corresponding MCQ choice - * @return The MCQ weight WebElement for the specified choice. - */ - public WebElement getMcqWeightBox(int qnNumber, int choiceIndex) { - String elementId = Const.ParamsNames.FEEDBACK_QUESTION_MCQ_WEIGHT + "-" + choiceIndex + "-" + qnNumber; - - return browser.driver.findElement(By.id(elementId)); - } - - /** - * Returns the whole MCQ weight column. - */ - public WebElement getMcqWeightsColumn(int qnNumber) { - return browser.driver.findElement(By.id("mcqWeights-" + qnNumber)); - } - - public WebElement getMcqOtherWeightBox(int qnNumber) { - return browser.driver.findElement(By.id("mcqOtherWeight-" + qnNumber)); - } - - public void fillMcqWeightBox(int qnNumber, int choiceIndex, String value) { - WebElement weightBox = getMcqWeightBox(qnNumber, choiceIndex); - fillTextBox(weightBox, value); - } - - public void fillMcqOtherWeightBox(int qnNumber, String value) { - WebElement otherWeightBox = getMcqOtherWeightBox(qnNumber); - fillTextBox(otherWeightBox, value); - } - - public void clickRemoveMcqOptionLink(int optionIndex, int qnIndex) { - String idSuffix = getIdSuffix(qnIndex); - - WebElement mcqOptionRow = browser.driver.findElement(By.id("mcqOptionRow-" + optionIndex + idSuffix)); - WebElement removeOptionLink = mcqOptionRow.findElement(By.id("mcqRemoveOptionLink")); - click(removeOptionLink); - } - - public void clickRemoveMcqOptionLinkForNewQuestion(int optionIndex) { - clickRemoveMcqOptionLink(optionIndex, NEW_QUESTION_NUM); - } - - public void clickGenerateMcqOptionsCheckbox(int qnIndex) { - clickGenerateOptionsCheckbox(qnIndex, "generateMcqOptionsCheckbox"); - } - - public void clickGenerateMsqOptionsCheckbox(int qnIndex) { - clickGenerateOptionsCheckbox(qnIndex, "generateMsqOptionsCheckbox"); - } - - private void clickGenerateOptionsCheckbox(int qnIndex, String idPrefix) { - String idSuffix = getIdSuffix(qnIndex); - - WebElement generateOptionsCheckbox = browser.driver.findElement(By.id(idPrefix + idSuffix)); - click(generateOptionsCheckbox); - } - - public void fillMsqOptionForNewQuestion(int optionIndex, String optionText) { - WebElement optionBox = browser.driver.findElement(By.id("msqOption-" + optionIndex + "-" + NEW_QUESTION_NUM)); - fillTextBox(optionBox, optionText); - } - - public void dragAndDropQuestionOption(String qnType, int qnNumber, int sourceIndex, int targetIndex) throws Exception { - WebElement draggedOptionElement = browser.driver.findElement(By.xpath("//div[@id='" + qnType + "OptionRow-" - + sourceIndex + "-" + qnNumber + "']//span[@class='glyphicon glyphicon-resize-vertical']")); - WebElement targetElement = browser.driver.findElement(By.xpath("//div[@id='" + qnType + "OptionRow-" - + targetIndex + "-" + qnNumber + "']//span[@class='glyphicon glyphicon-resize-vertical']")); - - Actions builder = new Actions(browser.driver); - // drag option to target, move 10 units above target and release - // multiple movements are used to slow down drag movement and provide - // enough time for the grid to create empty slots - builder.clickAndHold(draggedOptionElement) - .moveToElement(targetElement) - .moveToElement(targetElement, 0, -10) - .release() - .build() - .perform(); - } - - public boolean isMsqWeightBoxFocused(int qnNumber, int choiceIndex) { - WebElement weightBox = getMsqWeightBox(qnNumber, choiceIndex); - return weightBox.equals(browser.driver.switchTo().activeElement()); - } - - public boolean isMsqOtherWeightBoxFocused(int qnNumber) { - WebElement weightBox = getMsqOtherWeightBox(qnNumber); - return weightBox.equals(browser.driver.switchTo().activeElement()); - } - - public void clickAddMoreMsqOptionLink(int qnIndex) { - WebElement addMoreOptionLink = browser.driver.findElement(By.id("msqAddOptionLink-" + qnIndex)); - click(addMoreOptionLink); - } - - public void clickAddMoreMsqOptionLinkForNewQuestion() { - clickAddMoreMsqOptionLink(NEW_QUESTION_NUM); - } - - public void clickRemoveMsqOptionLink(int optionIndex, int qnIndex) { - String idSuffix = getIdSuffix(qnIndex); - - WebElement msqOptionRow = browser.driver.findElement(By.id("msqOptionRow-" + optionIndex + idSuffix)); - WebElement removeOptionLink = msqOptionRow.findElement(By.id("msqRemoveOptionLink")); - click(removeOptionLink); - } - - public void clickRemoveMsqOptionLinkForNewQuestion(int optionIndex) { - clickRemoveMsqOptionLink(optionIndex, NEW_QUESTION_NUM); - } - - private String getMsqMaxSelectableChoicesCheckboxId(int qnNumber) { - return "msqEnableMaxSelectableChoices-" + qnNumber; - } - - private String getMsqMinSelectableChoicesCheckboxId(int qnNumber) { - return "msqEnableMinSelectableChoices-" + qnNumber; - } - - private String getMsqMaxSelectableChoicesBoxId(int qnNumber) { - return "msqMaxSelectableChoices-" + qnNumber; - } - - private String getMsqMinSelectableChoicesBoxId(int qnNumber) { - return "msqMinSelectableChoices-" + qnNumber; - } - - public WebElement getMsqMaxSelectableChoicesElement(int qnNumber) { - String id = getMsqMaxSelectableChoicesCheckboxId(qnNumber); - - return browser.driver.findElement(By.id(id)); - } - - private WebElement getMsqMinSelectableChoicesElement(int qnNumber) { - String id = getMsqMinSelectableChoicesCheckboxId(qnNumber); - - return browser.driver.findElement(By.id(id)); - } - - public void toggleMsqMaxSelectableChoices(int qnNumber) { - click(getMsqMaxSelectableChoicesElement(qnNumber)); - } - - public void toggleMsqMinSelectableChoices(int qnNumber) { - click(getMsqMinSelectableChoicesElement(qnNumber)); - } - - public boolean isMsqMaxSelectableChoicesEnabled(int qnNumber) { - String id = getMsqMaxSelectableChoicesCheckboxId(qnNumber); - - return browser.driver.findElement(By.id(id)).isSelected(); - } - - public boolean isMsqMinSelectableChoicesEnabled(int qnNumber) { - String id = getMsqMinSelectableChoicesCheckboxId(qnNumber); - - return browser.driver.findElement(By.id(id)).isSelected(); - } - - public WebElement getMsqMaxSelectableChoicesBox(int qnNumber) { - return browser.driver.findElement(By.id(getMsqMaxSelectableChoicesBoxId(qnNumber))); - } - - public WebElement getMsqMinSelectableChoicesBox(int qnNumber) { - return browser.driver.findElement(By.id(getMsqMinSelectableChoicesBoxId(qnNumber))); - } - - public int getMinOfMsqMaxSelectableChoices(int qnNumber) { - return Integer.parseInt(getMsqMaxSelectableChoicesBox(qnNumber).getAttribute("min")); - } - - public int getMaxOfMsqMaxSelectableChoices(int qnNumber) { - return Integer.parseInt(getMsqMaxSelectableChoicesBox(qnNumber).getAttribute("max")); - } - - public int getMinOfMsqMinSelectableChoices(int qnNumber) { - return Integer.parseInt(getMsqMinSelectableChoicesBox(qnNumber).getAttribute("min")); - } - - public int getMaxOfMsqMinSelectableChoices(int qnNumber) { - return Integer.parseInt(getMsqMinSelectableChoicesBox(qnNumber).getAttribute("max")); - } - - public void fillMsqMinSelectableChoices(int qnNumber, String value) { - fillTextBox(getMsqMinSelectableChoicesBox(qnNumber), value); - } - - public void fillMsqMaxSelectableChoices(int qnNumber, String value) { - fillTextBox(getMsqMaxSelectableChoicesBox(qnNumber), value); - } - - public void fillMsqOption(int qnNumber, int optionIndex, String optionText) { - WebElement optionBox = browser.driver.findElement(By.id("msqOption-" + optionIndex + "-" + qnNumber)); - fillTextBox(optionBox, optionText); - } - - public WebElement getMsqHasAssignWeightsCheckbox(int qnNumber) { - return browser.driver.findElement(By.id("msqHasAssignedWeights-" + qnNumber)); - } - - public void clickMsqHasAssignWeightsCheckbox(int qnNumber) { - WebElement msqAssignWeightCheckbox = getMsqHasAssignWeightsCheckbox(qnNumber); - click(msqAssignWeightCheckbox); - } - - public void clickMsqAssignWeightCheckboxForNewQuestion() { - clickMsqHasAssignWeightsCheckbox(NEW_QUESTION_NUM); - } - - public boolean isMsqHasAssignWeightCheckboxChecked(int qnNumber) { - WebElement checkbox = browser.driver.findElement(By.id("msqHasAssignedWeights-" + qnNumber)); - return checkbox.isSelected(); - } - - /** - * Get the specified Msq weight WebElement. - * @param qnNumber Question number - * @param choiceIndex The index of the corresponding MSQ choice - * @return The MSQ weight WebElement for the specified choice. - */ - public WebElement getMsqWeightBox(int qnNumber, int choiceIndex) { - String elementId = Const.ParamsNames.FEEDBACK_QUESTION_MSQ_WEIGHT + "-" + choiceIndex + "-" + qnNumber; - - return browser.driver.findElement(By.id(elementId)); - } - - /** - * Returns the whole MSQ weight column. - */ - public WebElement getMsqWeightsColumn(int qnNumber) { - return browser.driver.findElement(By.id("msqWeights-" + qnNumber)); - } - - public WebElement getMsqOtherWeightBox(int qnNumber) { - return browser.driver.findElement(By.id("msqOtherWeight-" + qnNumber)); - } - - public void fillMsqWeightBox(int qnNumber, int choiceIndex, String value) { - WebElement weightBox = getMsqWeightBox(qnNumber, choiceIndex); - fillTextBox(weightBox, value); - } - - public void fillMsqOtherWeightBox(int qnNumber, String value) { - WebElement otherWeightBox = getMsqOtherWeightBox(qnNumber); - fillTextBox(otherWeightBox, value); - } - - public int getNumOfStudentsForFs() { - return Integer.parseInt(browser.driver.findElement(By.id("num-students")).getAttribute("value")); - } - - public int getNumOfTeamsForFs() { - return Integer.parseInt(browser.driver.findElement(By.id("num-teams")).getAttribute("value")); - } - - public int getNumOfInstructorsForFs() { - return Integer.parseInt(browser.driver.findElement(By.id("num-instructors")).getAttribute("value")); - } - - private String getValue(WebElement elem) { - return (String) executeScript(String.format("return $('#%s').val();", elem.getAttribute("id"))); - } - - public int getMsqMinSelectableChoices(int qnNumber) { - assertTrue(isMsqMinSelectableChoicesEnabled(qnNumber)); - - return Integer.parseInt(getValue(getMsqMinSelectableChoicesBox(qnNumber))); - } - - public int getMsqMaxSelectableChoices(int qnNumber) { - assertTrue(isMsqMaxSelectableChoicesEnabled(qnNumber)); - - return Integer.parseInt(getValue(getMsqMaxSelectableChoicesBox(qnNumber))); - } - - private boolean isGenerateOptionsForMsqChecked(int qnNumber) { - return browser.driver.findElement(By.id("generateMsqOptionsCheckbox-" + qnNumber)).isSelected(); - } - - private String getGenerateOptionsForMsqValue(int qnNumber) { - Select options = new Select(browser.driver.findElement(By.id("msqGenerateForSelect-" + qnNumber))); - - return options.getFirstSelectedOption().getText(); - } - - public int getNumOfMsqOptions(int qnNumber) { - if (isGenerateOptionsForMsqChecked(qnNumber)) { - String selectedOption = getGenerateOptionsForMsqValue(qnNumber); - - switch (selectedOption) { - case "students": - return getNumOfStudentsForFs(); - case "teams": - return getNumOfTeamsForFs(); - case "instructors": - return getNumOfInstructorsForFs(); - default: - return 0; - } - } - - return browser.driver.findElements( - By.cssSelector("#msqChoices-" + qnNumber + " div[id^=\"msqOptionRow\"]")).size(); - } - - public void verifyMsqMinMaxSelectableChoices(int qnNumber) { - boolean isMinEnabled = isMsqMinSelectableChoicesEnabled(qnNumber); - boolean isMaxEnabled = isMsqMaxSelectableChoicesEnabled(qnNumber); - - if (!isMinEnabled && !isMaxEnabled) { - return; - } - - int numOfOptions = getNumOfMsqOptions(qnNumber); - - if (isMinEnabled) { - int lowerLimit = getMinOfMsqMinSelectableChoices(qnNumber); - int upperLimit = getMaxOfMsqMinSelectableChoices(qnNumber); - int value = getMsqMinSelectableChoices(qnNumber); - - assertTrue(lowerLimit == 1); - assertTrue(lowerLimit <= value); - assertTrue(value <= upperLimit); - assertTrue(upperLimit <= numOfOptions); - } - - if (isMaxEnabled) { - int lowerLimit = getMinOfMsqMaxSelectableChoices(qnNumber); - int upperLimit = getMaxOfMsqMaxSelectableChoices(qnNumber); - int value = getMsqMaxSelectableChoices(qnNumber); - - assertTrue(lowerLimit == 2); - assertTrue(lowerLimit <= value); - assertTrue(value <= upperLimit); - assertTrue(upperLimit <= numOfOptions); - } - - if (isMinEnabled && isMaxEnabled) { - int minValue = getMsqMinSelectableChoices(qnNumber); - int maxValue = getMsqMaxSelectableChoices(qnNumber); - - assertTrue(minValue <= maxValue); - assertEquals(getMaxOfMsqMinSelectableChoices(qnNumber), maxValue); - } - } - - public void fillConstSumOption(int optionIndex, String optionText, int qnIndex) { - String idSuffix = getIdSuffix(qnIndex); - - WebElement optionBox = browser.driver.findElement(By.id("constSumOption-" + optionIndex + idSuffix)); - fillTextBox(optionBox, optionText); - } - - public void fillConstSumOptionForNewQuestion(int optionIndex, String optionText) { - fillConstSumOption(optionIndex, optionText, NEW_QUESTION_NUM); - } - - public void clickAddMoreConstSumOptionLink(int qnIndex) { - WebElement addMoreOptionLink = browser.driver.findElement(By.id("constSumAddOptionLink-" + qnIndex)); - click(addMoreOptionLink); - } - - public void clickAddMoreConstSumOptionLinkForNewQuestion() { - clickAddMoreConstSumOptionLink(NEW_QUESTION_NUM); - } - - public void clickRemoveConstSumOptionLink(int optionIndex, int qnIndex) { - String idSuffix = getIdSuffix(qnIndex); - - WebElement msqOptionRow = browser.driver.findElement(By.id("constSumOptionRow-" + optionIndex + idSuffix)); - WebElement removeOptionLink = msqOptionRow.findElement(By.id("constSumRemoveOptionLink")); - click(removeOptionLink); - } - - public void clickRemoveConstSumOptionLinkForNewQuestion(int optionIndex) { - clickRemoveConstSumOptionLink(optionIndex, NEW_QUESTION_NUM); - } - - public void clickDistributePointsOptionsCheckbox(int qnIndex) { - String idSuffix = getIdSuffix(qnIndex); - - WebElement distributePointsOptionsCheckbox = - browser.driver.findElement(By.id("constSum_UnevenDistribution" + idSuffix)); - click(distributePointsOptionsCheckbox); - } - - public void selectConstSumDistributePointsOptions(String distributePointsFor, int questionNumber) { - selectDropdownByVisibleValue( - browser.driver.findElement(By.id("constSumDistributePointsSelect-" + questionNumber)), - distributePointsFor); - } - - public void clickAssignWeightsCheckbox(int qnIndex) { - By by = By.id(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_WEIGHTS_ASSIGNED + getIdSuffix(qnIndex)); - WebElement assignWeightsCheckbox = browser.driver.findElement(by); - click(assignWeightsCheckbox); - } - - public void clickAssignWeightsCheckboxForNewQuestion() { - clickAssignWeightsCheckbox(NEW_QUESTION_NUM); - } - - public void clickAddRubricRowLink(int qnIndex) { - String idSuffix = getIdSuffix(qnIndex); - WebElement addRubricRowLink = browser.driver.findElement(By.id("rubricAddSubQuestionLink" + idSuffix)); - click(addRubricRowLink); - } - - public void clickAddRubricColLink(int qnIndex) { - String idSuffix = getIdSuffix(qnIndex); - WebElement addRubricColLink = browser.driver.findElement(By.id("rubricAddChoiceLink" + idSuffix)); - click(addRubricColLink); - } - - public void clickRemoveRubricRowLinkAndConfirm(int qnIndex, int row) { - String idSuffix = getIdSuffix(qnIndex); - WebElement removeRubricRowLink = - browser.driver.findElement(By.id("rubricRemoveSubQuestionLink" + idSuffix + "-" + row)); - //click(addRubricRowLink); - clickAndConfirm(removeRubricRowLink); - } - - public void clickRemoveRubricColLinkAndConfirm(int qnIndex, int col) { - String idSuffix = getIdSuffix(qnIndex); - WebElement removeRubricColLink = - browser.driver.findElement(By.id("rubricRemoveChoiceLink" + idSuffix + "-" + col)); - clickAndConfirm(removeRubricColLink); - } - - public void verifyRankOptionIsHiddenForNewQuestion(int optionIndex) { - WebElement optionBox = browser.driver.findElement(By.id("rankOption-" + optionIndex + "-" + NEW_QUESTION_NUM)); - assertFalse(optionBox.isDisplayed()); - } - - public void fillRankOption(int qnIndx, int optionIndex, String optionText) { - WebElement optionBox = browser.driver.findElement(By.id("rankOption-" + optionIndex + "-" + qnIndx)); - fillTextBox(optionBox, optionText); - } - - public void fillRankOptionForNewQuestion(int optionIndex, String optionText) { - fillRankOption(NEW_QUESTION_NUM, optionIndex, optionText); - } - - public void tickDuplicatesAllowedCheckbox(int qnIndex) { - WebElement checkBox = toggleDuplicatesAllowedCheckBox(qnIndex); - assertTrue(checkBox.isSelected()); - } - - public void tickDuplicatesAllowedCheckboxForNewQuestion() { - tickDuplicatesAllowedCheckbox(NEW_QUESTION_NUM); - } - - public void untickDuplicatesAllowedCheckbox(int qnIndex) { - WebElement checkBox = toggleDuplicatesAllowedCheckBox(qnIndex); - assertFalse(checkBox.isSelected()); - } - - public void untickDuplicatesAllowedCheckboxForNewQuestion() { - untickDuplicatesAllowedCheckbox(NEW_QUESTION_NUM); - } - - private WebElement toggleDuplicatesAllowedCheckBox(int qnIndex) { - WebElement checkBox = browser.driver.findElement(By.id("rankAreDuplicatesAllowed-" + qnIndex)); - click(checkBox); - return checkBox; - } - - public boolean isRankDuplicatesAllowedChecked(int qnIndex) { - WebElement checkBox = browser.driver.findElement(By.id("rankAreDuplicatesAllowed-" + qnIndex)); - return checkBox.isSelected(); - } - - public boolean isRankDuplicatesAllowedCheckedForNewQuestion() { - return isRankDuplicatesAllowedChecked(NEW_QUESTION_NUM); - } - - public void clickAddMoreRankOptionLink(int qnIndex) { - WebElement addMoreOptionLink = browser.driver.findElement(By.id("rankAddOptionLink-" + qnIndex)); - click(addMoreOptionLink); - } - - public void clickAddMoreRankOptionLinkForNewQuestion() { - clickAddMoreRankOptionLink(NEW_QUESTION_NUM); - } - - public void clickRemoveRankOptionLink(int qnIndex, int optionIndex) { - String idSuffix = getIdSuffix(qnIndex); - - WebElement msqOptionRow = browser.driver.findElement(By.id("rankOptionRow-" + optionIndex + idSuffix)); - WebElement removeOptionLink = msqOptionRow.findElement(By.id("rankRemoveOptionLink")); - click(removeOptionLink); - } - - private String getQuestionType(int qnNumber) { - return browser.driver.findElement(By.cssSelector("#form_editquestion-" + qnNumber + " input[name='questiontype']")) - .getAttribute("value"); - } - - private boolean isRankOptionsQuestion(int qnIndex) { - return "RANK_OPTIONS".equals(getQuestionType(qnIndex)); - } - - public int getNumOfOptionsInRankOptions(int qnIndex) { - if (isRankOptionsQuestion(qnIndex)) { - WebElement rankOptionsTableRows = browser.driver.findElement(By.id("rankChoices-" + qnIndex)); - List optionInputFields = - rankOptionsTableRows.findElements(By.cssSelector("div[id^='rankOptionRow-']")); - return optionInputFields.size(); - } - - // For rank recipients - String recipient = getRecipientTypeForQuestion(qnIndex); - - switch (recipient) { - case "STUDENTS": - case "INSTRUCTORS": - case "TEAMS": - return Integer.parseInt(browser.driver.findElement(By.id("num-" + recipient.toLowerCase())) - .getAttribute("value")); - case "OWN_TEAM_MEMBERS": - case "OWN_TEAM_MEMBERS_INCLUDING_SELF": - return Integer.MAX_VALUE; - default: - // For SELF, OWN_TEAM, NONE - return 1; - } - } - - public int getNumOfOptionsInRankOptionsForNewQuestion() { - return getNumOfOptionsInRankOptions(NEW_QUESTION_NUM); - } - - private WebElement getMinOptionsToBeRankedCheckbox(int qnNumber) { - if (isRankOptionsQuestion(qnNumber)) { - return browser.driver.findElement(By.id("minOptionsToBeRankedEnabled-" + qnNumber)); - } - - return browser.driver.findElement(By.id("minRecipientsToBeRankedEnabled-" + qnNumber)); - } - - private WebElement getMaxOptionsToBeRankedCheckbox(int qnNumber) { - if (isRankOptionsQuestion(qnNumber)) { - return browser.driver.findElement(By.id("maxOptionsToBeRankedEnabled-" + qnNumber)); - } - - return browser.driver.findElement(By.id("maxRecipientsToBeRankedEnabled-" + qnNumber)); - } - - public void toggleMinOptionsToBeRankedCheckbox(int qnNumber) { - click(getMinOptionsToBeRankedCheckbox(qnNumber)); - } - - public void toggleMaxOptionsToBeRankedCheckbox(int qnNumber) { - click(getMaxOptionsToBeRankedCheckbox(qnNumber)); - } - - public WebElement getMinOptionsToBeRankedInputElement(int qnNumber) { - if (isRankOptionsQuestion(qnNumber)) { - return browser.driver.findElement(By.id("minOptionsToBeRanked-" + qnNumber)); - } - - return browser.driver.findElement(By.id("minRecipientsToBeRanked-" + qnNumber)); - } - - public WebElement getMaxOptionsToBeRankedInputElement(int qnNumber) { - if (isRankOptionsQuestion(qnNumber)) { - return browser.driver.findElement(By.id("maxOptionsToBeRanked-" + qnNumber)); - } - - return browser.driver.findElement(By.id("maxRecipientsToBeRanked-" + qnNumber)); - } - - public boolean isMinOptionsToBeRankedEnabled(int qnNumber) { - return getMinOptionsToBeRankedCheckbox(qnNumber).isEnabled() - && getMinOptionsToBeRankedInputElement(qnNumber).isEnabled(); - } - - public boolean isMaxOptionsToBeRankedEnabled(int qnNumber) { - return getMaxOptionsToBeRankedCheckbox(qnNumber).isEnabled() - && getMaxOptionsToBeRankedInputElement(qnNumber).isEnabled(); - } - - private int getMinOfMinOptionsToBeSelectedInput(int qnNumber) { - WebElement elem = getMinOptionsToBeRankedInputElement(qnNumber); - - return Integer.parseInt(elem.getAttribute("min")); - } - - private int getMinOfMaxOptionsToBeSelectedInput(int qnNumber) { - WebElement elem = getMaxOptionsToBeRankedInputElement(qnNumber); - - return Integer.parseInt(elem.getAttribute("min")); - } - - private int getMaxOfMinOptionsToBeSelectedInput(int qnNumber) { - WebElement elem = getMinOptionsToBeRankedInputElement(qnNumber); - - return Integer.parseInt(elem.getAttribute("max")); - } - - private int getMaxOfMaxOptionsToBeSelectedInput(int qnNumber) { - WebElement elem = getMaxOptionsToBeRankedInputElement(qnNumber); - - return Integer.parseInt(elem.getAttribute("max")); - } - - public int getMinOptionsToBeRanked(int qnNumber) { - assertTrue(isMinOptionsToBeRankedEnabled(qnNumber)); - WebElement elem = getMinOptionsToBeRankedInputElement(qnNumber); - - return Integer.parseInt(elem.getAttribute("value")); - } - - public int getMaxOptionsToBeRanked(int qnNumber) { - assertTrue(isMaxOptionsToBeRankedEnabled(qnNumber)); - WebElement elem = getMaxOptionsToBeRankedInputElement(qnNumber); - - return Integer.parseInt(elem.getAttribute("value")); - } - - public void fillMinOptionsToBeRanked(int qnNumber, String value) { - WebElement rankMinOption = getMinOptionsToBeRankedInputElement(qnNumber); - fillTextBox(rankMinOption, value); - } - - public void fillMaxOptionsToBeRanked(int qnNumber, String value) { - WebElement rankMaxOption = getMaxOptionsToBeRankedInputElement(qnNumber); - fillTextBox(rankMaxOption, value); - } - - public void verifyMinMaxOptionsToBeSelectedRestrictions(int qnNumber) { - boolean isMinOptionsEnabled = isMinOptionsToBeRankedEnabled(qnNumber); - boolean isMaxOptionsEnabled = isMaxOptionsToBeRankedEnabled(qnNumber); - - if (!isMinOptionsEnabled && !isMaxOptionsEnabled) { - return; - } - - if (isMinOptionsEnabled) { - int value = getMinOptionsToBeRanked(qnNumber); - int upperLimit = getMaxOfMinOptionsToBeSelectedInput(qnNumber); - - assertTrue(value <= upperLimit); - assertEquals(1, getMinOfMinOptionsToBeSelectedInput(qnNumber)); - } - - if (isMaxOptionsEnabled) { - int value = getMaxOptionsToBeRanked(qnNumber); - int upperLimit = getMaxOfMaxOptionsToBeSelectedInput(qnNumber); - - assertTrue(value <= upperLimit); - assertEquals(getNumOfOptionsInRankOptions(qnNumber), getMaxOfMaxOptionsToBeSelectedInput(qnNumber)); - assertEquals(1, getMinOfMaxOptionsToBeSelectedInput(qnNumber)); - } - - if (isMinOptionsEnabled && isMaxOptionsEnabled) { - int maxValue = getMaxOptionsToBeRanked(qnNumber); - int minValue = getMinOptionsToBeRanked(qnNumber); - - assertTrue(minValue <= maxValue); - } - } - - public FeedbackSubmitPage clickPreviewAsStudentButton() { - click(previewAsStudentButton); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(FeedbackSubmitPage.class); - } - - public FeedbackSubmitPage clickPreviewAsInstructorButton() { - waitForPageToLoad(); - click(previewAsInstructorButton); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(FeedbackSubmitPage.class); - } - - public void clickTemplateQuestionPanel(int questionNum) { - WebElement questionPanel = browser.driver.findElement(By.id("addTemplateQuestion-" + questionNum)) - .findElement(By.className("panel-title")); - - click(questionPanel); - } - - public void clickTemplateQuestionModalCheckBox(int questionNum) { - WebElement questionCheckBox = browser.driver.findElement(By.id("addTemplateQuestion-" + questionNum)) - .findElement(By.cssSelector("input")); - - click(questionCheckBox); - } - - public void clickCopyTableAtRow(int rowIndex) { - WebElement row = browser.driver.findElement(By.id("copyTableModal")) - .findElements(By.tagName("tr")) - .get(rowIndex + 1); - click(row); - } - - public void waitForCopyTableToLoad() { - By tableRowSelector = By.cssSelector("#copyTableModal tr"); - waitForElementPresence(tableRowSelector); - waitForElementVisibility(browser.driver.findElement(tableRowSelector)); - } - - public void waitForCopyErrorMessageToLoad() { - By errorMessageSelector = By.cssSelector("#question-copy-modal-status.alert-danger"); - waitForElementPresence(errorMessageSelector); - waitForElementVisibility(browser.driver.findElement(errorMessageSelector)); - } - - public String getCopyErrorMessageText() { - return browser.driver.findElement( - By.cssSelector("#question-copy-modal-status.alert-danger")).getText(); - } - - public boolean isVisibilityDropdownOptionHidden(String optionValue, int qnNumber) { - return browser.driver.findElement(By.id("questionTable-" + qnNumber)) - .findElement(By.className("visibility-options-dropdown-option")) - .findElement(By.xpath("//a[@data-option-name='" + optionValue + "']/..")) - .getAttribute("class").contains("hidden"); - } - - public boolean isVisibilityDropdownOptionHiddenForNewQuestion(String optionValue) { - return isVisibilityDropdownOptionHidden(optionValue, NEW_QUESTION_NUM); - } - - public boolean isVisibilityDropdownSeparatorHidden(int qnNumber) { - return browser.driver.findElement(By.id("questionTable-" + qnNumber)) - .findElement(By.cssSelector(".visibility-options-dropdown .divider")) - .getAttribute("class").contains("hidden"); - } - - public boolean isVisibilityDropdownSeparatorHiddenForNewQuestion() { - return isVisibilityDropdownSeparatorHidden(NEW_QUESTION_NUM); - } - - private By getVisibilityMessageBy(int questionNumber) { - return By.id("visibilityMessage-" + questionNumber); - } - - private WebElement waitForAndGetVisibilityMessage(int questionNumber) { - WebElement visibilityMessage = waitForElementPresence(getVisibilityMessageBy(questionNumber)); - waitForElementVisibility(visibilityMessage); - return visibilityMessage; - } - - public void verifyVisibilityMessageContains(int questionNumber, String message) { - waitForAndGetVisibilityMessage(questionNumber); - waitForTextContainedInElementPresence(getVisibilityMessageBy(questionNumber), message); - } - - public void verifyVisibilityMessageContainsForNewQuestion(String message) { - verifyVisibilityMessageContains(NEW_QUESTION_NUM, message); - } - - public void verifyVisibilityMessageDoesNotContain(int questionNumber, String message) { - waitForAndGetVisibilityMessage(questionNumber); - waitForTextContainedInElementAbsence(getVisibilityMessageBy(questionNumber), message); - } - - public void verifyVisibilityMessageDoesNotContainForNewQuestion(String message) { - verifyVisibilityMessageDoesNotContain(NEW_QUESTION_NUM, message); - } - - public boolean verifyVisibilityMessageIsDisplayed(int questionNumber) { - WebElement firstMessage = waitForAndGetVisibilityMessage(questionNumber).findElement(By.cssSelector("ul > li")); - return !firstMessage.getText().equals("Error loading visibility hint. Click here to retry."); - } - - public boolean verifyVisibilityMessageIsDisplayedForNewQuestion() { - return verifyVisibilityMessageIsDisplayed(NEW_QUESTION_NUM); - } - - public boolean verifyVisibilityOptionsIsDisplayed(int questionNumber) { - return getVisibilityOptions(questionNumber).isDisplayed(); - } - - /** - * Waits and verifies that the texts of user status messages in the page are equal to the expected error texts. - * @see AppPage#waitForTextsForAllStatusMessagesToUserEquals(String, String...) - */ - public void waitForTextsForAllStatusMessagesToUserEqualsErrorTexts( - String firstExpectedErrorText, String... remainingExpectedErrorTexts) { - // LEGACY IMPLEMENTATION: Status Message is scrolled to when we try to add an invalid question - // so we wait for no scrolling before verifying status message. This allows verification of status message to be - // faster because the text should already be visible. Any tests that follows will then also not get affected by the - // scrolling behavior. - // PROBABLE BETTER IMPLEMENTATION: All AJAX Status messages (not just error status messages) always cause scrolling - // so waiting for the status messages will include waiting for no scrolling before verifying the status messages. - waitForScrollingToComplete(); - waitForTextsForAllStatusMessagesToUserEquals(firstExpectedErrorText, remainingExpectedErrorTexts); - } - - public WebElement getVisibilityOptionTableRow(int questionNumber, int optionRowNumber) { - return getVisibilityOptions(questionNumber).findElement( - By.xpath("(table/tbody/tr|table/tbody/hide)[" + optionRowNumber + "]")); - } - - public String getVisibilityParamShowResponsesTo(int questionNumber) { - return browser.driver.findElement(By.id("form_editquestion-" + questionNumber)) - .findElement(By.cssSelector("input[name='showresponsesto']")) - .getAttribute("value"); - } - - public String getVisibilityParamShowResponsesToForNewQuestion() { - return getVisibilityParamShowResponsesTo(NEW_QUESTION_NUM); - } - - public String getVisibilityParamShowGiverTo(int questionNumber) { - return browser.driver.findElement(By.id("form_editquestion-" + questionNumber)) - .findElement(By.cssSelector("input[name='showgiverto']")) - .getAttribute("value"); - } - - public String getVisibilityParamShowGiverToForNewQuestion() { - return getVisibilityParamShowGiverTo(NEW_QUESTION_NUM); - } - - public String getVisibilityParamShowRecipientTo(int questionNumber) { - return browser.driver.findElement(By.id("form_editquestion-" + questionNumber)) - .findElement(By.cssSelector("input[name='showrecipientto']")) - .getAttribute("value"); - } - - public String getVisibilityParamShowRecipientToForNewQuestion() { - return getVisibilityParamShowRecipientTo(NEW_QUESTION_NUM); - } - - public WebElement getVisibilityOptions(int questionNumber) { - return browser.driver.findElement(By.id("visibilityOptions-" + questionNumber)); - } - - public WebElement getVisibilityOptionsForNewQuestion() { - return getVisibilityOptions(NEW_QUESTION_NUM); - } - - public void toggleNotSureCheck(int questionNumber) { - click(browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_CONTRIBISNOTSUREALLOWED - + "-" + questionNumber))); - } - - public void changeQuestionTypeInForm(int questionNumber, String newQuestionType) { - String selector = "$('#form_editquestion-" + questionNumber + "').find('[name=\"questiontype\"]')"; - String action = ".val('" + newQuestionType + "')"; - executeScript(selector + action); - } - - public void waitForAjaxErrorOnVisibilityMessageButton(int questionNumber) { - String errorMessage = "Error loading visibility hint. Click here to retry."; - By buttonSelector = By.cssSelector("#visibilityMessage-" + questionNumber + " > ul > li"); - waitForTextContainedInElementPresence(buttonSelector, errorMessage); - } - - public void clickResponseVisibilityCheckBox(String checkBoxValue, int questionNumber) { - By responseVisibilitycheckBox = By.cssSelector("#questionTable-" + questionNumber + " input[value='" + checkBoxValue - + "'].answerCheckbox"); - WebElement checkbox = browser.driver.findElement(responseVisibilitycheckBox); - waitForElementVisibility(checkbox); - click(checkbox); - } - - public void clickResponseVisibilityCheckBoxForNewQuestion(String checkBoxValue) { - clickResponseVisibilityCheckBox(checkBoxValue, NEW_QUESTION_NUM); - } - - public void clickGiverNameVisibilityCheckBox(String checkBoxValue, int questionNumber) { - By giverNameVisibilitycheckBox = By.cssSelector("#questionTable-" + questionNumber + " input[value='" + checkBoxValue - + "'].giverCheckbox"); - WebElement checkbox = browser.driver.findElement(giverNameVisibilitycheckBox); - waitForElementVisibility(checkbox); - click(checkbox); - } - - public boolean isCheckboxChecked(String checkboxClass, String checkboxValue, int questionNumber) { - By checkboxSelector = By.cssSelector("#questionTable-" + questionNumber + " input[value='" + checkboxValue - + "']." + checkboxClass); - WebElement checkbox = browser.driver.findElement(checkboxSelector); - return checkbox.isSelected(); - } - - public void clickEnableMinRankOptions(int questionNumber) { - WebElement minNumberOfOptionsToRankCheckbox = getMinOptionsToBeRankedCheckbox(questionNumber); - - minNumberOfOptionsToRankCheckbox.click(); - } - - public void clickMinRankOptions(int questionNumber) { - WebElement minRecipientsToBeRankedInput = getMinOptionsToBeRankedInputElement(questionNumber); - - minRecipientsToBeRankedInput.click(); - } - - public void clearMinRankOptions(int questionNumber) { - WebElement minRecipientsToBeRankedInput = getMinOptionsToBeRankedInputElement(questionNumber); - - minRecipientsToBeRankedInput.clear(); - } -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorFeedbackResultsPage.java b/src/test/java/teammates/test/pageobjects/InstructorFeedbackResultsPage.java deleted file mode 100644 index 660932018dd..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorFeedbackResultsPage.java +++ /dev/null @@ -1,698 +0,0 @@ -package teammates.test.pageobjects; - -import static com.google.common.base.Preconditions.checkState; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.StaleElementReferenceException; -import org.openqa.selenium.WebDriverException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.ExpectedConditions; -import org.openqa.selenium.support.ui.Select; - -import teammates.common.util.Const; -import teammates.common.util.ThreadHelper; -import teammates.common.util.retry.MaximumRetriesExceededException; -import teammates.common.util.retry.RetryableTask; -import teammates.e2e.pageobjects.Browser; - -public class InstructorFeedbackResultsPage extends AppPage { - - @FindBy(id = "collapse-panels-button") - public WebElement collapseExpandButton; - - @FindBy(id = "collapse-panels-button-team-0") - public WebElement instructorPanelCollapseStudentsButton; - - @FindBy(id = "collapse-panels-button-section-0") - public WebElement sectionCollapseStudentsButton; - - @FindBy(id = "show-stats-checkbox") - public WebElement showStatsCheckbox; - - @FindBy(id = "indicate-missing-responses-checkbox") - public WebElement indicateMissingResponsesCheckbox; - - @FindBy(className = "remind-btn-no-response") - public WebElement remindAllButton; - - @FindBy(id = "remindModal") - private WebElement remindModal; - - public InstructorFeedbackResultsPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Session Results

    "); - } - - public String getCourseId() { - return browser.driver.findElement(By.name("courseid")).getAttribute("value"); - } - - public String getFeedbackSessionName() { - return browser.driver.findElement(By.name("fsname")).getAttribute("value"); - } - - /** - * Waits until the page structure is loaded. - * Does not wait for all the content that are loaded by ajax to load. - */ - public void waitForPageStructureToLoad() { - super.waitForPageToLoad(); - } - - public boolean isCorrectPage(String courseId, String feedbackSessionName) { - boolean isCorrectCourseId = this.getCourseId().equals(courseId); - boolean isCorrectFeedbackSessionName = this.getFeedbackSessionName().equals(feedbackSessionName); - return isCorrectCourseId && isCorrectFeedbackSessionName && containsExpectedPageContents(); - } - - public void displayEditSettingsWindow() { - WebElement editBtn = browser.driver.findElement(By.id("editBtn")); - click(editBtn); - waitForElementVisibility(By.id("editModal")); - } - - public void submitEditForm() { - WebElement submitBtn = browser.driver.findElement(By.id("submitBtn")); - submitBtn.submit(); - } - - public void displayByGiverRecipientQuestion() { - displayEditSettingsWindow(); - - Select select = new Select(browser.driver.findElement(By.name(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE))); - select.selectByVisibleText("Group by - Giver > Recipient > Question"); - - submitEditForm(); - } - - public void displayByRecipientGiverQuestion() { - displayEditSettingsWindow(); - - Select select = new Select(browser.driver.findElement(By.name(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE))); - select.selectByVisibleText("Group by - Recipient > Giver > Question"); - - submitEditForm(); - } - - public void displayByGiverQuestionRecipient() { - displayEditSettingsWindow(); - - Select select = new Select(browser.driver.findElement(By.name(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE))); - select.selectByVisibleText("Group by - Giver > Question > Recipient"); - - submitEditForm(); - } - - public void displayByRecipientQuestionGiver() { - displayEditSettingsWindow(); - - Select select = new Select(browser.driver.findElement(By.name(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE))); - select.selectByVisibleText("Group by - Recipient > Question > Giver"); - - submitEditForm(); - } - - public void filterResponsesForSection(String section) { - displayEditSettingsWindow(); - - Select select = new Select(browser.driver.findElements(By.name(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYSECTION)) - .get(1)); - select.selectByVisibleText(section); - - submitEditForm(); - } - - public void filterResponsesForAllSections() { - displayEditSettingsWindow(); - - Select select = new Select(browser.driver.findElements(By.name(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYSECTION)) - .get(1)); - select.selectByVisibleText("All"); - - submitEditForm(); - } - - public void displayByQuestion() { - displayEditSettingsWindow(); - - Select select = new Select(browser.driver.findElement(By.name(Const.ParamsNames.FEEDBACK_RESULTS_SORTTYPE))); - select.selectByVisibleText("Group by - Question"); - - submitEditForm(); - } - - public void clickGroupByTeam() { - displayEditSettingsWindow(); - - WebElement button = browser.driver.findElement(By.name(Const.ParamsNames.FEEDBACK_RESULTS_GROUPBYTEAM)); - click(button); - - submitEditForm(); - } - - public void clickCollapseExpandButtonAndWaitForPanelsToExpand() { - click(collapseExpandButton); - waitForPanelsToExpand(); - } - - public void expandPanels() { - if (isElementPresent("collapse-panels-button")) { - clickCollapseExpandButtonAndWaitForPanelsToExpand(); - } - } - - public void clickCollapseExpandButtonAndWaitForPanelsToCollapse() { - click(collapseExpandButton); - waitForPanelsToCollapse(); - } - - public void clickShowStats() { - displayEditSettingsWindow(); - click(showStatsCheckbox); - submitEditForm(); - } - - public void clickIndicateMissingResponses() { - displayEditSettingsWindow(); - click(indicateMissingResponsesCheckbox); - submitEditForm(); - } - - public void clickRemindAllButtonAndWaitForFormToLoad() { - checkState(isElementInvisibleOrStale(By.className("modal")), - "The Remind All button is not clickable when a modal is opened"); - - click(remindAllButton); - waitForElementVisibility(remindModal); - WebElement remindButton = browser.driver.findElement(By.className("remind-particular-button")); - waitForElementToBeClickable(remindButton); - } - - public void cancelRemindAllForm() { - WebElement remindModal = browser.driver.findElement(By.id("remindModal")); - clickDismissModalButtonAndWaitForModalHidden(remindModal.findElement(By.tagName("button"))); - } - - public void deselectUsersInRemindAllForm() { - WebElement remindModal = browser.driver.findElement(By.id("remindModal")); - List usersToRemind = remindModal.findElements(By.name("usersToRemind")); - for (WebElement e : usersToRemind) { - markCheckBoxAsUnchecked(e); - } - } - - public void clickRemindButtonInModal() { - WebElement remindModal = browser.driver.findElement(By.id("remindModal")); - - clickDismissModalButtonAndWaitForModalHidden(remindModal.findElement(By.className("remind-particular-button"))); - } - - public InstructorFeedbackEditPage clickEditLink() { - WebElement button = browser.driver.findElement(By.id("edit_icon_button")); - click(button); - - InstructorFeedbackEditPage editPage = changePageType(InstructorFeedbackEditPage.class); - editPage.waitForPageToLoad(); - return editPage; - } - - public void clickQuestionAdditionalInfoButton(int qnNumber, String additionalInfoId) { - click(By.id("questionAdditionalInfoButton-" + qnNumber + "-" + additionalInfoId)); - } - - public boolean isQuestionAdditionalInfoVisible(int qnNumber, String additionalInfoId) { - return isElementVisible("questionAdditionalInfo-" + qnNumber + "-" + additionalInfoId); - } - - public String getQuestionAdditionalInfoButtonText(int qnNumber, String additionalInfoId) { - WebElement qnAdditionalInfoButton = browser.driver.findElement(By.id("questionAdditionalInfoButton-" - + qnNumber + "-" + additionalInfoId)); - return qnAdditionalInfoButton.getText(); - } - - public void addFeedbackResponseComment(String addResponseCommentId, String commentText) { - WebElement addResponseCommentForm = browser.driver.findElement(By.id(addResponseCommentId)); - WebElement parentContainer = addResponseCommentForm.findElement(By.xpath("../..")); - WebElement showResponseCommentAddFormButton = parentContainer.findElement(By.id("button_add_comment")); - click(showResponseCommentAddFormButton); - WebElement editorElement = waitForElementPresence(By.cssSelector("#" + addResponseCommentId + " .mce-content-body")); - waitForRichTextEditorToLoad(editorElement.getAttribute("id")); - fillRichTextEditor(editorElement.getAttribute("id"), commentText); - WebElement saveButton = addResponseCommentForm - .findElement(By.className("col-sm-offset-5")) - .findElement(By.tagName("a")); - click(saveButton); - if (commentText.isEmpty()) { - // empty comment: wait until the textarea is clickable again - waitForElementToBeClickable(editorElement); - } else { - // non-empty comment: wait until the add comment form disappears - waitForElementToDisappear(By.id(addResponseCommentId)); - } - } - - public void editFeedbackResponseCommentInOpenedCommentModal(String commentIdSuffix, String newCommentText) { - WebElement commentRow = browser.driver.findElement(By.id("responseCommentRow" + commentIdSuffix)); - click(commentRow.findElements(By.tagName("a")).get(1)); - - WebElement commentEditForm = browser.driver.findElement(By.id("responseCommentEditForm" + commentIdSuffix)); - fillRichTextEditor("responsecommenttext" + commentIdSuffix, newCommentText); - click(commentEditForm.findElement(By.className("col-sm-offset-5")).findElement(By.tagName("a"))); - ThreadHelper.waitFor(1000); - } - - public void clickVisibilityOptionForResponseCommentAndSave(String idString, int numOfTheCheckbox) { - String idSuffix = idString.substring(18); - WebElement commentRow = browser.driver.findElement(By.id(idString)); - click(commentRow.findElements(By.tagName("a")).get(1)); - WebElement commentEditForm = browser.driver.findElement(By.id("responseCommentEditForm" + idSuffix)); - click(commentRow.findElement(By.id("frComment-visibility-options-trigger" + idSuffix))); - click(commentRow.findElements(By.cssSelector("input[type='checkbox']")).get(numOfTheCheckbox)); - click(commentEditForm.findElement(By.className("col-sm-offset-5")).findElement(By.tagName("a"))); - ThreadHelper.waitFor(1000); - } - - public void clickCommentModalButton(String commentId) { - WebElement commentModal = browser.driver.findElement(By.id("commentModal" + commentId)); - WebElement parentTable = commentModal.findElement(By.xpath("../..")); - WebElement commentButton = parentTable.findElement(By.className("comment-button")); - click(commentButton); - } - - public void addFeedbackResponseCommentInCommentModal(String commentId, String commentText) { - WebElement addResponseCommentForm = browser.driver.findElement(By.id(commentId)); - WebElement editorElement = waitForElementPresence(By.cssSelector("#" + commentId + " .mce-content-body")); - waitForRichTextEditorToLoad(editorElement.getAttribute("id")); - fillRichTextEditor(editorElement.getAttribute("id"), commentText); - WebElement saveButton = addResponseCommentForm - .findElement(By.className("col-sm-offset-5")) - .findElement(By.tagName("a")); - click(saveButton); - if (commentText.isEmpty()) { - // empty comment: wait until the textarea is clickable again - waitForElementToBeClickable(editorElement); - } - } - - public void closeCommentModal(String commentId) { - WebElement commentModal = browser.driver.findElement(By.id("commentModal" + commentId)); - WebElement modalFooter = commentModal.findElement(By.className("modal-footer")); - WebElement closeButton = modalFooter.findElement(By.className("commentModalClose")); - - clickDismissModalButtonAndWaitForModalHidden(closeButton); - } - - /** - * Makes sure the result panels are indeed all visible. - */ - public void verifyResultsVisible() { - assertTrue(isAllResultsPanelBodyVisibilityEquals(true)); - } - - /** - * Makes sure the result panels are indeed all hidden. - */ - public void verifyResultsHidden() { - assertTrue(isAllResultsPanelBodyVisibilityEquals(false)); - } - - /** - * Checks if the body of all the results panels are collapsed or expanded. - * @param isVisible true to check for expanded, false to check for collapsed. - * @return true if all results panel body are equals to the visibility being checked. - */ - private boolean isAllResultsPanelBodyVisibilityEquals(boolean isVisible) { - By panelCollapseSelector = By.cssSelector(".panel-heading+.panel-collapse"); - List webElements = browser.driver.findElements(panelCollapseSelector); - int numOfQns = webElements.size(); - - assertTrue(numOfQns > 0); - - for (WebElement e : webElements) { - if (e.isDisplayed() != isVisible) { - return false; - } - } - - return true; - } - - /** - * Waits for all the panels to collapse. - */ - public void waitForPanelsToCollapse() { - By panelCollapseSelector = By.cssSelector("div[id^='panelBodyCollapse-']"); - - waitForElementsToDisappear(browser.driver.findElements(panelCollapseSelector)); - } - - public void waitForPanelsToExpand() { - By panelCollapseSelector = By.cssSelector(".panel-heading+.panel-collapse"); - List webElements = browser.driver.findElements(panelCollapseSelector); - for (WebElement element : webElements) { - try { - waitForElementVisibility(element); - } catch (StaleElementReferenceException e) { - // Case when element has been removed after JS processing - } - } - } - - /** - * Waits for Ajax loaded panel to be expanded. The panel is expanded when Ajax loading finishes, - * which is identified by the removal of Ajax class in the element. - * - * @param panelId the Id of panel element - * @param ajaxClass the class removed from {@code panelElement} when Ajax loading finished - */ - public void waitForAjaxLoadedPanelToExpand(String panelId, String ajaxClass) { - WebElement panelElement = browser.driver.findElement(By.id(panelId)); - waitFor(ExpectedConditions.not(ExpectedConditions.attributeContains(panelElement, "class", ajaxClass))); - } - - public boolean verifyAllStatsVisibility() { - for (WebElement e : browser.driver.findElements(By.className("resultStatistics"))) { - if ("none".equals(e.getCssValue("display"))) { - return false; - } - } - return true; - } - - public boolean verifyMissingResponsesVisibility() { - List pendingResponses = browser.driver.findElements(By.className("pending_response_row")); - return pendingResponses.isEmpty(); - } - - public void deleteFeedbackResponseCommentInModal(String commentIdSuffix) { - deleteFeedbackResponseComment(commentIdSuffix, true); - } - - public void deleteFeedbackResponseCommentInline(String commentIdSuffix) { - deleteFeedbackResponseComment(commentIdSuffix, false); - } - - private void deleteFeedbackResponseComment(String commentIdSuffix, boolean hasParentCommentModal) { - WebElement commentRow = browser.driver.findElement(By.id("responseCommentRow" + commentIdSuffix)); - WebElement deleteCommentButton = - commentRow.findElement(By.tagName("form")).findElement(By.id("commentdelete" + commentIdSuffix)); - - WebElement modalBackdrop = null; - if (hasParentCommentModal) { - modalBackdrop = browser.driver.findElement(By.className("modal-backdrop")); - } - - click(deleteCommentButton); - - if (hasParentCommentModal) { - waitForModalHidden(modalBackdrop); - } - - waitForConfirmationModalAndClickOk(); - ThreadHelper.waitFor(1500); - } - - private void waitForCommentRowContentEquals(String commentRowIdSuffix, String commentText, String giverName) { - By commentRowSelector = By.id("responseCommentRow" + commentRowIdSuffix); - WebElement commentRow = waitForElementPresence(commentRowSelector); - waitForTextContainedInElementPresence(By.id("plainCommentText" + commentRowIdSuffix), commentText); - assertTrue(commentRow.findElement(By.className("text-muted")).getText().contains(giverName) - || commentRow.findElement(By.className("text-muted")).getText().contains("you")); - } - - /** - * Waits for the new comment to be added (works on both modal and inline). - * Note: this only verifies the new comment text is added and only approximately - * checks the state of the added comment based on implementation. - */ - public void waitAndVerifyForFeedbackResponseCommentAdded(String commentRowIdSuffix, String commentText, - String giverName) { - waitForCommentRowContentEquals(commentRowIdSuffix, commentText, giverName); - // Checks approximately that the added comment is constructed correctly - assertTrue(isElementPresent(By.id("responseCommentEditForm" + commentRowIdSuffix))); - } - - public void waitForCommentFormErrorMessageEquals(String commentTableIdSuffix, String errorMessage) { - WebElement errorMessageSpan = waitForElementPresence(By.cssSelector("#errorMessage")); - assertEquals(errorMessage, errorMessageSpan.getText()); - } - - public void clickViewPhotoLink(String panelBodyIndex, String urlRegex) throws MaximumRetriesExceededException { - String panelBodySelector = "#panelBodyCollapse-" + panelBodyIndex; - String popoverSelector = panelBodySelector + " .popover-content"; - String clickSelector = panelBodySelector + " .profile-pic-icon-click a"; - - moveToElementAndClickAfterWaitForPresence(By.cssSelector(clickSelector)); - - verifyPopoverImageUrlWithClickRetry(popoverSelector, clickSelector, urlRegex, "Click and verify photo"); - } - - public void hoverClickAndViewStudentPhotoOnHeading(String panelHeadingIndex, String urlRegex) - throws MaximumRetriesExceededException { - String headingSelector = "#panelHeading-" + panelHeadingIndex; - String popoverSelector = headingSelector + " .popover-content"; - String hoverSelector = headingSelector + " .profile-pic-icon-hover"; - - moveToElement(By.cssSelector(hoverSelector)); - click(waitForElementPresence(By.cssSelector(popoverSelector + " > a"))); - - verifyPopoverImageUrlWithHoverRetry(popoverSelector, hoverSelector, urlRegex, - "Hover and verify student photo on heading"); - } - - public void hoverAndViewStudentPhotoOnBody(String panelBodyIndex, String urlRegex) - throws MaximumRetriesExceededException { - String bodyRowSelector = "#panelBodyCollapse-" + panelBodyIndex + " > .panel-body > .row"; - String popoverSelector = bodyRowSelector + " .popover-content"; - String hoverSelector = bodyRowSelector + " .profile-pic-icon-hover"; - - moveToElement(By.cssSelector(hoverSelector)); - - verifyPopoverImageUrlWithHoverRetry(popoverSelector, hoverSelector, urlRegex, - "Hover and verify student photo on body"); - } - - public void hoverClickAndViewPhotoOnTableCell(int questionBodyIndex, int tableRow, int tableCol, String urlRegex) - throws MaximumRetriesExceededException { - String cellSelector = "#questionBody-" + questionBodyIndex + " .data-table tbody" - + " tr:nth-child(" + (tableRow + 1) + ")" - + " td:nth-child(" + (tableCol + 1) + ")"; - String popoverSelector = cellSelector + " .popover-content"; - String hoverSelector = cellSelector + " .profile-pic-icon-hover"; - - moveToElement(By.cssSelector(hoverSelector)); - click(waitForElementPresence(By.cssSelector(popoverSelector + " > a"))); - - verifyPopoverImageUrlWithHoverRetry(popoverSelector, hoverSelector, urlRegex, - "Hover and verify photo on table cell"); - } - - /** - * Popovers triggered by hover actions sometimes fail to appear, resulting in a {@link WebDriverException}. - * Popover image verifications that depend on hover actions should therefore be retried several times, - * with the hover action triggered before each retry. - */ - private void verifyPopoverImageUrlWithHoverRetry( - String popoverSelector, String hoverSelector, String urlRegex, String taskName) - throws MaximumRetriesExceededException { - uiRetryManager.runUntilNoRecognizedException(new RetryableTask(taskName) { - @Override - public void run() { - verifyPopoverImageUrl(popoverSelector, urlRegex); - } - - @Override - public void beforeRetry() { - moveToElement(By.cssSelector(hoverSelector)); - } - }, WebDriverException.class); - } - - /** - * Similar to {@link #verifyPopoverImageUrlWithHoverRetry}, but for click actions. - */ - private void verifyPopoverImageUrlWithClickRetry( - String popoverSelector, String clickSelector, String urlRegex, String taskName) - throws MaximumRetriesExceededException { - uiRetryManager.runUntilNoRecognizedException(new RetryableTask(taskName) { - @Override - public void run() { - verifyPopoverImageUrl(popoverSelector, urlRegex); - } - - @Override - public void beforeRetry() { - moveToElementAndClickAfterWaitForPresence(By.cssSelector(clickSelector)); - } - }, WebDriverException.class); - } - - private void verifyPopoverImageUrl(String popoverSelector, String urlRegex) { - String imgSrc = getElementSrcWithRetryAfterWaitForPresence(By.cssSelector(popoverSelector + " > img")); - verifyImageUrl(urlRegex, imgSrc); - } - - public void hoverClickAndViewGiverPhotoOnTableCell(int questionBodyIndex, int tableRow, String urlRegex) - throws MaximumRetriesExceededException { - hoverClickAndViewPhotoOnTableCell(questionBodyIndex, tableRow, 1, urlRegex); - } - - public void hoverClickAndViewRecipientPhotoOnTableCell(int questionBodyIndex, int tableRow, String urlRegex) - throws MaximumRetriesExceededException { - hoverClickAndViewPhotoOnTableCell(questionBodyIndex, tableRow, 3, urlRegex); - } - - public void removeNavBar() { - executeScript("document.getElementsByClassName('navbar-fixed-top')[0].parentNode.removeChild(" - + "document.getElementsByClassName('navbar-fixed-top')[0])"); - } - - public void verifyModerateResponseButtonBelongsTo(WebElement btn, String email) { - assertEquals(email, btn.findElement(By.xpath("input[5]")).getAttribute("value")); - } - - public WebElement getModerateResponseButtonInQuestionView(int qnNo, int responseNo) { - return browser.driver.findElement(By.id("questionBody-" + (qnNo - 1))) - .findElement(By.className("table-responsive")) - .findElement(By.xpath("table/tbody/tr[" + responseNo + "]/td[6]/form")); - } - - public void clickInstructorPanelCollapseStudentsButton() { - click(instructorPanelCollapseStudentsButton); - } - - public void clickSectionCollapseStudentsButton() { - click(sectionCollapseStudentsButton); - } - - public void waitForInstructorPanelStudentPanelsToCollapse() { - List studentPanels = browser.driver.findElements( - By.cssSelector("#panelBodyCollapse-0-1 .panel-collapse")); - waitForElementsToDisappear(studentPanels); - } - - public void waitForSectionStudentPanelsToCollapse() { - List studentPanels = browser.driver.findElements( - By.cssSelector("#panelBodyCollapse-section-0-1 .panel-collapse")); - waitForElementsToDisappear(studentPanels); - } - - public void verifyPanelForParticipantIsDisplayed(String participantIdentifier) { - WebElement panel = browser.driver.findElement( - By.xpath("//div[contains(@class, 'panel-primary') or contains(@class, 'panel-default')]" - + "[contains(.,'[" + participantIdentifier + "]')]")); - assertTrue(panel.isDisplayed()); - } - - public void verifySpecifiedPanelIdsAreCollapsed(String[] ids) { - for (String id : ids) { - WebElement panel = browser.driver.findElement(By.id("panelBodyCollapse-" + id)); - assertFalse(panel.isDisplayed()); - } - } - - public boolean isSectionPanelExist(String section) { - List panelsWithHeading = - browser.driver.findElements(By.cssSelector("div[id^='panelHeading-'] .panel-heading-text")); - for (WebElement panel : panelsWithHeading) { - String panelSectionName = panel.getText(); - if (panelSectionName.equals(section)) { - return true; - } - } - return false; - } - - public void changeFsNameInAjaxLoadResponsesForm(int indexOfForm, String newFsName) { - executeScript("$('.ajax_submit:eq(" + indexOfForm + ") [name=\"fsname\"]').val('" + newFsName + "')"); - } - - public void changeFsNameInNoResponsePanelForm(String newFsName) { - executeScript("$('.ajax-response-submit [name=\"fsname\"]').val('" + newFsName + "')"); - } - - public void waitForAjaxError(int indexOfForm) { - By ajaxErrorSelector = By.cssSelector(".ajax_submit:nth-of-type(" + indexOfForm - + ") .ajax-error"); - waitForElementPresence(ajaxErrorSelector); - - waitForTextContainedInElementPresence(ajaxErrorSelector, "[ Failed to load. Click here to retry. ]"); - } - - public void waitForAjaxErrorOnNoResponsePanel() { - By ajaxErrorSelector = By.cssSelector(".ajax-response-submit .ajax-error"); - waitForElementPresence(ajaxErrorSelector); - - waitForTextContainedInElementPresence(ajaxErrorSelector, "[ Failed to load. Click here to retry. ]"); - } - - private void moveToElement(By by) { - moveToElement(browser.driver.findElement(by)); - } - - private void moveToElement(WebElement element) { - new Actions(browser.driver).moveToElement(element).perform(); - } - - private void moveToElementAndClickAfterWaitForPresence(By by) { - WebElement element = waitForElementPresence(by); - moveToElement(element); - click(element); - } - - private String getElementSrcWithRetryAfterWaitForPresence(By by) { - try { - waitForAjaxLoaderGifToDisappear(); - return waitForElementPresence(by).getAttribute("src"); - } catch (StaleElementReferenceException e) { - // Element changed (e.g. loading gif changed to actual image) - return waitForElementPresence(by).getAttribute("src"); - } - } - - /** - * Expands a particular question panel, causing its results to load. - */ - public void loadResultQuestionPanel(int questionNumber) { - String panelId = "panelHeading-" + questionNumber; - clickPanelAndWaitForExpansion(panelId); - } - - /** - * Expands a particular section panel, causing its results to load. - */ - public void loadResultSectionPanel(int panelNumber, int sectionNumber) { - String panelId = "panelHeading-section-" + panelNumber + "-" + sectionNumber; - clickPanelAndWaitForExpansion(panelId); - } - - /** - * Expands a particular large scale results panel, causing its results to load. - */ - public void loadResultLargeScalePanel(int panelNumber) { - String panelId = "panelHeading-" + panelNumber; - clickLargeScalePanelAndWaitForExpansion(panelId); - } - - private void clickPanelAndWaitForExpansion(String panelId) { - clickElementById(panelId); - waitForAjaxLoadedPanelToExpand(panelId, "ajax_auto"); - } - - private void clickLargeScalePanelAndWaitForExpansion(String panelId) { - clickElementById(panelId); - waitForAjaxLoadedPanelToExpand(panelId, "ajax_submit"); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorFeedbackSessionsPage.java b/src/test/java/teammates/test/pageobjects/InstructorFeedbackSessionsPage.java deleted file mode 100644 index 2c332b53420..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorFeedbackSessionsPage.java +++ /dev/null @@ -1,706 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.fail; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.common.util.Const; -import teammates.common.util.TimeHelper; -import teammates.e2e.pageobjects.Browser; -import teammates.test.driver.TimeHelperExtension; - -public class InstructorFeedbackSessionsPage extends AppPage { - - @FindBy(id = "sessionTemplateType") - private WebElement sessionTemplateType; - - @FindBy(id = "courseid") - private WebElement courseIdDropdown; - - @FindBy(id = "fsname") - private WebElement fsNameTextBox; - - @FindBy(id = "starttime") - private WebElement startTimeDropdown; - - @FindBy(id = "endtime") - private WebElement endTimeDropdown; - - @FindBy (id = "visibletime") - private WebElement visibleTimeDropdown; - - @FindBy (id = "publishtime") - private WebElement publishTimeDropdown; - - @FindBy (id = "timezone") - private WebElement timezoneDropdown; - - @FindBy(id = "graceperiod") - private WebElement gracePeriodDropdown; - - @FindBy(id = "editUncommonSettingsSessionResponsesVisibleButton") - private WebElement uncommonSettingsSessionResponsesVisibleButton; - - @FindBy(id = "editUncommonSettingsSendEmailsButton") - private WebElement uncommonSettingsSendEmailsButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON + "_custom") - private WebElement customSessionVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + "_custom") - private WebElement customResultsVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SESSIONVISIBLEBUTTON + "_atopen") - private WebElement defaultSessionVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + "_atvisible") - private WebElement defaultResultsVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + "_later") - private WebElement manualResultsVisibleTimeButton; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SENDREMINDEREMAIL + "_open") - private WebElement sendOpenEmailCheckbox; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SENDREMINDEREMAIL + "_closing") - private WebElement sendClosingEmailCheckbox; - - @FindBy(id = Const.ParamsNames.FEEDBACK_SESSION_SENDREMINDEREMAIL + "_published") - private WebElement sendPublishedEmailCheckbox; - - @FindBy(id = "button_submit") - private WebElement submitButton; - - @FindBy(id = "button_copy") - private WebElement copyButton; - - @FindBy(id = "button_copy_submit") - private WebElement copySubmitButton; - - @FindBy(id = "modalCopiedCourseId") - private WebElement copiedCourseIdDropdown; - - @FindBy(id = "modalCopiedSessionName") - private WebElement copiedFsNameTextBox; - - @FindBy(id = "button_sortname") - private WebElement sortByNameIcon; - - @FindBy(id = "button_sortid") - private WebElement sortByIdIcon; - - @FindBy(id = "resendPublishedEmailModal") - private WebElement resendPublishedEmailModal; - - @FindBy(id = "softDeletedSessionsHeading") - private WebElement panelHeading; - - private InstructorCopyFsToModal fsCopyToModal; - - public InstructorFeedbackSessionsPage(Browser browser) { - super(browser); - fsCopyToModal = new InstructorCopyFsToModal(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Add New Feedback Session

    "); - } - - public InstructorCopyFsToModal getFsCopyToModal() { - return fsCopyToModal; - } - - public void selectSessionType(String visibleText) { - selectDropdownByVisibleValue(sessionTemplateType, visibleText); - } - - public AppPage sortByName() { - click(sortByNameIcon); - waitForPageToLoad(); - return this; - } - - public AppPage sortById() { - click(sortByIdIcon); - waitForPageToLoad(); - return this; - } - - public void clickSubmitButton() { - click(submitButton); - waitForPageToLoad(); - } - - public void clickEditUncommonSettingsButtons() { - clickEditUncommonSettingsSessionResponsesVisibleButton(); - clickEditUncommonSettingsSendEmailsButton(); - } - - public void clickEditUncommonSettingsSessionResponsesVisibleButton() { - click(uncommonSettingsSessionResponsesVisibleButton); - } - - public void clickEditUncommonSettingsSendEmailsButton() { - click(uncommonSettingsSendEmailsButton); - } - - public void clickCustomVisibleTimeButton() { - click(customSessionVisibleTimeButton); - } - - public void clickCustomPublishTimeButton() { - click(customResultsVisibleTimeButton); - } - - public void clickManualPublishTimeButton() { - click(manualResultsVisibleTimeButton); - } - - public void clickDefaultVisibleTimeButton() { - click(defaultSessionVisibleTimeButton); - } - - public void clickDefaultPublishTimeButton() { - click(defaultResultsVisibleTimeButton); - } - - public void clickCopyButton() { - scrollElementToCenterAndClick(copyButton); - } - - public void clickCopySubmitButton() { - click(copySubmitButton); - waitForPageToLoad(); - } - - public void clickViewResponseLink(String courseId, String sessionName) { - click(getViewResponseLink(courseId, sessionName)); - waitForPageToLoad(); - } - - public void toggleSendOpenEmailCheckbox() { - click(sendOpenEmailCheckbox); - } - - public void toggleSendClosingEmailCheckbox() { - click(sendClosingEmailCheckbox); - } - - public void toggleSendPublishedEmailCheckbox() { - click(sendPublishedEmailCheckbox); - } - - public void addFeedbackSession( - String feedbackSessionName, - String courseId, - LocalDateTime startTime, - LocalDateTime endTime, - LocalDateTime visibleTime, - LocalDateTime publishTime, - String instructions, - long gracePeriod) { - - fillTextBox(fsNameTextBox, feedbackSessionName); - - waitForElementVisibility(courseIdDropdown); - selectDropdownByVisibleValue(courseIdDropdown, courseId); - - // fill in time values - fillStartTime(startTime); - fillEndTime(endTime); - fillVisibleTime(visibleTime); - fillPublishTime(publishTime); - - // Fill in instructions - if (instructions != null) { - fillRichTextEditor("instructions", instructions); - } - - // Select grace period - if (gracePeriod != -1) { - selectDropdownByVisibleValue(gracePeriodDropdown, Long.toString(gracePeriod) + " mins"); - } - - clickSubmitButton(); - } - - public void copyFeedbackSession(String feedbackSessionName, String courseId) { - String copyButtonId = "button_copy"; - this.waitForTextContainedInElementPresence( - By.id(copyButtonId), "Copy from previous feedback sessions"); - clickCopyButton(); - this.waitForElementVisibility(copiedFsNameTextBox); - fillTextBox(copiedFsNameTextBox, feedbackSessionName); - selectDropdownByVisibleValue(copiedCourseIdDropdown, courseId); - - clickCopyTableAtRow(0); - clickCopySubmitButton(); - } - - public void copyFeedbackSessionTestButtons(String feedbackSessionName, String courseId) { - clickCopyButton(); - this.waitForElementVisibility(copiedFsNameTextBox); - fillTextBox(copiedFsNameTextBox, feedbackSessionName); - selectDropdownByVisibleValue(copiedCourseIdDropdown, courseId); - } - - public void clickCopyTableAtRow(int rowIndex) { - WebElement row = browser.driver.findElement(By.id("copyTableModal")) - .findElements(By.tagName("tr")) - .get(rowIndex + 1); - click(row); - } - - public void clickCopyTableRadioButtonAtRow(int rowIndex) { - WebElement button = browser.driver.findElement(By.id("copyTableModal")) - .findElements(By.tagName("tr")) - .get(rowIndex + 1).findElement(By.tagName("input")); - click(button); - } - - public void fillStartTime(LocalDateTime startTime) { - fillTimeValueIfNotNull(Const.ParamsNames.FEEDBACK_SESSION_STARTDATE, startTime, startTimeDropdown); - } - - public void fillEndTime(LocalDateTime endTime) { - fillTimeValueIfNotNull(Const.ParamsNames.FEEDBACK_SESSION_ENDDATE, endTime, endTimeDropdown); - } - - public void fillVisibleTime(LocalDateTime visibleTime) { - fillTimeValueIfNotNull(Const.ParamsNames.FEEDBACK_SESSION_VISIBLEDATE, visibleTime, visibleTimeDropdown); - } - - public void fillPublishTime(LocalDateTime publishTime) { - fillTimeValueIfNotNull(Const.ParamsNames.FEEDBACK_SESSION_PUBLISHDATE, publishTime, publishTimeDropdown); - } - - public void fillTimeValueIfNotNull(String dateId, LocalDateTime datetimeValue, WebElement timeDropdown) { - if (datetimeValue != null) { - executeScript("$('#" + dateId + "').val('" + TimeHelper.formatDateForSessionsForm(datetimeValue) + "');"); - - String timeDropdownId = timeDropdown.getAttribute("id"); - int timeDropdownVal = TimeHelperExtension.convertToOptionValueInTimeDropDown(datetimeValue); - executeScript("$('#" + timeDropdownId + "').val(" + timeDropdownVal + ")"); - } - } - - /** - * This method contains an intended mix of Selenium and JavaScript to ensure that the test - * passes consistently, do not try to click on the datepicker element using Selenium as it will - * result in a test that passes or fail randomly. - */ - public void fillTimeValueForDatePickerTest(String timeId, LocalDate newValue) { - WebElement dateInputElement = browser.driver.findElement(By.id(timeId)); - click(dateInputElement); - dateInputElement.clear(); - dateInputElement.sendKeys(TimeHelper.formatDateForSessionsForm(newValue.atStartOfDay())); - - List elements = browser.driver.findElements(By.className("ui-datepicker-current-day")); - for (WebElement element : elements) { - click(element); - } - } - - public String getValueOfDate(String timeId) { - return (String) executeScript("return $('#" + timeId + "').datepicker('getDate') == null ? " - + "null : " - + "$('#" + timeId + "').datepicker('getDate').toDateString();"); - } - - public String getMinDateOf(String timeId) { - return (String) executeScript("return $('#" + timeId + "').datepicker('option', 'minDate') == null ? " - + "null : " - + "$('#" + timeId + "').datepicker('option', 'minDate').toDateString();"); - } - - public String getMaxDateOf(String timeId) { - return (String) executeScript("return $('#" + timeId + "').datepicker('option', 'maxDate') == null ? " - + "null : " - + "$('#" + timeId + "').datepicker('option', 'maxDate').toDateString();"); - } - - public String getSessionType() { - return sessionTemplateType.getAttribute("value"); - } - - public String getStartTime() { - return startTimeDropdown.getAttribute("value"); - } - - public String getEndTime() { - return endTimeDropdown.getAttribute("value"); - } - - public String getVisibleTime() { - return visibleTimeDropdown.getAttribute("value"); - } - - public String getTimeZone() { - return timezoneDropdown.getAttribute("value"); - } - - public String getInstructions() { - return getRichTextEditorContent("instructions"); - } - - public void setStartTime(int hour) { - executeScript("$('#" + startTimeDropdown.getAttribute("id") + "').val(" + hour + ")"); - } - - public void setVisibleTime(int hour) { - executeScript("$('#" + visibleTimeDropdown.getAttribute("id") + "').val(" + hour + ")"); - } - - public boolean isRowSelected(int rowIndex) { - WebElement row = browser.driver.findElement(By.id("copyTableModal")) - .findElements(By.tagName("tr")) - .get(rowIndex + 1); - - return row.getAttribute("class").contains("row-selected"); - } - - public boolean isRadioButtonChecked(int rowIndex) { - WebElement button = browser.driver.findElement(By.id("copyTableModal")) - .findElements(By.tagName("tr")) - .get(rowIndex + 1).findElement(By.tagName("input")); - - return button.isSelected(); - } - - public boolean isCopySubmitButtonEnabled() { - return copySubmitButton.isEnabled(); - } - - public WebElement getViewResponseLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return browser.driver.findElement( - By.xpath("//tbody/tr[" + (sessionRowId + 1) - + "]/td[contains(@class,'session-response-for-test')]/a")); - } - - public String getResponseValue(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return browser.driver.findElement( - By.xpath("//tbody/tr[" + (sessionRowId + 1) - + "]/td[contains(@class,'session-response-for-test')]")).getText(); - } - - public void verifyResponseValue(String responseRate, String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - waitForTextContainedInElementPresence( - By.xpath("//tbody/tr[" + (sessionRowId + 1) + "]/td[contains(@class,'session-response-for-test')]"), - responseRate); - } - - public WebElement getViewResultsLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return getLinkAtTableRow("session-view-for-test", sessionRowId); - } - - public WebElement getEditLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return getLinkAtTableRow("session-edit-for-test", sessionRowId); - } - - public WebElement getMoveToRecycleBinLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return getLinkAtTableRow("session-delete", sessionRowId); - } - - public WebElement getRestoreLink(String courseId, String sessionName) { - click(panelHeading); - waitForElementVisibility(browser.driver.findElement(By.id("softdeletedcourseid0"))); - int sessionRowId = getSoftDeletedFeedbackSessionRowId(courseId, sessionName); - return getLinkAtSoftDeletedTableRow("t_session_restore", sessionRowId); - } - - public WebElement getRestoreAllLink() { - return browser.driver.findElement(By.id("btn-session-restoreall")); - } - - public WebElement getDeleteLink(String courseId, String sessionName) { - click(panelHeading); - waitForElementVisibility(browser.driver.findElement(By.id("softdeletedcourseid0"))); - int sessionRowId = getSoftDeletedFeedbackSessionRowId(courseId, sessionName); - return getLinkAtSoftDeletedTableRow("t_session_delete", sessionRowId); - } - - public WebElement getDeleteAllLink() { - return browser.driver.findElement(By.id("btn-session-deleteall")); - } - - public WebElement getSubmitLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return getLinkAtTableRow("session-submit-for-test", sessionRowId); - } - - public WebElement getPublishLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return getLinkAtTableRow("session-publish-for-test", sessionRowId); - } - - public WebElement getResendPublishedEmailLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return getLinkAtTableRow("session-resend-published-email-for-test", sessionRowId); - } - - public WebElement getUnpublishLink(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return getLinkAtTableRow("session-unpublish-for-test", sessionRowId); - } - - public void verifyPublishLinkHidden(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - try { - getLinkAtTableRow("session-publish-for-test", sessionRowId); - fail("This element should be hidden."); - } catch (NoSuchElementException e) { - return; - } - } - - public void verifyUnpublishLinkHidden(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - try { - getLinkAtTableRow("session-unpublish-for-test", sessionRowId); - fail("This element should be hidden."); - } catch (NoSuchElementException e) { - return; - } - } - - public boolean isSessionResultsOptionsCaretDisabled(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - return !browser.driver.findElement( - By.xpath("//tbody/tr[" + (sessionRowId + 1) - + "]//button[contains(@class,'session-results-options')]")).isEnabled(); - } - - public boolean isHidden(By locator) { - return !browser.driver.findElement(locator).isDisplayed(); - } - - public boolean isEnabled(By locator) { - return browser.driver.findElement(locator).isEnabled(); - } - - public boolean isDisabled(By locator) { - return !browser.driver.findElement(locator).isEnabled(); - } - - public boolean isVisible(By locator) { - return browser.driver.findElement(locator).isDisplayed(); - } - - public boolean isContainingCssClass(By locator, String className) { - return browser.driver.findElement(locator).getAttribute("class").matches(".*\\b" + className + "\\b.*"); - } - - public InstructorFeedbackResultsPage loadViewResultsLink(String courseId, String fsName) { - int sessionRowId = getFeedbackSessionRowId(courseId, fsName); - String className = "session-view-for-test"; - return goToLinkInRow( - By.xpath("//tbody/tr[" + (sessionRowId + 1) - + "]//a[contains(@class,'" + className + "')]"), - InstructorFeedbackResultsPage.class); - } - - public FeedbackSubmitPage loadSubmitLink(String courseId, String fsName) { - int sessionRowId = getFeedbackSessionRowId(courseId, fsName); - String className = "session-submit-for-test"; - return goToLinkInRow( - By.xpath("//tbody/tr[" + (sessionRowId + 1) - + "]//a[contains(@class,'" + className + "')]"), - FeedbackSubmitPage.class); - } - - public InstructorFeedbackEditPage loadEditLink(String courseId, String fsName) { - int sessionRowId = getFeedbackSessionRowId(courseId, fsName); - String className = "session-edit-for-test"; - return goToLinkInRow( - By.xpath("//tbody/tr[" + (sessionRowId + 1) - + "]//a[contains(@class,'" + className + "')]"), - InstructorFeedbackEditPage.class); - } - - public String getPageUrl() { - return browser.driver.getCurrentUrl(); - } - - private WebElement getLinkAtTableRow(String className, int rowIndex) { - return browser.driver.findElement( - By.xpath("//table[contains(@id,'table-sessions')]//tbody/tr[" - + (rowIndex + 1) + "]//a[contains(@class,'" + className + "')]")); - } - - private WebElement getLinkAtSoftDeletedTableRow(String className, int rowIndex) { - return browser.driver.findElement(By.className(className + rowIndex)); - } - - private int getFeedbackSessionRowId(String courseId, String sessionName) { - int i = 0; - while (i < getFeedbackSessionsCount()) { - if (getFeedbackSessionCourseId(i).equals(courseId) - && getFeedbackSessionName(i).equals(sessionName)) { - return i; - } - i++; - } - return -1; - } - - private int getSoftDeletedFeedbackSessionRowId(String courseId, String sessionName) { - int i = 0; - while (i < getSoftDeletedFeedbackSessionsCount()) { - if (getSoftDeletedFeedbackSessionCourseId(i).equals(courseId) - && getSoftDeletedFeedbackSessionName(i).equals(sessionName)) { - return i; - } - i++; - } - return -1; - } - - private int getFeedbackSessionsCount() { - // wait for the async fetch before counting the number of feedback session - waitForElementPresence(By.id("table-sessions")); - return browser.driver.findElements(By.className("sessionsRow")).size(); - } - - private int getSoftDeletedFeedbackSessionsCount() { - By softDeletedSessionsTable = By.id("tableSoftDeletedFeedbackSessions"); - waitForElementPresence(softDeletedSessionsTable); - return browser.driver.findElement(softDeletedSessionsTable).findElements(By.tagName("tr")).size(); - } - - private String getFeedbackSessionCourseId(int rowId) { - return browser.driver.findElement(By.id("table-sessions")) - .findElements(By.xpath("tbody/tr")).get(rowId) - .findElements(By.xpath("td")).get(0) - .getText(); - } - - private String getSoftDeletedFeedbackSessionCourseId(int rowId) { - return browser.driver.findElement(By.id("tableSoftDeletedFeedbackSessions")) - .findElements(By.xpath("tbody/tr")).get(rowId) - .findElements(By.xpath("td")).get(0) - .getText(); - } - - private String getFeedbackSessionName(int rowId) { - return browser.driver.findElement(By.id("table-sessions")) - .findElements(By.xpath("tbody/tr")).get(rowId) - .findElements(By.xpath("td")).get(1) - .getText(); - } - - private String getSoftDeletedFeedbackSessionName(int rowId) { - return browser.driver.findElement(By.id("tableSoftDeletedFeedbackSessions")) - .findElements(By.xpath("tbody/tr")).get(rowId) - .findElements(By.xpath("td")).get(1) - .getText(); - } - - private T goToLinkInRow(By locator, Class destinationPageType) { - click(browser.driver.findElement(locator)); - waitForPageToLoad(); - return changePageType(destinationPageType); - } - - public void clickFsCopyButton(String courseId, String feedbackSessionName) { - By fsCopyButtonElement = By.id("button_fscopy" + "-" + courseId + "-" + feedbackSessionName); - - // give it some time to load as it is loaded via AJAX - waitForElementPresence(fsCopyButtonElement); - - WebElement fsCopyButton = browser.driver.findElement(fsCopyButtonElement); - click(fsCopyButton); - } - - public InstructorFeedbackSessionsPage moveSessionToRecycleBin(String courseId, String sessionName) { - click(getMoveToRecycleBinLink(courseId, sessionName)); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackSessionsPage restoreSession(String courseId, String sessionName) { - click(getRestoreLink(courseId, sessionName)); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackSessionsPage restoreAllSessions() { - click(getRestoreAllLink()); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackSessionsPage deleteSessionAndCancel(String courseId, String sessionName) { - clickAndCancel(getDeleteLink(courseId, sessionName)); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackSessionsPage deleteSessionAndConfirm(String courseId, String sessionName) { - clickAndConfirm(getDeleteLink(courseId, sessionName)); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackSessionsPage deleteAllSessionsAndCancel() { - clickAndCancel(getDeleteAllLink()); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackSessionsPage deleteAllSessionsAndConfirm() { - clickAndConfirm(getDeleteAllLink()); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public void changeUserIdInAjaxForSessionsForm(String newUserId) { - executeScript("$('#ajaxForSessions [name=\"user\"]').val('" + newUserId + "');"); - } - - public void reloadSessionsList() { - executeScript("setIsSessionsAjaxSendingFalse();"); - executeScript("$('#ajaxForSessions').submit();"); - } - - public boolean checkIfResendPublishedEmailButtonExists(String courseId, String sessionName) { - int sessionRowId = getFeedbackSessionRowId(courseId, sessionName); - try { - getLinkAtTableRow("session-resend-published-email-for-test", sessionRowId); - return true; - } catch (NoSuchElementException e) { - return false; - } - } - - public void clickResendPublishedEmailLink(String courseId, String evalName) { - click(getResendPublishedEmailLink(courseId, evalName)); - waitForElementVisibility(resendPublishedEmailModal); - } - - public void cancelResendPublishedEmailForm() { - cancelModalForm(resendPublishedEmailModal); - } - - public void submitResendPublishedEmailForm() { - resendPublishedEmailModal.findElement(By.name("form_email_list")).submit(); - } - - public void fillResendPublishedEmailForm() { - checkCheckboxesInForm(resendPublishedEmailModal, "usersToEmail"); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorHelpPage.java b/src/test/java/teammates/test/pageobjects/InstructorHelpPage.java deleted file mode 100644 index 5520da58f7d..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorHelpPage.java +++ /dev/null @@ -1,55 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.e2e.pageobjects.Browser; - -public class InstructorHelpPage extends AppPage { - - public InstructorHelpPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Help for Instructors

    "); - } - - public void inputSearchQuery(String query) { - WebElement searchBox = getSearchBox(); - fillTextBox(searchBox, query); - } - - public void clickSearchButton() { - WebElement searchButton = getSearchButton(); - click(searchButton); - } - - public void clickResetButton() { - WebElement resetButton = getResetButton(); - click(resetButton); - } - - public void clearSearchBox() { - WebElement searchBox = getSearchBox(); - searchBox.clear(); - } - - public String getSearchResults() { - WebElement searchResults = browser.driver.findElement(By.id("searchResults")); - return searchResults.getAttribute("innerHTML"); - } - - private WebElement getResetButton() { - return browser.driver.findElement(By.id("clear")); - } - - private WebElement getSearchButton() { - return browser.driver.findElement(By.id("search")); - } - - private WebElement getSearchBox() { - return browser.driver.findElement(By.id("searchQuery")); - } -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorHomePage.java b/src/test/java/teammates/test/pageobjects/InstructorHomePage.java deleted file mode 100644 index 3137fac1637..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorHomePage.java +++ /dev/null @@ -1,393 +0,0 @@ -package teammates.test.pageobjects; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -public class InstructorHomePage extends AppPage { - - @FindBy(id = "searchBox") - private WebElement searchBox; - - @FindBy(id = "buttonSearch") - private WebElement searchButton; - - @FindBy(id = "sortById") - private WebElement sortByIdButton; - - @FindBy(id = "sortByName") - private WebElement sortByNameButton; - - @FindBy(id = "sortByDate") - private WebElement sortByDateButton; - - @FindBy(id = "remindModal") - private WebElement remindModal; - - @FindBy(id = "resendPublishedEmailModal") - private WebElement resendPublishedEmailModal; - - @FindBy(className = "button_sortname") - private List tablesSortByName; - - @FindBy(className = "button_sortstartdate") - private List tablesSortByStartDate; - - @FindBy(className = "button_sortenddate") - private List tablesSortByEndDate; - - private InstructorCopyFsToModal fsCopyModal; - - public InstructorHomePage(Browser browser) { - super(browser); - if (InstructorCopyFsToModal.isPresentOnPage(browser)) { - this.fsCopyModal = new InstructorCopyFsToModal(browser); - } - } - - public InstructorCopyFsToModal getFsCopyModal() { - return fsCopyModal; - } - - @Override - protected boolean containsExpectedPageContents() { - return containsExpectedPageContents(getPageSource()); - } - - public static boolean containsExpectedPageContents(String pageSource) { - return pageSource.contains("

    Home

    "); - } - - public void clickSortByIdButton() { - click(sortByIdButton); - waitForPageToLoad(); - } - - public void clickSortByNameButton() { - click(sortByNameButton); - waitForPageToLoad(); - } - - public void clickSortByDateButton() { - click(sortByDateButton); - waitForPageToLoad(); - } - - private void clickElements(List elements) { - for (WebElement ele : elements) { - click(ele); - } - } - - public void sortTablesByName() { - clickElements(tablesSortByName); - } - - public void sortTablesByStartDate() { - clickElements(tablesSortByStartDate); - } - - public void sortTablesByEndDate() { - clickElements(tablesSortByEndDate); - } - - public InstructorCourseEnrollPage clickCourseEnrollLink(String courseId) { - click(getCourseLinkInRow("course-enroll-for-test", getCourseRowId(courseId))); - waitForPageToLoad(); - return changePageType(InstructorCourseEnrollPage.class); - } - - public InstructorCourseDetailsPage clickCourseViewLink(String courseId) { - click(getCourseLinkInRow("course-view-for-test", getCourseRowId(courseId))); - waitForPageToLoad(); - return changePageType(InstructorCourseDetailsPage.class); - } - - public InstructorCourseEditPage clickCourseEditLink(String courseId) { - click(getCourseLinkInRow("course-edit-for-test", getCourseRowId(courseId))); - waitForPageToLoad(); - return changePageType(InstructorCourseEditPage.class); - } - - public void clickCourseDeleteLink(String courseId) { - click(getDeleteCourseLink(courseId)); - } - - //TODO: rename course-add-eval-for-test - public InstructorFeedbackSessionsPage clickCourseAddEvaluationLink(String courseId) { - click(getCourseLinkInRow("course-add-eval-for-test", getCourseRowId(courseId))); - waitForPageToLoad(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public InstructorFeedbackResultsPage clickFeedbackSessionViewResultsLink(String courseId, String fsName) { - click(getViewResultsLink(courseId, fsName)); - waitForPageToLoad(); - return changePageType(InstructorFeedbackResultsPage.class); - } - - public InstructorFeedbackEditPage clickFeedbackSessionEditLink(String courseId, String fsName) { - click(getEditLink(courseId, fsName)); - waitForPageToLoad(); - return changePageType(InstructorFeedbackEditPage.class); - } - - public InstructorFeedbackSessionsPage clickFeedbackSessionDeleteLink(String courseId, String fsName) { - clickAndConfirm(getDeleteEvalLink(courseId, fsName)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorFeedbackSessionsPage.class); - } - - public FeedbackSubmitPage clickFeedbackSessionSubmitLink(String courseId, String fsName) { - click(getSubmitLink(courseId, fsName)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(FeedbackSubmitPage.class); - } - - public InstructorHomePage clickFeedbackSessionRemindLink(String courseId, String fsName) { - clickAndConfirm(getRemindLink(courseId, fsName)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorHomePage.class); - } - - public InstructorHomePage clickFeedbackSessionUnpublishLink(String courseId, String fsName) { - clickAndConfirm(getUnpublishLink(courseId, fsName)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorHomePage.class); - } - - public InstructorHomePage clickFeedbackSessionPublishLink(String courseId, String fsName) { - clickAndConfirm(getPublishLink(courseId, fsName)); - return changePageType(InstructorHomePage.class); - } - - public void clickResendPublishedEmailLink(String courseId, String evalName) { - click(getResendPublishedEmailLink(courseId, evalName)); - waitForElementVisibility(resendPublishedEmailModal); - } - - public void cancelResendPublishedEmailForm() { - cancelModalForm(resendPublishedEmailModal); - } - - public void fillResendPublishedEmailForm() { - checkCheckboxesInForm(resendPublishedEmailModal, "usersToEmail"); - } - - public void submitResendPublishedEmailForm() { - resendPublishedEmailModal.findElement(By.name("form_email_list")).submit(); - } - - public InstructorStudentListPage searchForStudent(String studentName) { - searchBox.clear(); - searchBox.sendKeys(studentName); - click(searchButton); - waitForPageToLoad(); - return changePageType(InstructorStudentListPage.class); - } - - public WebElement getViewResponseLink(String courseId, String evalName) { - int evaluationRowId = getEvaluationRowId(courseId, evalName); - String xpathExp = "//tr[@id='session" + evaluationRowId + "']/td[contains(@class,'session-response-for-test')]/a"; - - return browser.driver.findElement(By.xpath(xpathExp)); - } - - public void setViewResponseLinkValue(WebElement element, String newValue) { - executeScript("arguments[0].href=arguments[1]", element, newValue); - } - - public void clickViewResponseLink(String courseId, String evalName) { - click(getViewResponseLink(courseId, evalName)); - } - - public WebElement getViewResultsLink(String courseId, String evalName) { - return getSessionLinkInRow("session-view-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getEditLink(String courseId, String evalName) { - return getSessionLinkInRow("session-edit-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getSubmitLink(String courseId, String evalName) { - return getSessionLinkInRow("session-submit-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getPreviewLink(String courseId, String evalName) { - return getSessionLinkInRow("session-preview-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getRemindLink(String courseId, String evalName) { - return getSessionLinkInRow("session-remind-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getRemindOptionsLink(String courseId, String evalName) { - return getSessionLinkInRow("session-remind-options-for-test", getEvaluationRowId(courseId, evalName)); - } - - public void clickRemindOptionsLink(String courseId, String evalName) { - click(getRemindOptionsLink(courseId, evalName)); - } - - public WebElement getRemindInnerLink(String courseId, String evalName) { - return getSessionLinkInRow("session-remind-inner-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getRemindParticularUsersLink(String courseId, String evalName) { - return getSessionLinkInRow("session-remind-particular-for-test", getEvaluationRowId(courseId, evalName)); - } - - public void clickRemindParticularUsersLink(String courseId, String evalName) { - click(getRemindParticularUsersLink(courseId, evalName)); - waitForElementVisibility(remindModal); - } - - public void cancelRemindParticularUsersForm() { - cancelModalForm(remindModal); - } - - public void fillRemindParticularUsersForm() { - checkCheckboxesInForm(remindModal, "usersToRemind"); - } - - public void submitRemindParticularUsersForm() { - remindModal.findElement(By.name("form_remind_list")).submit(); - } - - public WebElement getSessionResultsOptionsCaretElement(String courseId, String evalName) { - int sessionRowId = getEvaluationRowId(courseId, evalName); - return browser.driver.findElement( - By.xpath("//tbody/tr[" + (sessionRowId + 1) - + "]//button[contains(@class,'session-results-options')]")); - } - - public void clickSessionResultsOptionsCaretElement(String courseId, String evalName) { - click(getSessionResultsOptionsCaretElement(courseId, evalName)); - } - - public WebElement getPublishLink(String courseId, String evalName) { - return getSessionLinkInRow("session-publish-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getUnpublishLink(String courseId, String evalName) { - return getSessionLinkInRow("session-unpublish-for-test", getEvaluationRowId(courseId, evalName)); - } - - public void verifyDownloadResultButtonExists(String courseId, String evalName) { - WebElement sessionRow = waitForElementPresence(By.id("session" + getEvaluationRowId(courseId, evalName))); - verifyElementContainsElement(sessionRow, By.className("session-results-download")); - } - - public void verifyResendPublishedEmailButtonExists(String courseId, String evalName) { - WebElement sessionRow = waitForElementPresence(By.id("session" + getEvaluationRowId(courseId, evalName))); - verifyElementContainsElement(sessionRow, By.className("session-resend-published-email-for-test")); - } - - public void verifyResendPublishedEmailButtonDoesNotExist(String courseId, String evalName) { - WebElement sessionRow = waitForElementPresence(By.id("session" + getEvaluationRowId(courseId, evalName))); - verifyElementDoesNotContainElement(sessionRow, By.className("session-resend-published-email-for-test")); - } - - public WebElement getResendPublishedEmailLink(String courseId, String evalName) { - return getSessionLinkInRow("session-resend-published-email-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getDeleteEvalLink(String courseId, String evalName) { - return getSessionLinkInRow("session-delete-for-test", getEvaluationRowId(courseId, evalName)); - } - - public WebElement getDeleteCourseLink(String courseId) { - return getCourseLinkInRow("course-delete-for-test", getCourseRowId(courseId)); - } - - public InstructorHomePage clickArchiveCourseLinkAndConfirm(String courseId) { - clickAndConfirm(getCourseLinkInRow("course-archive-for-test", getCourseRowId(courseId))); - waitForPageToLoad(); - return this; - } - - public InstructorHomePage clickArchiveCourseLinkAndCancel(String courseId) { - clickAndCancel(getCourseLinkInRow("course-archive-for-test", getCourseRowId(courseId))); - waitForPageToLoad(); - return this; - } - - public String getArchiveCourseLink(String courseId) { - return getCourseLinkInRow("course-archive-for-test", getCourseRowId(courseId)).getAttribute("href"); - } - - private WebElement getSessionLinkInRow(String elementClassNamePrefix, int rowId) { - waitForElementPresence(By.id("session" + rowId)); - waitForElementPresence(By.className(elementClassNamePrefix)); - return browser.driver.findElement(By.id("session" + rowId)).findElement(By.className(elementClassNamePrefix)); - } - - private WebElement getCourseLinkInRow(String elementClassNamePrefix, int rowId) { - waitForElementPresence(By.id("course-" + rowId)); - waitForElementPresence(By.className(elementClassNamePrefix)); - return browser.driver.findElement(By.id("course-" + rowId)).findElement(By.className(elementClassNamePrefix)); - } - - private int getEvaluationRowId(String courseId, String evalName) { - int courseRowId = getCourseRowId(courseId); - if (courseRowId == -1) { - return -2; - } - String template = "//div[@id='course-%d']//tr[@id='session%d']"; - int max = browser.driver.findElements(By.xpath("//div[starts-with(@id, 'course-')]//tr")).size(); - for (int id = 0; id < max; id++) { - if (getElementText( - By.xpath(String.format(template + "//td[1]", courseRowId, - id))).equals(evalName)) { - return id; - } - } - return -1; - } - - private int getCourseRowId(String courseId) { - waitForAjaxLoaderGifToDisappear(); - int id = 0; - while (isElementPresent(By.id("course-" + id))) { - if (getElementText( - By.xpath("//div[@id='course-" + id - + "']//strong")) - .startsWith("[" + courseId + "]")) { - return id; - } - id++; - } - return -1; - } - - private String getElementText(By locator) { - waitForElementPresence(locator); - return browser.driver.findElement(locator).getText(); - } - - public void changeFsCopyButtonActionLink(String courseId, String feedbackSessionName, String newActionLink) { - String id = "button_fscopy" + "-" + courseId + "-" + feedbackSessionName; - By element = By.id(id); - waitForElementPresence(element); - - executeScript("document.getElementById('" + id + "').setAttribute('data-actionlink', '" + newActionLink + "')"); - } - - public void clickFsCopyButton(String courseId, String feedbackSessionName) { - By fsCopyButtonElement = By.id("button_fscopy" + "-" + courseId + "-" + feedbackSessionName); - - // give it some time to load as it is loaded via AJAX - waitForElementPresence(fsCopyButtonElement); - - WebElement fsCopyButton = browser.driver.findElement(fsCopyButtonElement); - fsCopyButton.click(); - } -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorSearchPage.java b/src/test/java/teammates/test/pageobjects/InstructorSearchPage.java deleted file mode 100644 index 363ae2c5a16..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorSearchPage.java +++ /dev/null @@ -1,164 +0,0 @@ -package teammates.test.pageobjects; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.common.util.Const; -import teammates.e2e.pageobjects.Browser; - -public class InstructorSearchPage extends AppPage { - - public InstructorSearchPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Search

    "); - } - - public void inputSearchContent(String content) { - WebElement inputBox = this.getSearchBox(); - inputBox.sendKeys(content); - } - - public void clearSearchBox() { - WebElement inputBox = this.getSearchBox(); - inputBox.clear(); - } - - public void clickSearchButton() { - click(getSearchButton()); - waitForPageToLoad(); - } - - public void clickFeedbackResponseCommentCheckBox() { - click(getFeedbackResponseCommentCheckBox()); - } - - public void clickStudentCheckBox() { - click(getStudentCheckBox()); - } - - public InstructorSearchPage clickViewStudent(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getViewLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return this; - } - - public InstructorSearchPage clickEditStudent(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getEditLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return this; - } - - public InstructorSearchPage clickAllRecordsLink(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getAllRecordsLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return this; - } - - public InstructorSearchPage clickDeleteAndCancel(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getDeleteLink(rowId)); - waitForConfirmationModalAndClickCancel(); - return this; - } - - public InstructorSearchPage clickDeleteAndConfirm(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getDeleteLink(rowId)); - waitForConfirmationModalAndClickOk(); - return this; - } - - private WebElement getSearchBox() { - return browser.driver.findElement(By.id("searchBox")); - } - - private WebElement getSearchButton() { - return browser.driver.findElement(By.id("buttonSearch")); - } - - private WebElement getFeedbackResponseCommentCheckBox() { - return browser.driver.findElement(By.id("search-feedback-sessions-data-check")); - } - - private WebElement getStudentCheckBox() { - return browser.driver.findElement(By.id("students-check")); - } - - private int getCourseNumber(String courseId) { - int id = -1; - List panels = browser.driver.findElements(By.className("panel-heading")); - for (WebElement panel : panels) { - if (panel.getText().startsWith("[" + courseId + "]")) { - break; - } - id++; - } - return id; - } - - private String getStudentRowId(String courseId, String studentName) { - int courseNumber = getCourseNumber(courseId); - int studentCount = browser.driver.findElements(By.cssSelector("tr[id^='student-c" + courseNumber + "']")) - .size(); - for (int i = 0; i < studentCount; i++) { - String studentNameInRow = getStudentNameInRow(courseNumber, i); - if (studentNameInRow.equals(studentName)) { - return courseNumber + "." + i; - } - } - return ""; - } - - private String getStudentNameInRow(int courseNumber, int rowId) { - String xpath = "//tr[@id='student-c" + courseNumber + "." + rowId + "']" - + "//td[@id='" + Const.ParamsNames.STUDENT_NAME + "-c" + courseNumber + "." + rowId + "']"; - return browser.driver.findElement(By.xpath(xpath)).getText(); - } - - private WebElement getViewLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(1)")); - } - - private WebElement getEditLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(2)")); - } - - private WebElement getAllRecordsLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - WebElement fourthLink = studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(4)")); - - if ("All Records".equals(fourthLink.getText())) { - return fourthLink; - } - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(5)")); - } - - private WebElement getDeleteLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - WebElement thirdLink = studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(3)")); - - if ("Delete".equals(thirdLink.getText())) { - return thirdLink; - } - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(4)")); - } - - public void clickAndHoverPicture(String cellId) { - click(browser.driver.findElement(By.id(cellId)).findElement(By.tagName("a"))); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorStudentListPage.java b/src/test/java/teammates/test/pageobjects/InstructorStudentListPage.java deleted file mode 100644 index da46a6898b6..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorStudentListPage.java +++ /dev/null @@ -1,228 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.By; -import org.openqa.selenium.JavascriptExecutor; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.FindBy; - -import teammates.common.util.Const; -import teammates.e2e.pageobjects.Browser; - -public class InstructorStudentListPage extends AppPage { - - @FindBy(id = "searchbox") - private WebElement searchBox; - - @FindBy(id = "show_email") - private WebElement showEmailCheckbox; - - @FindBy(id = "emails") - private WebElement shownEmails; - - @FindBy(id = "copy-email-button") - private WebElement copyEmailButton; - - @FindBy(id = "buttonSearch") - private WebElement searchButton; - - @FindBy(id = "displayArchivedCourses_check") - private WebElement displayArchiveOptions; - - public InstructorStudentListPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Student List

    "); - } - - public void toggleShowEmailCheckbox() { - click(showEmailCheckbox); - } - - public void clickCopyEmailButton() { - click(copyEmailButton); - } - - public boolean isCopyEmailButtonVisible() { - return copyEmailButton.isDisplayed(); - } - - public void waitForCopyEmailPopoverVisible() { - String cssSelector = "#copy-email-button + div.popover"; - WebElement copyEmailPopover = browser.driver.findElement(By.cssSelector(cssSelector)); - waitForElementVisibility(copyEmailPopover); - } - - public String getSelectedText() { - String selectedText = (String) executeScript("return window.getSelection().toString();"); - selectedText = selectedText.replace(System.lineSeparator(), "\n"); // standardize line separator - return selectedText; - } - - public String getShownEmailsText() { - return shownEmails.getText(); - } - - public InstructorCourseEnrollPage clickEnrollStudents(String courseId) { - int courseNumber = getCourseNumber(courseId); - click(getEnrollLink(courseNumber)); - waitForPageToLoad(); - return changePageType(InstructorCourseEnrollPage.class); - } - - public InstructorCourseStudentDetailsViewPage clickViewStudent(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getViewLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorCourseStudentDetailsViewPage.class); - } - - public InstructorCourseStudentDetailsEditPage clickEditStudent(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getEditLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorCourseStudentDetailsEditPage.class); - } - - public InstructorStudentRecordsPage clickViewRecordsStudent(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getViewRecordsLink(rowId)); - waitForPageToLoad(); - switchToNewWindow(); - return changePageType(InstructorStudentRecordsPage.class); - } - - public InstructorStudentListPage clickDeleteAndCancel(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getDeleteLink(rowId)); - waitForConfirmationModalAndClickCancel(); - return this; - } - - public InstructorStudentListPage clickDeleteAndConfirm(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - click(getDeleteLink(rowId)); - waitForConfirmationModalAndClickOk(); - return this; - } - - public InstructorStudentListPage clickShowPhoto(String courseId, String studentName) { - String rowId = getStudentRowId(courseId, studentName); - WebElement photoCell = browser.driver.findElement(By.id("studentphoto-c" + rowId)); - WebElement photoLink = photoCell.findElement(By.tagName("a")); - click(photoLink); - return this; - } - - public void setSearchKey(String searchKey) { - searchBox.clear(); - searchBox.sendKeys(searchKey); - click(searchButton); - } - - public void checkCourse(int courseIdx) { - click(browser.driver.findElement(By.id("course_check-" + courseIdx))); - waitForAjaxLoaderGifToDisappear(); - } - - public void clickDisplayArchiveOptions() { - click(displayArchiveOptions); - } - - public void verifyProfilePhoto(String courseId, String studentName, String urlRegex) { - String rowId = getStudentRowId(courseId, studentName); - verifyImageUrl(urlRegex, browser.driver - .findElement(By.id("studentphoto-c" + rowId)) - .findElement(By.tagName("img")) - .getAttribute("src")); - WebElement photo = browser.driver.findElement(By.id("studentphoto-c" + rowId)) - .findElement(By.cssSelector(".profile-pic-icon-click > img")); - JavascriptExecutor jsExecutor = (JavascriptExecutor) browser.driver; - jsExecutor.executeScript("arguments[0].scrollIntoView(true); window.scrollBy(0, -100);", photo); - Actions action = new Actions(browser.driver); - action.click(photo).build().perform(); - verifyImageUrl(urlRegex, browser.driver - .findElement(By.id("studentphoto-c" + rowId)) - .findElement(By.cssSelector(".popover-content > .profile-pic")) - .getAttribute("src")); - } - - private int getCourseNumber(String courseId) { - int id = 0; - while (isElementPresent(By.id("panelHeading-" + id))) { - if (getElementText(By.xpath("//div[@id='panelHeading-" + id + "']//strong")) - .startsWith("[" + courseId + "]")) { - return id; - } - id++; - } - return -1; - } - - public String getStudentRowId(String courseId, String studentName) { - int courseNumber = getCourseNumber(courseId); - int studentCount = browser.driver.findElements(By.cssSelector("tr[id^='student-c" + courseNumber + "']")) - .size(); - for (int i = 0; i < studentCount; i++) { - String studentNameInRow = getStudentNameInRow(courseNumber, i); - if (studentNameInRow.equals(studentName)) { - return courseNumber + "." + i; - } - } - return ""; - } - - private String getStudentNameInRow(int courseNumber, int rowId) { - String xpath = "//tr[@id='student-c" + courseNumber + "." + rowId + "']" - + "//td[@id='" + Const.ParamsNames.STUDENT_NAME + "-c" + courseNumber + "." + rowId + "']"; - return browser.driver.findElement(By.xpath(xpath)).getText(); - } - - private WebElement getEnrollLink(int courseNumber) { - return browser.driver.findElement(By.id("panelHeading-" + courseNumber)) - .findElement(By.className("course-enroll-for-test")); - } - - private WebElement getViewLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(1)")); - } - - private WebElement getEditLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(2)")); - } - - private WebElement getViewRecordsLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - WebElement fourthLink = studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(4)")); - - if ("All Records".equals(fourthLink.getText())) { - return fourthLink; - } - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(5)")); - } - - private WebElement getDeleteLink(String rowId) { - WebElement studentRow = browser.driver.findElement(By.id("student-c" + rowId)); - WebElement thirdLink = studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(3)")); - - if ("Delete".equals(thirdLink.getText())) { - return thirdLink; - } - return studentRow.findElement(By.cssSelector("td.no-print.align-center > a:nth-child(4)")); - } - - private String getElementText(By locator) { - if (!isElementPresent(locator)) { - return ""; - } - return browser.driver.findElement(locator).getText(); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/InstructorStudentRecordsPage.java b/src/test/java/teammates/test/pageobjects/InstructorStudentRecordsPage.java deleted file mode 100644 index ea1279f6b6a..00000000000 --- a/src/test/java/teammates/test/pageobjects/InstructorStudentRecordsPage.java +++ /dev/null @@ -1,137 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.common.util.ThreadHelper; -import teammates.e2e.pageobjects.Browser; - -public class InstructorStudentRecordsPage extends AppPage { - - public InstructorStudentRecordsPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - String source = getPageSource(); - return source.contains("'s Records") && source.contains(" - "); - } - - public void verifyBelongsToStudent(String name) { - assertTrue(getPageSource().contains(name)); - } - - public void verifyIsCorrectPage(String studentName) { - assertTrue(containsExpectedPageContents()); - verifyBelongsToStudent(studentName); - } - - /** - * Clicks all the headings of the record panels to either expand/collapse the panel body. - */ - public void clickAllRecordPanelHeadings() { - for (WebElement e : browser.driver.findElements(By.cssSelector("div[id^='studentFeedback-']"))) { - click(e.findElement(By.cssSelector(".panel-heading"))); - } - } - - /** - * Checks if the body of all the record panels are visible. - * @return true if all record panel bodies are visible - */ - public boolean areRecordsVisible() { - return areAllRecordPanelBodiesVisibilityEquals(true); - } - - /** - * Checks if the body of all the record panels are hidden. - * @return true if all record panel bodies are hidden - */ - public boolean areRecordsHidden() { - return areAllRecordPanelBodiesVisibilityEquals(false); - } - - /** - * Checks if the bodies of all the record panels are collapsed or expanded. - * @param isVisible true to check for expanded, false to check for collapsed. - * @return true if all record panel bodies are equals to the visibility being checked. - */ - private boolean areAllRecordPanelBodiesVisibilityEquals(boolean isVisible) { - for (WebElement e : getStudentFeedbackPanels()) { - if (e.isDisplayed() != isVisible) { - return false; - } - } - - return true; - } - - public void closeEditFeedbackResponseCommentForm(String commentIdSuffix) { - WebElement editResponseForm = browser.driver.findElement(By.id("responseCommentEditForm" + commentIdSuffix)); - WebElement cancelButton = editResponseForm.findElement(By.cssSelector("input[type='button']")); - click(cancelButton); - } - - public void editFeedbackResponseComment(String commentIdSuffix, String newCommentText) { - WebElement commentRow = waitForElementPresence(By.id("responseCommentRow" + commentIdSuffix)); - click(commentRow.findElements(By.tagName("a")).get(1)); - WebElement commentEditForm = browser.driver.findElement(By.id("responseCommentEditForm" + commentIdSuffix)); - fillRichTextEditor("responsecommenttext" + commentIdSuffix, newCommentText); - click(commentEditForm.findElement(By.className("col-sm-offset-5")).findElement(By.tagName("a"))); - ThreadHelper.waitFor(1000); - } - - public List getStudentFeedbackPanels() { - List webElements = new ArrayList<>(); - for (WebElement e : browser.driver.findElements(By.cssSelector("div[id^='studentFeedback-']"))) { - WebElement panel = e.findElement(By.cssSelector(".panel-collapse")); - if (panel != null) { - webElements.add(panel); - } - } - - return webElements; - } - - public void verifyCommentRowContent(String commentRowIdSuffix, String commentText, String giverName) { - By commentRowSelector = By.id("responseCommentRow" + commentRowIdSuffix); - WebElement commentRow = waitForElementPresence(commentRowSelector); - waitForTextContainedInElementPresence(By.id("plainCommentText" + commentRowIdSuffix), commentText); - assertTrue(commentRow.findElement(By.className("text-muted")).getText().contains(giverName) - || commentRow.findElement(By.className("text-muted")).getText().contains("you")); - } - - public void verifyCommentFormErrorMessage(String errorMessage) { - WebElement errorMessageSpan = waitForElementPresence(By.cssSelector("#errorMessage")); - assertEquals(errorMessage, errorMessageSpan.getText()); - } - - public void deleteFeedbackResponseComment(String commentIdSuffix) { - WebElement commentRow = browser.driver.findElement(By.id("responseCommentRow" + commentIdSuffix)); - click(commentRow.findElement(By.tagName("form")).findElement(By.tagName("a"))); - waitForConfirmationModalAndClickOk(); - ThreadHelper.waitFor(1500); - } - - /** - * Waits for all the panels to collapse. - */ - public void waitForPanelsToCollapse() { - waitForElementsToDisappear(getStudentFeedbackPanels()); - } - - /** - * Waits for all the panels to expand. - */ - public void waitForPanelsToExpand() { - waitForElementsVisibility(getStudentFeedbackPanels()); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/LoginPage.java b/src/test/java/teammates/test/pageobjects/LoginPage.java deleted file mode 100644 index 888542191a5..00000000000 --- a/src/test/java/teammates/test/pageobjects/LoginPage.java +++ /dev/null @@ -1,30 +0,0 @@ -package teammates.test.pageobjects; - -import teammates.e2e.pageobjects.Browser; - -public abstract class LoginPage extends AppPage { - - public LoginPage(Browser browser) { - super(browser); - } - - public abstract InstructorHomePage loginAsInstructor(String username, String password); - - public abstract T loginAsInstructor(String username, String password, Class typeOfPage); - - public abstract AppPage loginAsInstructorUnsuccessfully(String userName, String password); - - public abstract StudentHomePage loginAsStudent(String username, String password); - - public abstract T loginAsStudent(String username, String password, Class typeOfPage); - - public abstract StudentCourseJoinConfirmationPage loginAsJoiningStudent(String username, String password); - - public abstract InstructorCourseJoinConfirmationPage loginAsJoiningInstructor(String username, String password); - - public abstract InstructorHomePage loginAsJoiningInstructorByPassConfirmation(String username, String password); - - public abstract void loginAdminAsInstructor( - String adminUsername, String adminPassword, String instructorUsername); - -} diff --git a/src/test/java/teammates/test/pageobjects/StudentCourseJoinConfirmationPage.java b/src/test/java/teammates/test/pageobjects/StudentCourseJoinConfirmationPage.java deleted file mode 100644 index 204135e4eef..00000000000 --- a/src/test/java/teammates/test/pageobjects/StudentCourseJoinConfirmationPage.java +++ /dev/null @@ -1,39 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.WebElement; -import org.openqa.selenium.support.FindBy; - -import teammates.e2e.pageobjects.Browser; - -public class StudentCourseJoinConfirmationPage extends AppPage { - @FindBy(id = "button_confirm") - private WebElement confirmButton; - - @FindBy(id = "button_cancel") - private WebElement cancelButton; - - public StudentCourseJoinConfirmationPage(Browser browser) { - super(browser); - } - - @Override - public boolean containsExpectedPageContents() { - return getPageSource().contains("

    Confirm your Google account

    "); - } - - public StudentHomePage clickConfirmButton() { - return clickConfirmButton(StudentHomePage.class); - } - - public T clickConfirmButton(Class typeOfPage) { - click(confirmButton); - waitForPageToLoad(); - return changePageType(typeOfPage); - } - - public LoginPage clickCancelButton() { - click(cancelButton); - waitForPageToLoad(); - return createCorrectLoginPageType(browser); - } -} diff --git a/src/test/java/teammates/test/pageobjects/StudentFeedbackResultsPage.java b/src/test/java/teammates/test/pageobjects/StudentFeedbackResultsPage.java deleted file mode 100644 index e48debb4aff..00000000000 --- a/src/test/java/teammates/test/pageobjects/StudentFeedbackResultsPage.java +++ /dev/null @@ -1,32 +0,0 @@ -package teammates.test.pageobjects; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.e2e.pageobjects.Browser; - -public class StudentFeedbackResultsPage extends AppPage { - - public StudentFeedbackResultsPage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Feedback Results

    "); - } - - public void clickQuestionAdditionalInfoButton(int qnNumber, String additionalInfoId) { - click(By.id("questionAdditionalInfoButton-" + qnNumber + "-" + additionalInfoId)); - } - - public boolean isQuestionAdditionalInfoVisible(int qnNumber, String additionalInfoId) { - return isElementVisible("questionAdditionalInfo-" + qnNumber + "-" + additionalInfoId); - } - - public String getQuestionAdditionalInfoButtonText(int qnNumber, String additionalInfoId) { - WebElement qnAdditionalInfoButton = browser.driver.findElement( - By.id("questionAdditionalInfoButton-" + qnNumber + "-" + additionalInfoId)); - return qnAdditionalInfoButton.getText(); - } -} diff --git a/src/test/java/teammates/test/pageobjects/StudentHomePage.java b/src/test/java/teammates/test/pageobjects/StudentHomePage.java deleted file mode 100644 index 87fe8cf0865..00000000000 --- a/src/test/java/teammates/test/pageobjects/StudentHomePage.java +++ /dev/null @@ -1,79 +0,0 @@ -package teammates.test.pageobjects; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import teammates.e2e.pageobjects.Browser; - -public class StudentHomePage extends AppPage { - - public StudentHomePage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return containsExpectedPageContents(getPageSource()); - } - - public static boolean containsExpectedPageContents(String pageSource) { - return pageSource.contains("

    Student Home

    "); - } - - public void clickViewTeam() { - - List viewTeamLinks = browser.driver.findElements(By.linkText("View Team")); - - click(viewTeamLinks.get(0)); - } - - public WebElement getViewFeedbackButton(String feedbackName) { - - int rowId = getEvalRowId(feedbackName); - return browser.driver.findElement(By.id("viewFeedbackResults" + rowId)); - } - - public void clickViewFeedbackButton(String feedbackName) { - click(getViewFeedbackButton(feedbackName)); - } - - public WebElement getEditFeedbackButton(String feedbackName) { - - int rowId = getEvalRowId(feedbackName); - return browser.driver.findElement(By.id("editFeedbackResponses" + rowId)); - } - - public void clickEditFeedbackButton(String feedbackName) { - click(getEditFeedbackButton(feedbackName)); - } - - public WebElement getSubmitFeedbackButton(String feedbackName) { - - int rowId = getEvalRowId(feedbackName); - return browser.driver.findElement(By.id("submitFeedback" + rowId)); - } - - public void clickSubmitFeedbackButton(String feedbackName) { - click(getSubmitFeedbackButton(feedbackName)); - } - - private int getEvalRowId(String name) { - - int id = 0; - while (isElementPresent(By.id("evaluation" + id))) { - - WebElement element = browser.driver.findElement(By.id("evaluation" + id)); - WebElement text = element.findElement(By.tagName("td")); - - if (text.getText().contains(name)) { - return id; - } - - id++; - } - return -1; - } - -} diff --git a/src/test/java/teammates/test/pageobjects/StudentProfilePage.java b/src/test/java/teammates/test/pageobjects/StudentProfilePage.java deleted file mode 100644 index ccd8577ff04..00000000000 --- a/src/test/java/teammates/test/pageobjects/StudentProfilePage.java +++ /dev/null @@ -1,252 +0,0 @@ -package teammates.test.pageobjects; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.remote.RemoteWebElement; -import org.openqa.selenium.support.FindBy; -import org.openqa.selenium.support.ui.Select; - -import teammates.common.datatransfer.attributes.StudentProfileAttributes; -import teammates.common.util.NationalityHelper; -import teammates.e2e.pageobjects.Browser; - -public class StudentProfilePage extends AppPage { - - @FindBy(id = "studentShortname") - private WebElement shortNameBox; - - @FindBy(id = "studentEmail") - private WebElement emailBox; - - @FindBy(id = "studentInstitution") - private WebElement institutionBox; - - @FindBy(id = "studentNationality") - private WebElement studentNationalityDropdown; - - @FindBy(id = "genderMale") - private WebElement genderMaleRadio; - - @FindBy(id = "genderFemale") - private WebElement genderFemaleRadio; - - @FindBy(id = "genderOther") - private WebElement genderOtherRadio; - - @FindBy(id = "studentMoreInfo") - private WebElement moreInfoBox; - - @FindBy(id = "studentPhotoUploader") - private WebElement uploadEditModal; - - @FindBy(id = "uploadEditPhoto") - private WebElement uploadPopupButton; - - @FindBy(id = "profileEditSubmit") - private WebElement submitButton; - - @FindBy(id = "profileUploadPictureSubmit") - private WebElement uploadPictureSubmit; - - @FindBy(id = "profileEditPictureSubmit") - private WebElement editPictureSubmit; - - @FindBy(id = "profilePicEditRotateLeft") - private WebElement editPictureRotateLeft; - - @FindBy(id = "profilePicEditZoomIn") - private WebElement editPictureZoomIn; - - @FindBy(id = "profilePicEditZoomOut") - private WebElement editPictureZoomOut; - - @FindBy(id = "profilePicEditRotateRight") - private WebElement editPictureRotateRight; - - @FindBy(id = "profilePicEditPanUp") - private WebElement editPicturePanUp; - - @FindBy(id = "profilePicEditPanLeft") - private WebElement editPicturePanLeft; - - @FindBy(id = "profilePicEditPanRight") - private WebElement editPicturePanRight; - - @FindBy(id = "profilePicEditPanDown") - private WebElement editPicturePanDown; - - public StudentProfilePage(Browser browser) { - super(browser); - } - - @Override - protected boolean containsExpectedPageContents() { - return getPageSource().contains("

    Student Profile

    "); - } - - public StudentProfilePage submitEditedProfile() { - click(submitButton); - waitForPageToLoad(); - return changePageType(StudentProfilePage.class); - } - - public void fillProfilePic(String fileName) { - showPictureEditor(); - RemoteWebElement ele = (RemoteWebElement) browser.driver.findElement(By.id("studentPhoto")); - fillFileBox(ele, fileName); - } - - public void showPictureEditor() { - click(uploadPopupButton); - waitForUploadEditModalVisible(); - } - - public void fillShortName(String shortName) { - fillTextBox(shortNameBox, shortName); - } - - public void fillEmail(String studentEmail) { - fillTextBox(emailBox, studentEmail); - } - - public void fillInstitution(String studentInstitution) { - fillTextBox(institutionBox, studentInstitution); - } - - /** - * Selects student nationality from the dropdown list if the nationality is - * valid, otherwise it fails with a message. - */ - public void selectNationality(String studentNationality) { - if (NationalityHelper.getNationalities().contains(studentNationality) || "".equals(studentNationality)) { - Select dropdown = new Select(studentNationalityDropdown); - dropdown.selectByValue(studentNationality); - } else { - fail("Given nationality " + studentNationality + " is not valid!"); - } - } - - public void fillMoreInfo(String moreInfo) { - fillTextBox(moreInfoBox, moreInfo); - } - - public void selectGender(StudentProfileAttributes.Gender gender) { - switch (gender) { - case MALE: - click(genderMaleRadio); - break; - case FEMALE: - click(genderFemaleRadio); - break; - case OTHER: - click(genderOtherRadio); - break; - default: - fail("Given gender " + gender + " is not valid!"); - break; - } - } - - public void editProfileThroughUi(String shortName, String email, String institute, - String nationality, StudentProfileAttributes.Gender gender, String moreInfo) { - fillShortName(shortName); - fillEmail(email); - fillInstitution(institute); - selectNationality(nationality); - fillMoreInfo(moreInfo); - selectGender(gender); - submitEditedProfile(); - } - - public void ensureProfileContains(String shortName, String email, String institute, String nationality, - StudentProfileAttributes.Gender gender, String moreInfo) { - assertEquals(shortName, shortNameBox.getAttribute("value")); - assertEquals(email, emailBox.getAttribute("value")); - assertEquals(institute, institutionBox.getAttribute("value")); - ensureNationalityIsSelectedAs(nationality); - ensureGenderIsSelectedAs(gender); - assertEquals(moreInfo, moreInfoBox.getText()); - } - - /** - * Makes sure that the nationality is selected in the dropdown list. - * If not, it fails with a message. - */ - private void ensureNationalityIsSelectedAs(String nationality) { - if (NationalityHelper.getNationalities().contains(nationality) || "".equals(nationality)) { - assertEquals(nationality, studentNationalityDropdown.getAttribute("value")); - } else { - fail("unexpected nationality value given"); - } - } - - private void ensureGenderIsSelectedAs(StudentProfileAttributes.Gender gender) { - switch (gender) { - case MALE: - assertTrue(genderMaleRadio.isSelected()); - break; - case FEMALE: - assertTrue(genderFemaleRadio.isSelected()); - break; - case OTHER: - assertTrue(genderOtherRadio.isSelected()); - break; - default: - fail("unexpected gender value given"); - break; - } - } - - public void uploadPicture() { - click(uploadPictureSubmit); - waitForPageToLoad(); - } - - public void editProfilePhoto() { - click(editPictureZoomIn); - click(editPictureZoomOut); - click(editPictureZoomIn); - - click(editPictureRotateRight); - click(editPictureRotateLeft); - click(editPictureRotateRight); - - click(editPicturePanDown); - click(editPicturePanUp); - click(editPicturePanDown); - - click(editPicturePanLeft); - click(editPicturePanRight); - click(editPicturePanLeft); - - click(editPictureSubmit); - waitForPageToLoad(); - } - - public void verifyPhotoSize(int height, int width) { - assertEquals(String.valueOf(height), browser.driver.findElement(By.id("pictureHeight")) - .getAttribute("value")); - assertEquals(String.valueOf(width), browser.driver.findElement(By.id("pictureWidth")) - .getAttribute("value")); - } - - public void verifyUploadButtonState(boolean expectedState) { - assertEquals(expectedState, uploadPictureSubmit.isEnabled()); - - } - - public void waitForUploadEditModalVisible() { - waitForElementVisibility(uploadEditModal); - } - - public void closeEditPictureModal() { - WebElement closeButton = browser.driver.findElement(By.className("close")); - waitForElementVisibility(closeButton); - click(closeButton); - } - -} diff --git a/src/test/java/teammates/test/pageobjects/package-info.java b/src/test/java/teammates/test/pageobjects/package-info.java deleted file mode 100644 index b94e4111033..00000000000 --- a/src/test/java/teammates/test/pageobjects/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Contains abstractions of the pages as they appear on a Web browser (i.e. SUTs). - */ -package teammates.test.pageobjects; diff --git a/src/test/java/teammates/test/cases/webapi/ActionFactoryTest.java b/src/test/java/teammates/ui/webapi/ActionFactoryTest.java similarity index 80% rename from src/test/java/teammates/test/cases/webapi/ActionFactoryTest.java rename to src/test/java/teammates/ui/webapi/ActionFactoryTest.java index 14cb6f01aa2..f0c9cbf19e0 100644 --- a/src/test/java/teammates/test/cases/webapi/ActionFactoryTest.java +++ b/src/test/java/teammates/ui/webapi/ActionFactoryTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; @@ -7,11 +7,8 @@ import teammates.common.exception.ActionMappingException; import teammates.common.util.Config; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.MockHttpServletRequest; -import teammates.ui.webapi.action.Action; -import teammates.ui.webapi.action.ActionFactory; -import teammates.ui.webapi.action.GetAuthInfoAction; +import teammates.test.BaseTestCase; +import teammates.test.MockHttpServletRequest; /** * SUT: {@link ActionFactory}. @@ -25,7 +22,7 @@ public void testGetAction() throws Exception { ______TS("Action exists and is retrieved"); MockHttpServletRequest existingActionServletRequest = new MockHttpServletRequest( - HttpGet.METHOD_NAME, Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.AUTH); + HttpGet.METHOD_NAME, Const.ResourceURIs.AUTH); existingActionServletRequest.addHeader("Backdoor-Key", Config.BACKDOOR_KEY); Action existingAction = actionFactory.getAction(existingActionServletRequest, HttpGet.METHOD_NAME); assertTrue(existingAction instanceof GetAuthInfoAction); @@ -43,12 +40,12 @@ public void testGetAction() throws Exception { ______TS("Method does not exist on action and ActionMappingException is thrown"); MockHttpServletRequest nonExistentMethodOnActionServletRequest = new MockHttpServletRequest( - HttpGet.METHOD_NAME, Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.AUTH); + HttpGet.METHOD_NAME, Const.ResourceURIs.AUTH); nonExistentMethodOnActionServletRequest.addHeader("Backdoor-Key", Config.BACKDOOR_KEY); ActionMappingException nonExistentMethodOnActionException = assertThrows(ActionMappingException.class, () -> actionFactory.getAction(nonExistentMethodOnActionServletRequest, HttpPost.METHOD_NAME)); assertTrue(nonExistentMethodOnActionException.getMessage() .equals("Method [" + HttpPost.METHOD_NAME + "] is not allowed for URI " - + Const.ResourceURIs.URI_PREFIX + Const.ResourceURIs.AUTH + ".")); + + Const.ResourceURIs.AUTH + ".")); } } diff --git a/src/test/java/teammates/test/cases/webapi/ArchiveCourseActionTest.java b/src/test/java/teammates/ui/webapi/ArchiveCourseActionTest.java similarity index 87% rename from src/test/java/teammates/test/cases/webapi/ArchiveCourseActionTest.java rename to src/test/java/teammates/ui/webapi/ArchiveCourseActionTest.java index cdc71603851..e9ac158e890 100644 --- a/src/test/java/teammates/test/cases/webapi/ArchiveCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/ArchiveCourseActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -6,11 +6,8 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.NullHttpParameterException; import teammates.common.util.Const; -import teammates.logic.core.InstructorsLogic; -import teammates.ui.webapi.action.ArchiveCourseAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.CourseArchiveData; -import teammates.ui.webapi.request.CourseArchiveRequest; +import teammates.ui.output.CourseArchiveData; +import teammates.ui.request.CourseArchiveRequest; /** * SUT: {@link ArchiveCourseAction}. @@ -54,7 +51,7 @@ protected void testExecute() throws Exception { JsonResult result = getJsonResult(archiveCourseAction); CourseArchiveData courseArchiveData = (CourseArchiveData) result.getOutput(); - InstructorAttributes theInstructor = InstructorsLogic.inst().getInstructorForGoogleId( + InstructorAttributes theInstructor = logic.getInstructorForGoogleId( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); @@ -69,7 +66,7 @@ protected void testExecute() throws Exception { result = getJsonResult(archiveCourseAction); courseArchiveData = (CourseArchiveData) result.getOutput(); - theInstructor = InstructorsLogic.inst().getInstructorForGoogleId( + theInstructor = logic.getInstructorForGoogleId( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); @@ -84,7 +81,7 @@ protected void testExecute() throws Exception { result = getJsonResult(unarchiveAction); courseArchiveData = (CourseArchiveData) result.getOutput(); - theInstructor = InstructorsLogic.inst().getInstructorForGoogleId(instructor1OfCourse1.getCourseId(), + theInstructor = logic.getInstructorForGoogleId(instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); @@ -99,7 +96,7 @@ protected void testExecute() throws Exception { result = getJsonResult(unarchiveAction); courseArchiveData = (CourseArchiveData) result.getOutput(); - theInstructor = InstructorsLogic.inst().getInstructorForGoogleId( + theInstructor = logic.getInstructorForGoogleId( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); @@ -115,7 +112,7 @@ protected void testExecute() throws Exception { result = getJsonResult(archiveCourseAction); courseArchiveData = (CourseArchiveData) result.getOutput(); - theInstructor = InstructorsLogic.inst().getInstructorForGoogleId( + theInstructor = logic.getInstructorForGoogleId( instructor1OfCourse1.getCourseId(), instructor1OfCourse1.getGoogleId()); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); diff --git a/src/test/java/teammates/test/cases/webapi/BaseActionTest.java b/src/test/java/teammates/ui/webapi/BaseActionTest.java similarity index 98% rename from src/test/java/teammates/test/cases/webapi/BaseActionTest.java rename to src/test/java/teammates/ui/webapi/BaseActionTest.java index 5610dc595e7..dcd63da973d 100644 --- a/src/test/java/teammates/test/cases/webapi/BaseActionTest.java +++ b/src/test/java/teammates/ui/webapi/BaseActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.io.IOException; import java.util.ArrayList; @@ -30,12 +30,9 @@ import teammates.common.util.Const; import teammates.common.util.EmailWrapper; import teammates.common.util.JsonUtils; -import teammates.test.cases.BaseComponentTestCase; -import teammates.test.driver.MockPart; -import teammates.ui.webapi.action.Action; -import teammates.ui.webapi.action.ImageResult; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.request.BasicRequest; +import teammates.test.BaseComponentTestCase; +import teammates.test.MockPart; +import teammates.ui.request.BasicRequest; /** * Base class for all action tests. diff --git a/src/test/java/teammates/test/cases/webapi/BinCourseActionTest.java b/src/test/java/teammates/ui/webapi/BinCourseActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/BinCourseActionTest.java rename to src/test/java/teammates/ui/webapi/BinCourseActionTest.java index bd2f5c9936b..f6f52807732 100644 --- a/src/test/java/teammates/test/cases/webapi/BinCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/BinCourseActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.time.ZoneId; import java.util.List; @@ -10,9 +10,7 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; -import teammates.ui.webapi.action.BinCourseAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.CourseData; +import teammates.ui.output.CourseData; /** * SUT: {@link BinCourseAction}. @@ -62,7 +60,8 @@ protected void testExecute() throws Exception { verifyCourseData(courseData, courseToBeDeleted.getId(), courseToBeDeleted.getName(), courseToBeDeleted.getTimeZone().getId()); - List courseList = logic.getCoursesForInstructor(instructorId); + List instructors = logic.getInstructorsForGoogleId(instructorId, false); + List courseList = logic.getCoursesForInstructor(instructors); assertEquals(1, courseList.size()); assertEquals("icdct.tpa.id1", courseList.get(0).getId()); diff --git a/src/test/java/teammates/test/cases/webapi/BinFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/BinFeedbackSessionActionTest.java similarity index 94% rename from src/test/java/teammates/test/cases/webapi/BinFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/BinFeedbackSessionActionTest.java index 1c64adc3033..c92f69f7fdd 100644 --- a/src/test/java/teammates/test/cases/webapi/BinFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/BinFeedbackSessionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -6,8 +6,6 @@ import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.BinFeedbackSessionAction; -import teammates.ui.webapi.action.JsonResult; /** * SUT: {@link BinFeedbackSessionAction}. @@ -70,7 +68,7 @@ protected void testAccessControl() throws Exception { }; loginAsInstructor(instructor1OfCourse1.googleId); - verifyCannotAccess(submissionParams); + verifyEntityNotFound(submissionParams); ______TS("other verifications"); diff --git a/src/test/java/teammates/test/cases/webapi/ConfirmFeedbackSessionSubmissionActionTest.java b/src/test/java/teammates/ui/webapi/ConfirmFeedbackSessionSubmissionActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/ConfirmFeedbackSessionSubmissionActionTest.java rename to src/test/java/teammates/ui/webapi/ConfirmFeedbackSessionSubmissionActionTest.java index b0822d440f6..6938be5bf13 100644 --- a/src/test/java/teammates/test/cases/webapi/ConfirmFeedbackSessionSubmissionActionTest.java +++ b/src/test/java/teammates/ui/webapi/ConfirmFeedbackSessionSubmissionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -15,10 +15,8 @@ import teammates.common.util.Const; import teammates.common.util.EmailWrapper; import teammates.common.util.TaskWrapper; -import teammates.ui.webapi.action.ConfirmFeedbackSessionSubmissionAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.ConfirmationResponse; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.ConfirmationResponse; +import teammates.ui.request.Intent; /** * SUT: {@link ConfirmFeedbackSessionSubmissionAction}. @@ -123,12 +121,12 @@ protected void testExecute() throws Exception { // verify update session's respondent list task added TaskWrapper taskAdded = a.getTaskQueuer().getTasksAdded().get(0); - assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)[0]); + assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)); assertEquals(session1InCourse1.getFeedbackSessionName(), - taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)[0]); - assertEquals(student1InCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)[0]); - assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)[0]); - assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)[0]); + taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)); + assertEquals(student1InCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)); + assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)); + assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)); ______TS("Typical success case with student intent, not responded before"); @@ -163,12 +161,12 @@ protected void testExecute() throws Exception { // verify update session's respondent list task added taskAdded = a.getTaskQueuer().getTasksAdded().get(0); - assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)[0]); + assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)); assertEquals(session1InCourse1.getFeedbackSessionName(), - taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)[0]); - assertEquals(student4InCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)[0]); - assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)[0]); - assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)[0]); + taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)); + assertEquals(student4InCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)); + assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)); + assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)); ______TS("Typical success case with instructor intent"); @@ -194,12 +192,12 @@ protected void testExecute() throws Exception { // verify update session's respondent list task added taskAdded = a.getTaskQueuer().getTasksAdded().get(0); - assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)[0]); + assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)); assertEquals(session1InCourse1.getFeedbackSessionName(), - taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)[0]); - assertEquals(instructor1OfCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)[0]); - assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)[0]); - assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)[0]); + taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)); + assertEquals(instructor1OfCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)); + assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)); + assertEquals("false", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)); ______TS("Typical success case with instructor intent, not responded before"); @@ -229,12 +227,12 @@ protected void testExecute() throws Exception { // verify update session's respondent list task added taskAdded = a.getTaskQueuer().getTasksAdded().get(0); - assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)[0]); + assertEquals(typicalCourse1.getId(), taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)); assertEquals(session1InCourse1.getFeedbackSessionName(), - taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)[0]); - assertEquals(instructor2OfCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)[0]); - assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)[0]); - assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)[0]); + taskAdded.getParamMap().get(Const.ParamsNames.FEEDBACK_SESSION_NAME)); + assertEquals(instructor2OfCourse1.email, taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_EMAIL)); + assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_INSTRUCTOR)); + assertEquals("true", taskAdded.getParamMap().get(Const.ParamsNames.RESPONDENT_IS_TO_BE_REMOVED)); ______TS("Failed case with invalid intent"); diff --git a/src/test/java/teammates/test/cases/webapi/CreateAccountActionTest.java b/src/test/java/teammates/ui/webapi/CreateAccountActionTest.java similarity index 90% rename from src/test/java/teammates/test/cases/webapi/CreateAccountActionTest.java rename to src/test/java/teammates/ui/webapi/CreateAccountActionTest.java index 7d28a2292d8..aa8b5b8d73d 100644 --- a/src/test/java/teammates/test/cases/webapi/CreateAccountActionTest.java +++ b/src/test/java/teammates/ui/webapi/CreateAccountActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -11,11 +11,9 @@ import teammates.common.util.EmailWrapper; import teammates.common.util.FieldValidator; import teammates.common.util.StringHelper; -import teammates.test.driver.StringHelperExtension; -import teammates.ui.webapi.action.CreateAccountAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.JoinLinkData; -import teammates.ui.webapi.request.AccountCreateRequest; +import teammates.common.util.StringHelperExtension; +import teammates.ui.output.JoinLinkData; +import teammates.ui.request.AccountCreateRequest; /** * SUT: {@link CreateAccountAction}. @@ -34,7 +32,7 @@ protected String getRequestMethod() { @Override @Test - protected void testExecute() throws Exception { + protected void testExecute() { loginAsAdmin(); String name = "JamesBond"; String email = "jamesbond89@gmail.tmt"; @@ -121,12 +119,12 @@ protected void testAccessControl() { } @Test - public void testGenerateNextDemoCourseId() throws Exception { + public void testGenerateNextDemoCourseId() { testGenerateNextDemoCourseIdForLengthLimit(40); testGenerateNextDemoCourseIdForLengthLimit(20); } - private void testGenerateNextDemoCourseIdForLengthLimit(int maximumIdLength) throws Exception { + private void testGenerateNextDemoCourseIdForLengthLimit(int maximumIdLength) { String normalIdSuffix = ".gma-demo"; String atEmail = "@gmail.tmt"; int normalIdSuffixLength = normalIdSuffix.length(); // 9 @@ -161,12 +159,9 @@ private void testGenerateNextDemoCourseIdForLengthLimit(int maximumIdLength) thr maximumIdLength)); } - private String generateNextDemoCourseId(String instructorEmailOrProposedCourseId, int maximumIdLength) - throws Exception { + private String generateNextDemoCourseId(String instructorEmailOrProposedCourseId, int maximumIdLength) { CreateAccountAction a = new CreateAccountAction(); - return (String) invokeMethod(a.getClass(), "generateNextDemoCourseId", - new Class[] { String.class, int.class }, - a, new Object[] { instructorEmailOrProposedCourseId, maximumIdLength }); + return a.generateNextDemoCourseId(instructorEmailOrProposedCourseId, maximumIdLength); } private AccountCreateRequest buildCreateRequest(String name, String institution, String email) { diff --git a/src/test/java/teammates/test/cases/webapi/CreateCourseActionTest.java b/src/test/java/teammates/ui/webapi/CreateCourseActionTest.java similarity index 83% rename from src/test/java/teammates/test/cases/webapi/CreateCourseActionTest.java rename to src/test/java/teammates/ui/webapi/CreateCourseActionTest.java index fc1ffdefa6c..4bbb7e86191 100644 --- a/src/test/java/teammates/test/cases/webapi/CreateCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/CreateCourseActionTest.java @@ -1,17 +1,14 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.logic.core.CoursesLogic; -import teammates.test.driver.AssertHelper; -import teammates.ui.webapi.action.CreateCourseAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.CourseData; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.CourseCreateRequest; +import teammates.test.AssertHelper; +import teammates.ui.output.CourseData; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.CourseCreateRequest; /** * SUT: {@link CreateCourseAction}. @@ -47,8 +44,8 @@ public void testExecute() throws Exception { courseCreateRequest.setTimeZone("UTC"); courseCreateRequest.setCourseId("new-course"); - if (logic.isCoursePresent("new-course")) { - CoursesLogic.inst().deleteCourseCascade("new-course"); + if (logic.getCourse("new-course") != null) { + logic.deleteCourseCascade("new-course"); } loginAsInstructor(instructorId); @@ -61,7 +58,7 @@ public void testExecute() throws Exception { assertEquals(courseData.getTimeZone(), "UTC"); assertEquals(HttpStatus.SC_OK, result.getStatusCode()); - assertTrue(logic.isCoursePresent("new-course")); + assertNotNull(logic.getCourse("new-course")); ______TS("Typical case with existing course id"); diff --git a/src/test/java/teammates/test/cases/webapi/CreateFeedbackQuestionActionTest.java b/src/test/java/teammates/ui/webapi/CreateFeedbackQuestionActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/CreateFeedbackQuestionActionTest.java rename to src/test/java/teammates/ui/webapi/CreateFeedbackQuestionActionTest.java index ca69334e198..6619bae545a 100644 --- a/src/test/java/teammates/test/cases/webapi/CreateFeedbackQuestionActionTest.java +++ b/src/test/java/teammates/ui/webapi/CreateFeedbackQuestionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -15,13 +15,10 @@ import teammates.common.datatransfer.questions.FeedbackTextQuestionDetails; import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.ui.webapi.action.Action; -import teammates.ui.webapi.action.CreateFeedbackQuestionAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackQuestionData; -import teammates.ui.webapi.output.FeedbackVisibilityType; -import teammates.ui.webapi.output.NumberOfEntitiesToGiveFeedbackToSetting; -import teammates.ui.webapi.request.FeedbackQuestionCreateRequest; +import teammates.ui.output.FeedbackQuestionData; +import teammates.ui.output.FeedbackVisibilityType; +import teammates.ui.output.NumberOfEntitiesToGiveFeedbackToSetting; +import teammates.ui.request.FeedbackQuestionCreateRequest; /** * SUT: {@link CreateFeedbackQuestionAction}. @@ -257,7 +254,7 @@ protected void testAccessControl() throws Exception { }; loginAsInstructor(instructor1OfCourse1.googleId); - verifyCannotAccess(submissionParams); + verifyEntityNotFound(submissionParams); ______TS("inaccessible without ModifySessionPrivilege"); diff --git a/src/test/java/teammates/test/cases/webapi/CreateFeedbackResponseCommentActionTest.java b/src/test/java/teammates/ui/webapi/CreateFeedbackResponseCommentActionTest.java similarity index 87% rename from src/test/java/teammates/test/cases/webapi/CreateFeedbackResponseCommentActionTest.java rename to src/test/java/teammates/ui/webapi/CreateFeedbackResponseCommentActionTest.java index f6987a82197..f81fcc6f496 100644 --- a/src/test/java/teammates/test/cases/webapi/CreateFeedbackResponseCommentActionTest.java +++ b/src/test/java/teammates/ui/webapi/CreateFeedbackResponseCommentActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -19,17 +19,13 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.logic.core.FeedbackResponseCommentsLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.storage.api.FeedbackResponseCommentsDb; -import teammates.test.driver.AssertHelper; -import teammates.ui.webapi.action.CreateFeedbackResponseCommentAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.CommentVisibilityType; -import teammates.ui.webapi.output.FeedbackResponseCommentData; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.FeedbackResponseCommentCreateRequest; -import teammates.ui.webapi.request.Intent; +import teammates.common.util.StringHelper; +import teammates.test.AssertHelper; +import teammates.ui.output.CommentVisibilityType; +import teammates.ui.output.FeedbackResponseCommentData; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.FeedbackResponseCommentCreateRequest; +import teammates.ui.request.Intent; /** * SUT: {@link CreateFeedbackResponseCommentAction}. @@ -113,6 +109,13 @@ public void testExecute_invalidHttpParameters_shouldFail() { ______TS("not enough parameters"); verifyHttpParameterFailure(); + + ______TS("unencrypted responseId"); + String[] submissionParams = new String[] { + Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + }; + verifyHttpParameterFailure(submissionParams); } @Test @@ -122,7 +125,7 @@ public void testExecute_unpublishedSessionForInstructorResult_shouldPass() { ______TS("successful case for unpublished session for INSTRUCTOR_RESULT"); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; FeedbackResponseCommentCreateRequest requestBody = new FeedbackResponseCommentCreateRequest("Comment to first response", @@ -151,7 +154,7 @@ public void testExecute_unpublishedSessionEmptyGiverPermission_shouldPass() { ______TS("typical successful case for unpublished session empty giver permissions"); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; FeedbackResponseCommentCreateRequest requestBody = new FeedbackResponseCommentCreateRequest( @@ -168,7 +171,7 @@ public void testExecute_unpublishedSessionValidVisibilitySettings_shouldPass() { String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; FeedbackResponseCommentCreateRequest requestBody = new FeedbackResponseCommentCreateRequest( @@ -178,7 +181,7 @@ public void testExecute_unpublishedSessionValidVisibilitySettings_shouldPass() { submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; requestBody = new FeedbackResponseCommentCreateRequest("Comment shown to giver", @@ -188,7 +191,7 @@ public void testExecute_unpublishedSessionValidVisibilitySettings_shouldPass() { submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; requestBody = new FeedbackResponseCommentCreateRequest("Comment shown to receiver", @@ -198,7 +201,7 @@ public void testExecute_unpublishedSessionValidVisibilitySettings_shouldPass() { submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; requestBody = @@ -209,7 +212,7 @@ public void testExecute_unpublishedSessionValidVisibilitySettings_shouldPass() { submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; requestBody = new FeedbackResponseCommentCreateRequest( @@ -220,7 +223,7 @@ public void testExecute_unpublishedSessionValidVisibilitySettings_shouldPass() { submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; requestBody = new FeedbackResponseCommentCreateRequest("Comment shown to students", @@ -234,11 +237,11 @@ public void testExecute_unpublishedSessionValidVisibilitySettings_shouldPass() { public void testExecute_publishedSessionForInstructorResult_shouldPass() throws Exception { loginAsInstructor(instructor1OfCourse1.getGoogleId()); - FeedbackSessionsLogic.inst().publishFeedbackSession(session1InCourse1.getFeedbackSessionName(), + logic.publishFeedbackSession(session1InCourse1.getFeedbackSessionName(), session1InCourse1.getCourseId()); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; FeedbackResponseCommentCreateRequest requestBody = new FeedbackResponseCommentCreateRequest( @@ -264,7 +267,7 @@ public void testExecute_emptyCommentText_shouldFail() { ______TS("Unsuccessful case: empty comment text"); String[] submissionParams = new String[] { - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; FeedbackResponseCommentCreateRequest requestBody = new FeedbackResponseCommentCreateRequest("", @@ -280,10 +283,10 @@ public void testExecute_emptyCommentText_shouldFail() { @Test protected void testExecute_typicalCaseForSubmission_shouldPass() { // clean any existing comments. - FeedbackResponseCommentsLogic.inst().deleteFeedbackResponseComments( + logic.deleteFeedbackResponseComments( AttributesDeletionQuery.builder().withResponseId(response1ForQ3.getId()).build()); assertNull(logic.getFeedbackResponseCommentForResponseFromParticipant(response1ForQ3.getId())); - FeedbackResponseCommentsLogic.inst().deleteFeedbackResponseComments( + logic.deleteFeedbackResponseComments( AttributesDeletionQuery.builder().withResponseId(response1ForQ1.getId()).build()); assertNull(logic.getFeedbackResponseCommentForResponseFromParticipant(response1ForQ1.getId())); @@ -291,7 +294,7 @@ protected void testExecute_typicalCaseForSubmission_shouldPass() { loginAsStudent(student1InCourse1.getGoogleId()); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; FeedbackResponseCommentCreateRequest requestBody = new FeedbackResponseCommentCreateRequest( @@ -312,7 +315,7 @@ protected void testExecute_typicalCaseForSubmission_shouldPass() { loginAsInstructor(instructor1OfCourse1.getGoogleId()); submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; requestBody = new FeedbackResponseCommentCreateRequest( @@ -335,14 +338,14 @@ protected void testExecute_invalidIntent_shouldFail() { ______TS("invalid intent STUDENT_RESULT"); String[] invalidIntent1 = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; verifyHttpParameterFailure(invalidIntent1); ______TS("invalid intent FULL_DETAIL"); String[] invalidIntent2 = new String[] { Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; verifyHttpParameterFailure(invalidIntent2); } @@ -357,7 +360,7 @@ protected void testAccessControl() throws Exception { protected void testAccessControl_textTypeQuestionResponse_notAllowedToAddComment() { String[] submissionParamsInstructor = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ2.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ2.getId()), }; loginAsInstructor(instructor1OfCourse1.getGoogleId()); @@ -380,7 +383,7 @@ public void testAccessControl_contributionQuestionResponse_instructorNotAllowedT String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, contributionResponse.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(contributionResponse.getId()), }; loginAsInstructor(instructorAttributes.getGoogleId()); @@ -398,7 +401,7 @@ protected void testAccessControl_commentAlreadyExist_shouldNotCreateAgain() { loginAsStudent(student1InCourse1.getGoogleId()); String[] submissionParamsStudent = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; assertThrows(InvalidHttpParameterException.class, @@ -411,7 +414,7 @@ protected void testAccessControl_commentAlreadyExist_shouldNotCreateAgain() { loginAsInstructor(instructor1OfCourse1.getGoogleId()); String[] submissionParamsInstructor = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; assertThrows(InvalidHttpParameterException.class, @@ -425,7 +428,7 @@ protected void testAccessControl_submitCommentForOthersResponse_shouldFail() { loginAsStudent(student1InCourse1.getGoogleId()); String[] submissionParamsStudentToStudents = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response2ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response2ForQ3.getId()), }; verifyCannotAccess(submissionParamsStudentToStudents); @@ -439,7 +442,7 @@ protected void testAccessControl_submitCommentForOthersResponse_shouldFail() { loginAsStudent(student3InCourse1.getGoogleId()); String[] submissionParamsTeam = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response2ForQ4.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response2ForQ4.getId()), }; verifyCannotAccess(submissionParamsTeam); @@ -452,7 +455,7 @@ protected void testAccessControl_submitCommentForOthersResponse_shouldFail() { loginAsInstructor(instructor2OfCourse1.getGoogleId()); String[] submissionParamsInstructorToInstructor = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ5.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ5.getId()), }; verifyCannotAccess(submissionParamsInstructorToInstructor); @@ -469,14 +472,14 @@ protected void testAccessControl_invalidIntent_shouldFail() { loginAsStudent(student1InCourse1.getGoogleId()); String[] invalidIntent1 = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; assertThrows(InvalidHttpParameterException.class, () -> getAction(invalidIntent1).checkAccessControl()); ______TS("invalid intent FULL_DETAIL"); String[] invalidIntent2 = new String[] { Const.ParamsNames.INTENT, Intent.FULL_DETAIL.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; assertThrows(InvalidHttpParameterException.class, () -> getAction(invalidIntent2).checkAccessControl()); } @@ -487,7 +490,7 @@ protected void testAccessControl_instructorWithoutSubmitSessionInSectionsPrivile loginAsInstructor(helperOfCourse1.getGoogleId()); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; verifyCannotAccess(submissionParams); } @@ -498,7 +501,7 @@ protected void testAccessControl_logOut_shouldFail() { gaeSimulation.logoutUser(); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; verifyCannotAccess(submissionParams); } @@ -509,7 +512,7 @@ protected void testAccessControl_studentAccessInstructorResponse_shouldFail() { loginAsStudent(student1InCourse1.getGoogleId()); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; verifyCannotAccess(submissionParams); } @@ -520,7 +523,7 @@ protected void testAccessControl_accessibleForInstructorInSameCourse_shouldPass( loginAsInstructor(instructor2OfCourse1.getGoogleId()); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; verifyCanAccess(submissionParams); } @@ -531,7 +534,7 @@ protected void testAccessControl_accessibleForAdminToMasqueradeAsInstructor_shou loginAsAdmin(); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; verifyCanMasquerade(instructor1OfCourse1.getGoogleId(), submissionParams); } @@ -579,7 +582,7 @@ protected void testAccessControl_onlyInstructorsWithOnlyEitherPrivilege_shouldFa private String[] getSubmissionParamsForCrossSectionResponse() { return new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ6.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ6.getId()), }; } @@ -592,8 +595,7 @@ private String[] getSubmissionParamsForCrossSectionResponse() { * @return instructor comments */ private List getInstructorComments(String responseId, String commentText) { - FeedbackResponseCommentsDb frcDb = new FeedbackResponseCommentsDb(); - return frcDb.getFeedbackResponseCommentsForResponse(responseId) + return logic.getFeedbackResponseCommentForResponse(responseId) .stream() .filter(comment -> comment.commentText.equals(commentText)) .collect(Collectors.toList()); diff --git a/src/test/java/teammates/test/cases/webapi/CreateFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/CreateFeedbackSessionActionTest.java similarity index 94% rename from src/test/java/teammates/test/cases/webapi/CreateFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/CreateFeedbackSessionActionTest.java index 1358e1aa742..cfabb03159e 100644 --- a/src/test/java/teammates/test/cases/webapi/CreateFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/CreateFeedbackSessionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,13 +8,11 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.test.driver.StringHelperExtension; -import teammates.ui.webapi.action.CreateFeedbackSessionAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.output.ResponseVisibleSetting; -import teammates.ui.webapi.output.SessionVisibleSetting; -import teammates.ui.webapi.request.FeedbackSessionCreateRequest; +import teammates.common.util.StringHelperExtension; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.ResponseVisibleSetting; +import teammates.ui.output.SessionVisibleSetting; +import teammates.ui.request.FeedbackSessionCreateRequest; /** * SUT: {@link CreateFeedbackSessionAction}. diff --git a/src/test/java/teammates/test/cases/webapi/CreateInstructorActionTest.java b/src/test/java/teammates/ui/webapi/CreateInstructorActionTest.java similarity index 83% rename from src/test/java/teammates/test/cases/webapi/CreateInstructorActionTest.java rename to src/test/java/teammates/ui/webapi/CreateInstructorActionTest.java index 8a8544af90d..e65f45af1f4 100644 --- a/src/test/java/teammates/test/cases/webapi/CreateInstructorActionTest.java +++ b/src/test/java/teammates/ui/webapi/CreateInstructorActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.Map; @@ -9,20 +9,15 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.TaskWrapper; -import teammates.logic.core.InstructorsLogic; -import teammates.ui.webapi.action.CreateInstructorAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.InstructorCreateRequest; +import teammates.ui.output.InstructorData; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.InstructorCreateRequest; /** * SUT: {@link CreateInstructorAction}. */ public class CreateInstructorActionTest extends BaseActionTest { - private final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); - @Override protected String getActionUri() { return Const.ResourceURIs.INSTRUCTOR; @@ -62,9 +57,9 @@ protected void testExecute() throws Exception { InstructorData response = (InstructorData) actionOutput.getOutput(); - assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(newInstructorEmail, courseId)); + assertNotNull(logic.getInstructorForEmail(courseId, newInstructorEmail)); - InstructorAttributes instructorAdded = instructorsLogic.getInstructorForEmail(courseId, newInstructorEmail); + InstructorAttributes instructorAdded = logic.getInstructorForEmail(courseId, newInstructorEmail); assertEquals(newInstructorName, instructorAdded.name); assertEquals(newInstructorName, response.getName()); assertEquals(newInstructorEmail, instructorAdded.email); @@ -74,7 +69,7 @@ protected void testExecute() throws Exception { TaskWrapper taskAdded = createInstructorAction.getTaskQueuer().getTasksAdded().get(0); - assertEquals(courseId, taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)[0]); + assertEquals(courseId, taskAdded.getParamMap().get(Const.ParamsNames.COURSE_ID)); assertEquals(instructorAdded.email, reqBody.getEmail()); assertEquals(instructorId, reqBody.getId()); @@ -113,7 +108,7 @@ protected void testExecute() throws Exception { ______TS("Masquerade mode: add an instructor"); - instructorsLogic.deleteInstructorCascade(courseId, newInstructorEmail); + logic.deleteInstructorCascade(courseId, newInstructorEmail); loginAsAdmin(); submissionParams = new String[] { @@ -130,9 +125,9 @@ protected void testExecute() throws Exception { response = (InstructorData) actionOutput.getOutput(); - assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(newInstructorEmail, courseId)); + assertNotNull(logic.getInstructorForEmail(courseId, newInstructorEmail)); - instructorAdded = instructorsLogic.getInstructorForEmail(courseId, newInstructorEmail); + instructorAdded = logic.getInstructorForEmail(courseId, newInstructorEmail); assertEquals(newInstructorName, instructorAdded.name); assertEquals(newInstructorName, response.getName()); assertEquals(newInstructorEmail, instructorAdded.email); @@ -141,10 +136,10 @@ protected void testExecute() throws Exception { verifySpecifiedTasksAdded(createInstructorAction, Const.TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_QUEUE_NAME, 1); taskAdded = createInstructorAction.getTaskQueuer().getTasksAdded().get(0); - Map paramMap = taskAdded.getParamMap(); + Map paramMap = taskAdded.getParamMap(); - assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)[0]); - assertEquals(instructorAdded.email, paramMap.get(Const.ParamsNames.INSTRUCTOR_EMAIL)[0]); + assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)); + assertEquals(instructorAdded.email, paramMap.get(Const.ParamsNames.INSTRUCTOR_EMAIL)); } @Override @@ -160,6 +155,6 @@ protected void testAccessControl() throws Exception { Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR, submissionParams); // remove the newly added instructor - InstructorsLogic.inst().deleteInstructorCascade("idOfTypicalCourse1", "instructor@email.tmt"); + logic.deleteInstructorCascade("idOfTypicalCourse1", "instructor@email.tmt"); } } diff --git a/src/test/java/teammates/test/cases/webapi/DeleteAccountActionTest.java b/src/test/java/teammates/ui/webapi/DeleteAccountActionTest.java similarity index 90% rename from src/test/java/teammates/test/cases/webapi/DeleteAccountActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteAccountActionTest.java index 6a73713213a..f9bbf0fa8f7 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteAccountActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteAccountActionTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteAccountAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link DeleteAccountAction}. diff --git a/src/test/java/teammates/test/cases/webapi/DeleteCourseActionTest.java b/src/test/java/teammates/ui/webapi/DeleteCourseActionTest.java similarity index 91% rename from src/test/java/teammates/test/cases/webapi/DeleteCourseActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteCourseActionTest.java index 1a3f4682c75..35b83269c66 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteCourseActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -6,9 +6,7 @@ import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteCourseAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link DeleteCourseAction}. @@ -47,7 +45,9 @@ public void testExecute() throws Exception { CourseAttributes courseToBeDeleted = logic.getCourse(courseId); loginAsInstructor(instructorId); logic.moveCourseToRecycleBin(courseToBeDeleted.getId()); - assertEquals(courseId, logic.getSoftDeletedCourseForInstructor(instructor1OfCourse1).getId()); + CourseAttributes deletedCourse = logic.getCourse(courseId); + assertNotNull(deletedCourse); + assertTrue(deletedCourse.isCourseDeleted()); DeleteCourseAction deleteCourseAction = getAction(submissionParams); JsonResult result = getJsonResult(deleteCourseAction); diff --git a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackQuestionActionTest.java b/src/test/java/teammates/ui/webapi/DeleteFeedbackQuestionActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/DeleteFeedbackQuestionActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteFeedbackQuestionActionTest.java index 93e1d51e27b..f29fc99f47d 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackQuestionActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteFeedbackQuestionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,8 +8,6 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.questions.FeedbackQuestionType; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteFeedbackQuestionAction; -import teammates.ui.webapi.action.JsonResult; /** * SUT: {@link DeleteFeedbackQuestionAction}. diff --git a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackResponseCommentActionTest.java b/src/test/java/teammates/ui/webapi/DeleteFeedbackResponseCommentActionTest.java similarity index 98% rename from src/test/java/teammates/test/cases/webapi/DeleteFeedbackResponseCommentActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteFeedbackResponseCommentActionTest.java index a3a75d26897..712bda722c7 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackResponseCommentActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteFeedbackResponseCommentActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -15,10 +15,8 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteFeedbackResponseCommentAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.Intent; /** * SUT: {@link DeleteFeedbackResponseCommentAction}. diff --git a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/DeleteFeedbackSessionActionTest.java similarity index 97% rename from src/test/java/teammates/test/cases/webapi/DeleteFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteFeedbackSessionActionTest.java index 0609857ee6c..c07ac9d5fc7 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteFeedbackSessionActionTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteFeedbackSessionAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link DeleteFeedbackSessionAction}. diff --git a/src/test/java/teammates/test/cases/webapi/DeleteInstructorActionTest.java b/src/test/java/teammates/ui/webapi/DeleteInstructorActionTest.java similarity index 87% rename from src/test/java/teammates/test/cases/webapi/DeleteInstructorActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteInstructorActionTest.java index 388cd4d90ed..f8b87ecb31f 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteInstructorActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteInstructorActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,18 +7,13 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.logic.core.InstructorsLogic; -import teammates.ui.webapi.action.DeleteInstructorAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link DeleteInstructorAction}. */ public class DeleteInstructorActionTest extends BaseActionTest { - private final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); - @Override protected String getActionUri() { return Const.ResourceURIs.INSTRUCTOR; @@ -57,7 +52,7 @@ protected void testExecute_typicalCaseByGoogleId_shouldPass() { MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", msg.getMessage()); - assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse2.email, instructor1OfCourse2.courseId)); + assertNull(logic.getInstructorForEmail(instructor1OfCourse2.courseId, instructor1OfCourse2.email)); ______TS("Typical case: instructor deletes another instructor by google id"); @@ -80,8 +75,8 @@ protected void testExecute_typicalCaseByGoogleId_shouldPass() { msg = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", msg.getMessage()); - assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor2OfCourse1.email, instructor1OfCourse1.courseId)); - assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse1.email, instructor1OfCourse1.courseId)); + assertNull(logic.getInstructorForEmail(instructor2OfCourse1.courseId, instructor2OfCourse1.email)); + assertNotNull(logic.getInstructorForEmail(instructor1OfCourse1.courseId, instructor1OfCourse1.email)); } @@ -106,8 +101,8 @@ public void testExecute_deleteInstructorByEmail_shouldSuccess() { MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", msg.getMessage()); - assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor2OfCourse1.email, instructor1OfCourse1.courseId)); - assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse1.email, instructor1OfCourse1.courseId)); + assertNull(logic.getInstructorForEmail(instructor2OfCourse1.courseId, instructor2OfCourse1.email)); + assertNotNull(logic.getInstructorForEmail(instructor1OfCourse1.courseId, instructor1OfCourse1.email)); } @Test @@ -132,7 +127,7 @@ protected void testExecute_adminDeletesLastInstructorByGoogleId_shouldPass() { MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", msg.getMessage()); - assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor4.email, instructor4.courseId)); + assertNull(logic.getInstructorForEmail(instructor4.courseId, instructor4.email)); } @Test @@ -156,10 +151,8 @@ protected void testExecute_instructorDeleteOwnRoleByGoogleId_shouldPass() { MessageOutput msg = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", msg.getMessage()); - InstructorsLogic instructorsLogic = InstructorsLogic.inst(); - - assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructor2OfCourse1.email, instructor1OfCourse1.courseId)); - assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructor1OfCourse1.email, instructor1OfCourse1.courseId)); + assertNull(logic.getInstructorForEmail(instructor2OfCourse1.courseId, instructor2OfCourse1.email)); + assertNotNull(logic.getInstructorForEmail(instructor1OfCourse1.courseId, instructor1OfCourse1.email)); } @Test @@ -185,8 +178,8 @@ protected void testExecute_deleteLastInstructorByGoogleId_shouldFail() { assertEquals("The instructor you are trying to delete is the last instructor in the course. " + "Deleting the last instructor from the course is not allowed.", messageOutput.getMessage()); - assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructorToDelete.email, courseId)); - assertTrue(instructorsLogic.isGoogleIdOfInstructorOfCourse(instructorToDelete.googleId, courseId)); + assertNotNull(logic.getInstructorForEmail(instructorToDelete.courseId, instructorToDelete.email)); + assertNotNull(logic.getInstructorForGoogleId(instructorToDelete.courseId, instructorToDelete.googleId)); } @Test @@ -213,8 +206,8 @@ protected void testExecute_deleteLastInstructorInMasqueradeByGoogleId_shouldFail assertEquals("The instructor you are trying to delete is the last instructor in the course. " + "Deleting the last instructor from the course is not allowed.", messageOutput.getMessage()); - assertTrue(instructorsLogic.isEmailOfInstructorOfCourse(instructorToDelete.email, courseId)); - assertTrue(instructorsLogic.isGoogleIdOfInstructorOfCourse(instructorToDelete.googleId, courseId)); + assertNotNull(logic.getInstructorForEmail(instructorToDelete.courseId, instructorToDelete.email)); + assertNotNull(logic.getInstructorForGoogleId(instructorToDelete.courseId, instructorToDelete.googleId)); } @Test @@ -239,7 +232,7 @@ protected void testExecute_deleteInstructorInMasqueradeByGoogleId_shouldPass() { MessageOutput messageOutput = (MessageOutput) response.getOutput(); assertEquals("Instructor is successfully deleted.", messageOutput.getMessage()); - assertFalse(instructorsLogic.isEmailOfInstructorOfCourse(instructorToDelete.email, courseId)); + assertNull(logic.getInstructorForEmail(courseId, instructorToDelete.email)); } @Test diff --git a/src/test/java/teammates/test/cases/webapi/DeleteStudentActionTest.java b/src/test/java/teammates/ui/webapi/DeleteStudentActionTest.java similarity index 97% rename from src/test/java/teammates/test/cases/webapi/DeleteStudentActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteStudentActionTest.java index 35830aff911..1d8dce3f0c0 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteStudentActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteStudentActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,8 +8,6 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteStudentAction; -import teammates.ui.webapi.action.JsonResult; /** * SUT: {@link DeleteStudentAction}. diff --git a/src/test/java/teammates/test/cases/webapi/DeleteStudentProfilePictureActionTest.java b/src/test/java/teammates/ui/webapi/DeleteStudentProfilePictureActionTest.java similarity index 92% rename from src/test/java/teammates/test/cases/webapi/DeleteStudentProfilePictureActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteStudentProfilePictureActionTest.java index d800aef6515..c353e4aa82b 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteStudentProfilePictureActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteStudentProfilePictureActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.BeforeClass; @@ -6,9 +6,7 @@ import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteStudentProfilePictureAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link DeleteStudentProfilePictureAction}. diff --git a/src/test/java/teammates/test/cases/webapi/DeleteStudentsActionTest.java b/src/test/java/teammates/ui/webapi/DeleteStudentsActionTest.java similarity index 94% rename from src/test/java/teammates/test/cases/webapi/DeleteStudentsActionTest.java rename to src/test/java/teammates/ui/webapi/DeleteStudentsActionTest.java index 3740a9841ff..b83a58fb523 100644 --- a/src/test/java/teammates/test/cases/webapi/DeleteStudentsActionTest.java +++ b/src/test/java/teammates/ui/webapi/DeleteStudentsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,8 +7,6 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.action.DeleteStudentsAction; -import teammates.ui.webapi.action.JsonResult; /** * SUT: {@link DeleteStudentsAction}. diff --git a/src/test/java/teammates/test/cases/webapi/DowngradeAccountActionTest.java b/src/test/java/teammates/ui/webapi/DowngradeAccountActionTest.java similarity index 92% rename from src/test/java/teammates/test/cases/webapi/DowngradeAccountActionTest.java rename to src/test/java/teammates/ui/webapi/DowngradeAccountActionTest.java index 0628dd66ddd..da4998262fb 100644 --- a/src/test/java/teammates/test/cases/webapi/DowngradeAccountActionTest.java +++ b/src/test/java/teammates/ui/webapi/DowngradeAccountActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,9 +7,7 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; -import teammates.ui.webapi.action.DowngradeAccountAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link DowngradeAccountAction}. diff --git a/src/test/java/teammates/test/cases/webapi/EnrollStudentsActionTest.java b/src/test/java/teammates/ui/webapi/EnrollStudentsActionTest.java similarity index 97% rename from src/test/java/teammates/test/cases/webapi/EnrollStudentsActionTest.java rename to src/test/java/teammates/ui/webapi/EnrollStudentsActionTest.java index b8af090b739..7e06dbb0cbe 100644 --- a/src/test/java/teammates/test/cases/webapi/EnrollStudentsActionTest.java +++ b/src/test/java/teammates/ui/webapi/EnrollStudentsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -11,11 +11,9 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.ui.webapi.action.EnrollStudentsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.StudentData; -import teammates.ui.webapi.output.StudentsData; -import teammates.ui.webapi.request.StudentsEnrollRequest; +import teammates.ui.output.StudentData; +import teammates.ui.output.StudentsData; +import teammates.ui.request.StudentsEnrollRequest; /** * SUT: {@link EnrollStudentsAction}. @@ -199,7 +197,7 @@ public void testExecute_withNumberOfStudentsMoreThanSectionLimit_shouldThrowInva for (int i = 0; i < Const.StudentsLogicConst.SECTION_SIZE_LIMIT; i++) { StudentAttributes addedStudent = StudentAttributes - .builder(courseId, i + "email@com") + .builder(courseId, i + "email@test.com") .withName("Name " + i) .withSectionName(randomSectionName) .withTeamName("Team " + i) @@ -218,7 +216,7 @@ public void testExecute_withNumberOfStudentsMoreThanSectionLimit_shouldThrowInva // Enroll one more student to exceed limit. StudentAttributes oneMoreStudentToGoBeyondLimit = StudentAttributes - .builder(courseId, "email@com") + .builder(courseId, "email@test.com") .withName("Name") .withSectionName(randomSectionName) .withTeamName("Team") diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionClosedRemindersActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionClosedRemindersActionTest.java similarity index 77% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionClosedRemindersActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionClosedRemindersActionTest.java index c6767c503f3..6d0d0e5f131 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionClosedRemindersActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionClosedRemindersActionTest.java @@ -1,39 +1,45 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import java.time.Instant; import java.time.ZoneId; import java.util.List; -import java.util.Map; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; import teammates.common.util.TaskWrapper; import teammates.common.util.TimeHelper; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.test.driver.TimeHelperExtension; -import teammates.ui.automated.FeedbackSessionClosedRemindersAction; +import teammates.common.util.TimeHelperExtension; +import teammates.ui.request.SendEmailRequest; /** * SUT: {@link FeedbackSessionClosedRemindersAction}. */ public class FeedbackSessionClosedRemindersActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - private static final FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); + extends BaseActionTest { @Override protected String getActionUri() { return Const.CronJobURIs.AUTOMATED_FEEDBACK_CLOSED_REMINDERS; } + @Override + protected String getRequestMethod() { + return GET; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() throws Exception { + public void testExecute() throws Exception { ______TS("default state of typical data bundle: 0 sessions closed recently"); @@ -47,11 +53,11 @@ public void allTests() throws Exception { // Session is closed recently - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); session1.setTimeZone(ZoneId.of("UTC")); session1.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-2)); session1.setEndTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-1)); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withTimeZone(session1.getTimeZone()) @@ -63,12 +69,12 @@ public void allTests() throws Exception { // Ditto, but with disabled closed reminder - FeedbackSessionAttributes session2 = dataBundle.feedbackSessions.get("session2InCourse1"); + FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); session2.setTimeZone(ZoneId.of("UTC")); session2.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-2)); session2.setEndTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-1)); session2.setClosingEmailEnabled(false); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session2.getFeedbackSessionName(), session2.getCourseId()) .withTimeZone(session2.getTimeZone()) @@ -81,11 +87,11 @@ public void allTests() throws Exception { // Still in grace period; closed reminder should not be sent - FeedbackSessionAttributes session3 = dataBundle.feedbackSessions.get("gracePeriodSession"); + FeedbackSessionAttributes session3 = typicalBundle.feedbackSessions.get("gracePeriodSession"); session3.setTimeZone(ZoneId.of("UTC")); session3.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-2)); session3.setEndTime(Instant.now()); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session3.getFeedbackSessionName(), session3.getCourseId()) .withTimeZone(session3.getTimeZone()) @@ -101,19 +107,20 @@ public void allTests() throws Exception { // 5 students and 5 instructors in course1 verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 10); - String courseName = coursesLogic.getCourse(session1.getCourseId()).getName(); + String courseName = logic.getCourse(session1.getCourseId()).getName(); List tasksAdded = action.getTaskQueuer().getTasksAdded(); for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); assertEquals(String.format(EmailType.FEEDBACK_CLOSED.getSubject(), courseName, session1.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); + email.getSubject()); } ______TS("1 session closed recently with closed emails sent"); session1.setSentClosedEmail(true); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withSentClosedEmail(session1.isSentClosedEmail()) diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionClosingRemindersActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionClosingRemindersActionTest.java similarity index 75% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionClosingRemindersActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionClosingRemindersActionTest.java index 51b00f57aad..afaea34af41 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionClosingRemindersActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionClosingRemindersActionTest.java @@ -1,38 +1,45 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import java.time.ZoneId; import java.util.List; -import java.util.Map; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; import teammates.common.util.TaskWrapper; +import teammates.common.util.ThreadHelper; import teammates.common.util.TimeHelper; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.test.driver.TimeHelperExtension; -import teammates.ui.automated.FeedbackSessionClosingRemindersAction; +import teammates.common.util.TimeHelperExtension; +import teammates.ui.request.SendEmailRequest; /** * SUT: {@link FeedbackSessionClosingRemindersAction}. */ public class FeedbackSessionClosingRemindersActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - private static final FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); + extends BaseActionTest { @Override protected String getActionUri() { return Const.CronJobURIs.AUTOMATED_FEEDBACK_CLOSING_REMINDERS; } + @Override + protected String getRequestMethod() { + return GET; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() throws Exception { + public void testExecute() throws Exception { ______TS("default state of typical data bundle: 0 sessions closing soon"); @@ -46,11 +53,11 @@ public void allTests() throws Exception { // Modify session to close in 24 hours - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); session1.setTimeZone(ZoneId.of("UTC")); session1.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); session1.setEndTime(TimeHelper.getInstantDaysOffsetFromNow(1)); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withTimeZone(session1.getTimeZone()) @@ -62,12 +69,12 @@ public void allTests() throws Exception { // Ditto, but disable the closing reminder - FeedbackSessionAttributes session2 = dataBundle.feedbackSessions.get("session1InCourse2"); + FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session1InCourse2"); session2.setTimeZone(ZoneId.of("UTC")); session2.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); session2.setEndTime(TimeHelper.getInstantDaysOffsetFromNow(1)); session2.setClosingEmailEnabled(false); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session2.getFeedbackSessionName(), session2.getCourseId()) .withTimeZone(session2.getTimeZone()) @@ -80,11 +87,11 @@ public void allTests() throws Exception { // 1 session not yet opened; do not send the closing reminder - FeedbackSessionAttributes session3 = dataBundle.feedbackSessions.get("gracePeriodSession"); + FeedbackSessionAttributes session3 = typicalBundle.feedbackSessions.get("gracePeriodSession"); session3.setTimeZone(ZoneId.of("UTC")); session3.setStartTime(TimeHelperExtension.getInstantHoursOffsetFromNow(1)); session3.setEndTime(TimeHelper.getInstantDaysOffsetFromNow(1)); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session3.getFeedbackSessionName(), session3.getCourseId()) .withTimeZone(session3.getTimeZone()) @@ -94,25 +101,29 @@ public void allTests() throws Exception { session3.setSentOpenEmail(false); // fsLogic will set the flag to true verifyPresentInDatastore(session3); + // wait for very briefly so that the above session will be within the time limit + ThreadHelper.waitFor(5); + action = getAction(); action.execute(); // 5 students and 5 instructors in course1, 1 student has completed the feedback session verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 9); - String courseName = coursesLogic.getCourse(session1.getCourseId()).getName(); + String courseName = logic.getCourse(session1.getCourseId()).getName(); List tasksAdded = action.getTaskQueuer().getTasksAdded(); for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); assertEquals(String.format(EmailType.FEEDBACK_CLOSING.getSubject(), courseName, session1.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); + email.getSubject()); } ______TS("1 session closing soon with emails sent"); session1.setSentClosingEmail(true); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session3.getFeedbackSessionName(), session3.getCourseId()) .withSentClosingEmail(session3.isSentClosingEmail()) diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionOpeningRemindersActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersActionTest.java similarity index 75% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionOpeningRemindersActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersActionTest.java index 199b8ae88c1..86e1b63d1c0 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionOpeningRemindersActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionOpeningRemindersActionTest.java @@ -1,37 +1,43 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import java.util.List; -import java.util.Map; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; import teammates.common.util.TaskWrapper; import teammates.common.util.TimeHelper; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.test.driver.TimeHelperExtension; -import teammates.ui.automated.FeedbackSessionOpeningRemindersAction; +import teammates.common.util.TimeHelperExtension; +import teammates.ui.request.SendEmailRequest; /** * SUT: {@link FeedbackSessionOpeningRemindersAction}. */ public class FeedbackSessionOpeningRemindersActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - private static final FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); + extends BaseActionTest { @Override protected String getActionUri() { return Const.CronJobURIs.AUTOMATED_FEEDBACK_OPENING_REMINDERS; } + @Override + protected String getRequestMethod() { + return GET; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() throws Exception { + public void testExecute() throws Exception { ______TS("default state of typical data bundle: no sessions opened"); @@ -44,34 +50,34 @@ public void allTests() throws Exception { // Close the session and re-open with the opening time 1 day before - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); session1.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(2)); session1.setEndTime(TimeHelper.getInstantDaysOffsetFromNow(3)); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withStartTime(session1.getStartTime()) .withEndTime(session1.getEndTime()) .build()); session1.setStartTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-23)); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withStartTime(session1.getStartTime()) .build()); - FeedbackSessionAttributes session2 = dataBundle.feedbackSessions.get("session2InCourse1"); + FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); session2.setStartTime(TimeHelper.getInstantDaysOffsetFromNow(2)); session2.setEndTime(TimeHelper.getInstantDaysOffsetFromNow(3)); session2.setOpeningEmailEnabled(false); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session2.getFeedbackSessionName(), session2.getCourseId()) .withStartTime(session2.getStartTime()) .withEndTime(session2.getEndTime()) .build()); session2.setStartTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-23)); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session2.getFeedbackSessionName(), session2.getCourseId()) .withStartTime(session2.getStartTime()) @@ -83,31 +89,32 @@ public void allTests() throws Exception { // 5 students and 5 instructors in course1 verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 20); - String courseName = coursesLogic.getCourse(session1.getCourseId()).getName(); + String courseName = logic.getCourse(session1.getCourseId()).getName(); List tasksAdded = action.getTaskQueuer().getTasksAdded(); for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); try { assertEquals(String.format(EmailType.FEEDBACK_OPENING.getSubject(), courseName, session1.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); + email.getSubject()); } catch (AssertionError ae) { assertEquals(String.format(EmailType.FEEDBACK_OPENING.getSubject(), courseName, session2.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); + email.getSubject()); } } ______TS("2 sessions opened with emails sent"); session1.setSentOpenEmail(true); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withSentOpenEmail(session1.isSentOpenEmail()) .build()); session2.setSentOpenEmail(true); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session2.getFeedbackSessionName(), session2.getCourseId()) .withSentOpenEmail(session2.isSentOpenEmail()) diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionPublishedEmailWorkerActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerActionTest.java similarity index 55% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionPublishedEmailWorkerActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerActionTest.java index a75483519c2..9d1ccdf9f6a 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionPublishedEmailWorkerActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedEmailWorkerActionTest.java @@ -1,7 +1,6 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import java.util.List; -import java.util.Map; import org.testng.annotations.Test; @@ -9,30 +8,40 @@ import teammates.common.util.Const; import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; import teammates.common.util.TaskWrapper; -import teammates.logic.core.CoursesLogic; -import teammates.ui.automated.FeedbackSessionPublishedEmailWorkerAction; +import teammates.ui.request.SendEmailRequest; /** * SUT: {@link FeedbackSessionPublishedEmailWorkerAction}. */ public class FeedbackSessionPublishedEmailWorkerActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); + extends BaseActionTest { @Override protected String getActionUri() { return Const.TaskQueue.FEEDBACK_SESSION_PUBLISHED_EMAIL_WORKER_URL; } + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() { - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); + public void testExecute() { + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); String[] submissionParams = new String[] { - ParamsNames.EMAIL_COURSE, session1.getCourseId(), - ParamsNames.EMAIL_FEEDBACK, session1.getFeedbackSessionName(), + ParamsNames.COURSE_ID, session1.getCourseId(), + ParamsNames.FEEDBACK_SESSION_NAME, session1.getFeedbackSessionName(), }; FeedbackSessionPublishedEmailWorkerAction action = getAction(submissionParams); @@ -41,13 +50,14 @@ public void allTests() { // 5 students and 5 instructors in course1 verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 10); - String courseName = coursesLogic.getCourse(session1.getCourseId()).getName(); + String courseName = logic.getCourse(session1.getCourseId()).getName(); List tasksAdded = action.getTaskQueuer().getTasksAdded(); for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); assertEquals(String.format(EmailType.FEEDBACK_PUBLISHED.getSubject(), courseName, session1.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); + email.getSubject()); } } diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionPublishedRemindersActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersActionTest.java similarity index 75% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionPublishedRemindersActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersActionTest.java index 93fd35291cd..e8b0a2983aa 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionPublishedRemindersActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionPublishedRemindersActionTest.java @@ -1,28 +1,36 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; import teammates.common.util.TimeHelper; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.ui.automated.FeedbackSessionPublishedRemindersAction; /** * SUT: {@link FeedbackSessionPublishedRemindersAction}. */ public class FeedbackSessionPublishedRemindersActionTest - extends BaseAutomatedActionTest { - - private static final FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); + extends BaseActionTest { @Override protected String getActionUri() { return Const.CronJobURIs.AUTOMATED_FEEDBACK_PUBLISHED_REMINDERS; } + @Override + protected String getRequestMethod() { + return GET; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() throws Exception { + public void testExecute() throws Exception { ______TS("default state of typical data bundle: 1 session published with email unsent"); @@ -37,9 +45,9 @@ public void allTests() throws Exception { // Publish session by moving automated publish time - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); session1.setResultsVisibleFromTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withResultsVisibleFromTime(session1.getResultsVisibleFromTime()) @@ -48,10 +56,10 @@ public void allTests() throws Exception { // Publish session by moving automated publish time and disable publish reminder - FeedbackSessionAttributes session2 = dataBundle.feedbackSessions.get("session2InCourse1"); + FeedbackSessionAttributes session2 = typicalBundle.feedbackSessions.get("session2InCourse1"); session2.setResultsVisibleFromTime(TimeHelper.getInstantDaysOffsetFromNow(-1)); session2.setPublishedEmailEnabled(false); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session2.getFeedbackSessionName(), session2.getCourseId()) .withResultsVisibleFromTime(session2.getResultsVisibleFromTime()) @@ -61,15 +69,15 @@ public void allTests() throws Exception { // Do a manual publish - FeedbackSessionAttributes session3 = dataBundle.feedbackSessions.get("gracePeriodSession"); - fsLogic.updateFeedbackSession( + FeedbackSessionAttributes session3 = typicalBundle.feedbackSessions.get("gracePeriodSession"); + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session3.getFeedbackSessionName(), session3.getCourseId()) .withResultsVisibleFromTime(Const.TIME_REPRESENTS_LATER) .build()); - fsLogic.publishFeedbackSession(session3.getFeedbackSessionName(), session3.getCourseId()); + logic.publishFeedbackSession(session3.getFeedbackSessionName(), session3.getCourseId()); session3.setResultsVisibleFromTime( - fsLogic.getFeedbackSession(session3.getFeedbackSessionName(), session3.getCourseId()) + logic.getFeedbackSession(session3.getFeedbackSessionName(), session3.getCourseId()) .getResultsVisibleFromTime()); verifyPresentInDatastore(session3); @@ -80,7 +88,7 @@ public void allTests() throws Exception { ______TS("1 session unpublished manually"); - fsLogic.unpublishFeedbackSession(session3.getFeedbackSessionName(), session3.getCourseId()); + logic.unpublishFeedbackSession(session3.getFeedbackSessionName(), session3.getCourseId()); action = getAction(); action.execute(); @@ -90,7 +98,7 @@ public void allTests() throws Exception { ______TS("1 session published with emails sent"); session1.setSentPublishedEmail(true); - fsLogic.updateFeedbackSession( + logic.updateFeedbackSession( FeedbackSessionAttributes .updateOptionsBuilder(session1.getFeedbackSessionName(), session1.getCourseId()) .withSentPublishedEmail(session1.isSentPublishedEmail()) diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionRemindEmailWorkerActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerActionTest.java similarity index 62% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionRemindEmailWorkerActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerActionTest.java index f88e4c61f9a..741dd388e32 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionRemindEmailWorkerActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionRemindEmailWorkerActionTest.java @@ -1,8 +1,7 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Set; import org.testng.annotations.Test; @@ -13,44 +12,48 @@ import teammates.common.util.Const; import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; import teammates.common.util.TaskWrapper; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.logic.core.InstructorsLogic; -import teammates.logic.core.StudentsLogic; -import teammates.ui.automated.FeedbackSessionRemindEmailWorkerAction; +import teammates.ui.request.SendEmailRequest; /** * SUT: {@link FeedbackSessionRemindEmailWorkerAction}. */ public class FeedbackSessionRemindEmailWorkerActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - private static final FeedbackSessionsLogic fsLogic = FeedbackSessionsLogic.inst(); - private static final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); - private static final StudentsLogic studentsLogic = StudentsLogic.inst(); + extends BaseActionTest { @Override protected String getActionUri() { return Const.TaskQueue.FEEDBACK_SESSION_REMIND_EMAIL_WORKER_URL; } + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() throws Exception { + public void testExecute() throws Exception { ______TS("Send feedback session reminder email"); - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); - InstructorAttributes instructor1 = dataBundle.instructors.get("instructor1OfCourse1"); + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); + InstructorAttributes instructor1 = typicalBundle.instructors.get("instructor1OfCourse1"); // re-read from Datastore to update the respondents list - session1 = fsLogic.getFeedbackSession(session1.getFeedbackSessionName(), session1.getCourseId()); + session1 = logic.getFeedbackSession(session1.getFeedbackSessionName(), session1.getCourseId()); String[] submissionParams = new String[] { - ParamsNames.SUBMISSION_FEEDBACK, session1.getFeedbackSessionName(), - ParamsNames.SUBMISSION_COURSE, session1.getCourseId(), - ParamsNames.USER_ID, instructor1.getGoogleId(), + ParamsNames.FEEDBACK_SESSION_NAME, session1.getFeedbackSessionName(), + ParamsNames.COURSE_ID, session1.getCourseId(), + ParamsNames.INSTRUCTOR_ID, instructor1.getGoogleId(), }; FeedbackSessionRemindEmailWorkerAction action = getAction(submissionParams); @@ -63,7 +66,7 @@ public void allTests() throws Exception { logic.getGiverSetThatAnswerFeedbackSession(session1.getCourseId(), session1.getFeedbackSessionName()); List studentRecipientList = new ArrayList<>(); - for (StudentAttributes student : studentsLogic.getStudentsForCourse(session1.getCourseId())) { + for (StudentAttributes student : logic.getStudentsForCourse(session1.getCourseId())) { if (!giverSet.contains(student.getEmail())) { studentRecipientList.add(student.getEmail()); } @@ -71,25 +74,26 @@ public void allTests() throws Exception { List instructorRecipientList = new ArrayList<>(); List instructorNotifiedList = new ArrayList<>(); - for (InstructorAttributes instructor : instructorsLogic.getInstructorsForCourse(session1.getCourseId())) { + for (InstructorAttributes instructor : logic.getInstructorsForCourse(session1.getCourseId())) { if (!giverSet.contains(instructor.getEmail())) { instructorRecipientList.add(instructor.email); } } - instructorNotifiedList.add(instructorsLogic.getInstructorForGoogleId(session1.getCourseId(), + instructorNotifiedList.add(logic.getInstructorForGoogleId(session1.getCourseId(), instructor1.getGoogleId()).email); - String courseName = coursesLogic.getCourse(session1.getCourseId()).getName(); + String courseName = logic.getCourse(session1.getCourseId()).getName(); List tasksAdded = action.getTaskQueuer().getTasksAdded(); for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); assertEquals(String.format(EmailType.FEEDBACK_SESSION_REMINDER.getSubject(), courseName, session1.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); + email.getSubject()); String header = "The email below has been sent to students of course: [" + session1.getCourseId() + "]"; - String content = paramMap.get(ParamsNames.EMAIL_CONTENT)[0]; - String recipient = paramMap.get(ParamsNames.EMAIL_RECEIVER)[0]; + String content = email.getContent(); + String recipient = email.getRecipient(); if (content.contains(header)) { // notification to only requesting instructors assertTrue(instructorNotifiedList.contains(recipient)); diff --git a/src/test/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerActionTest.java new file mode 100644 index 00000000000..bbdd51034f4 --- /dev/null +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionRemindParticularUsersEmailWorkerActionTest.java @@ -0,0 +1,75 @@ +package teammates.ui.webapi; + +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.Const; +import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; +import teammates.common.util.TaskWrapper; +import teammates.ui.request.FeedbackSessionRemindRequest; +import teammates.ui.request.SendEmailRequest; + +/** + * SUT: {@link FeedbackSessionRemindParticularUsersEmailWorkerAction}. + */ +public class FeedbackSessionRemindParticularUsersEmailWorkerActionTest + extends BaseActionTest { + + @Override + protected String getActionUri() { + return Const.TaskQueue.FEEDBACK_SESSION_REMIND_PARTICULAR_USERS_EMAIL_WORKER_URL; + } + + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override + @Test + public void testExecute() { + + ______TS("Send feedback session reminder email"); + + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); + StudentAttributes student1 = typicalBundle.students.get("student1InCourse1"); + InstructorAttributes instructor1 = typicalBundle.instructors.get("instructor1OfCourse1"); + + String[] usersToRemind = new String[] { + student1.email, instructor1.email, "non-existent", + }; + + FeedbackSessionRemindRequest remindRequest = new FeedbackSessionRemindRequest(session1.getCourseId(), + session1.getFeedbackSessionName(), instructor1.googleId, usersToRemind); + + FeedbackSessionRemindParticularUsersEmailWorkerAction action = getAction(remindRequest); + action.execute(); + + // send 3 emails as specified in the submission parameters + verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 3); + + String courseName = logic.getCourse(session1.getCourseId()).getName(); + List tasksAdded = action.getTaskQueuer().getTasksAdded(); + for (TaskWrapper task : tasksAdded) { + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); + assertEquals(String.format(EmailType.FEEDBACK_SESSION_REMINDER.getSubject(), courseName, + session1.getFeedbackSessionName()), + email.getSubject()); + String recipient = email.getRecipient(); + assertTrue(recipient.equals(student1.email) || recipient.equals(instructor1.email)); + } + } + +} diff --git a/src/test/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerActionTest.java new file mode 100644 index 00000000000..1dbfa9bbc7e --- /dev/null +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionResendPublishedEmailWorkerActionTest.java @@ -0,0 +1,74 @@ +package teammates.ui.webapi; + +import java.util.List; + +import org.testng.annotations.Test; + +import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; +import teammates.common.datatransfer.attributes.InstructorAttributes; +import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.util.Const; +import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; +import teammates.common.util.TaskWrapper; +import teammates.ui.request.FeedbackSessionRemindRequest; +import teammates.ui.request.SendEmailRequest; + +/** + * SUT: {@link FeedbackSessionResendPublishedEmailWorkerAction}. + */ +public class FeedbackSessionResendPublishedEmailWorkerActionTest + extends BaseActionTest { + + @Override + protected String getActionUri() { + return Const.TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL; + } + + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override + @Test + public void testExecute() { + + ______TS("Resend feedback session results published email"); + + FeedbackSessionAttributes publishedSession = typicalBundle.feedbackSessions.get("closedSession"); + StudentAttributes student1 = typicalBundle.students.get("student1InCourse1"); + InstructorAttributes instructor1 = typicalBundle.instructors.get("instructor1OfCourse1"); + + String[] usersToRemind = new String[] { + student1.email, instructor1.email, "non-existent", + }; + + FeedbackSessionRemindRequest remindRequest = new FeedbackSessionRemindRequest(publishedSession.getCourseId(), + publishedSession.getFeedbackSessionName(), null, usersToRemind); + + FeedbackSessionResendPublishedEmailWorkerAction action = getAction(remindRequest); + action.execute(); + + // send 2 emails as specified in the submission parameters + verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 2); + + String courseName = logic.getCourse(publishedSession.getCourseId()).getName(); + List tasksAdded = action.getTaskQueuer().getTasksAdded(); + for (TaskWrapper task : tasksAdded) { + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); + assertEquals(String.format(EmailType.FEEDBACK_PUBLISHED.getSubject(), courseName, + publishedSession.getFeedbackSessionName()), email.getSubject()); + String recipient = email.getRecipient(); + assertTrue(recipient.equals(student1.email) || recipient.equals(instructor1.email)); + } + } + +} diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionUnpublishedEmailWorkerActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerActionTest.java similarity index 55% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionUnpublishedEmailWorkerActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerActionTest.java index d54e9d59198..a09bfbd360b 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionUnpublishedEmailWorkerActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionUnpublishedEmailWorkerActionTest.java @@ -1,7 +1,6 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import java.util.List; -import java.util.Map; import org.testng.annotations.Test; @@ -9,30 +8,40 @@ import teammates.common.util.Const; import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; +import teammates.common.util.EmailWrapper; import teammates.common.util.TaskWrapper; -import teammates.logic.core.CoursesLogic; -import teammates.ui.automated.FeedbackSessionUnpublishedEmailWorkerAction; +import teammates.ui.request.SendEmailRequest; /** * SUT: {@link FeedbackSessionUnpublishedEmailWorkerAction}. */ public class FeedbackSessionUnpublishedEmailWorkerActionTest - extends BaseAutomatedActionTest { - - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); + extends BaseActionTest { @Override protected String getActionUri() { return Const.TaskQueue.FEEDBACK_SESSION_UNPUBLISHED_EMAIL_WORKER_URL; } + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() { - FeedbackSessionAttributes session1 = dataBundle.feedbackSessions.get("session1InCourse1"); + public void testExecute() { + FeedbackSessionAttributes session1 = typicalBundle.feedbackSessions.get("session1InCourse1"); String[] submissionParams = new String[] { - ParamsNames.EMAIL_COURSE, session1.getCourseId(), - ParamsNames.EMAIL_FEEDBACK, session1.getFeedbackSessionName(), + ParamsNames.COURSE_ID, session1.getCourseId(), + ParamsNames.FEEDBACK_SESSION_NAME, session1.getFeedbackSessionName(), }; FeedbackSessionUnpublishedEmailWorkerAction action = getAction(submissionParams); @@ -41,13 +50,14 @@ public void allTests() { // 5 students and 5 instructors in course1 verifySpecifiedTasksAdded(action, Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 10); - String courseName = coursesLogic.getCourse(session1.getCourseId()).getName(); + String courseName = logic.getCourse(session1.getCourseId()).getName(); List tasksAdded = action.getTaskQueuer().getTasksAdded(); for (TaskWrapper task : tasksAdded) { - Map paramMap = task.getParamMap(); + SendEmailRequest requestBody = (SendEmailRequest) task.getRequestBody(); + EmailWrapper email = requestBody.getEmail(); assertEquals(String.format(EmailType.FEEDBACK_UNPUBLISHED.getSubject(), courseName, session1.getFeedbackSessionName()), - paramMap.get(ParamsNames.EMAIL_SUBJECT)[0]); + email.getSubject()); } } diff --git a/src/test/java/teammates/test/cases/automated/FeedbackSessionUpdateRespondentWorkerActionTest.java b/src/test/java/teammates/ui/webapi/FeedbackSessionUpdateRespondentWorkerActionTest.java similarity index 88% rename from src/test/java/teammates/test/cases/automated/FeedbackSessionUpdateRespondentWorkerActionTest.java rename to src/test/java/teammates/ui/webapi/FeedbackSessionUpdateRespondentWorkerActionTest.java index a3ad8132173..924e6a26596 100644 --- a/src/test/java/teammates/test/cases/automated/FeedbackSessionUpdateRespondentWorkerActionTest.java +++ b/src/test/java/teammates/ui/webapi/FeedbackSessionUpdateRespondentWorkerActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import java.util.Set; @@ -10,26 +10,37 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.util.Const; import teammates.common.util.Const.ParamsNames; -import teammates.ui.automated.FeedbackSessionUpdateRespondentWorkerAction; /** * SUT: {@link FeedbackSessionUpdateRespondentWorkerAction}. */ public class FeedbackSessionUpdateRespondentWorkerActionTest - extends BaseAutomatedActionTest { + extends BaseActionTest { @Override protected String getActionUri() { return Const.TaskQueue.FEEDBACK_SESSION_UPDATE_RESPONDENT_WORKER_URL; } + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() throws EntityDoesNotExistException { - FeedbackSessionAttributes session = dataBundle.feedbackSessions.get("session1InCourse1"); + public void testExecute() throws EntityDoesNotExistException { + FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); ______TS("typical case: new student respondent"); - StudentAttributes student = dataBundle.students.get("student4InCourse1"); + StudentAttributes student = typicalBundle.students.get("student4InCourse1"); verifyRespondentNotInSessionRespondentsList(session, student.email, false); @@ -48,7 +59,7 @@ public void allTests() throws EntityDoesNotExistException { ______TS("typical case: new instructor respondent"); - InstructorAttributes instructor = dataBundle.instructors.get("instructor2OfCourse1"); + InstructorAttributes instructor = typicalBundle.instructors.get("instructor2OfCourse1"); verifyRespondentNotInSessionRespondentsList(session, instructor.email, true); diff --git a/src/test/java/teammates/test/cases/webapi/GetAccountActionTest.java b/src/test/java/teammates/ui/webapi/GetAccountActionTest.java similarity index 91% rename from src/test/java/teammates/test/cases/webapi/GetAccountActionTest.java rename to src/test/java/teammates/ui/webapi/GetAccountActionTest.java index d91aa23d0cf..ef9643311b9 100644 --- a/src/test/java/teammates/test/cases/webapi/GetAccountActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetAccountActionTest.java @@ -1,14 +1,12 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetAccountAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.AccountData; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.AccountData; +import teammates.ui.output.MessageOutput; /** * SUT: {@link GetAccountAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetAuthInfoActionTest.java b/src/test/java/teammates/ui/webapi/GetAuthInfoActionTest.java similarity index 97% rename from src/test/java/teammates/test/cases/webapi/GetAuthInfoActionTest.java rename to src/test/java/teammates/ui/webapi/GetAuthInfoActionTest.java index 758a4e8a716..6d34216e1aa 100644 --- a/src/test/java/teammates/test/cases/webapi/GetAuthInfoActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetAuthInfoActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -13,9 +13,7 @@ import teammates.common.util.Const; import teammates.common.util.StringHelper; import teammates.logic.api.GateKeeper; -import teammates.ui.webapi.action.GetAuthInfoAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.AuthInfo; +import teammates.ui.output.AuthInfo; /** * SUT: {@link GetAuthInfoAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetCourseActionTest.java b/src/test/java/teammates/ui/webapi/GetCourseActionTest.java similarity index 97% rename from src/test/java/teammates/test/cases/webapi/GetCourseActionTest.java rename to src/test/java/teammates/ui/webapi/GetCourseActionTest.java index 1174b0125b0..6894c8d4fd8 100644 --- a/src/test/java/teammates/test/cases/webapi/GetCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetCourseActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -10,10 +10,8 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetCourseAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.CourseData; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.CourseData; +import teammates.ui.output.MessageOutput; /** * SUT: {@link GetCourseAction}. @@ -47,6 +45,7 @@ protected void testExecute_typicalUsage_shouldPass() { String[] params = { Const.ParamsNames.COURSE_ID, instructor1OfCourse1.getCourseId(), + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR, }; GetCourseAction getCourseAction = getAction(params); JsonResult response = getJsonResult(getCourseAction); @@ -66,6 +65,7 @@ protected void testExecute_typicalUsage_shouldPass() { params = new String[] { Const.ParamsNames.COURSE_ID, student1OfCourse1.getCourse(), + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.STUDENT, }; getCourseAction = getAction(params); response = getJsonResult(getCourseAction); diff --git a/src/test/java/teammates/test/cases/webapi/GetCourseJoinStatusActionTest.java b/src/test/java/teammates/ui/webapi/GetCourseJoinStatusActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetCourseJoinStatusActionTest.java rename to src/test/java/teammates/ui/webapi/GetCourseJoinStatusActionTest.java index 5d3f16210c8..5626bf79576 100644 --- a/src/test/java/teammates/test/cases/webapi/GetCourseJoinStatusActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetCourseJoinStatusActionTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.action.GetCourseJoinStatusAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.JoinStatus; +import teammates.ui.output.JoinStatus; /** * SUT: {@link GetCourseJoinStatusAction}. @@ -57,7 +55,7 @@ protected void testExecute() { JoinStatus output = (JoinStatus) result.getOutput(); assertTrue(output.getHasJoined()); - assertNull(output.getUserId()); + assertEquals("unreg.user", output.getUserId()); ______TS("Normal case: student is not registered"); @@ -107,7 +105,7 @@ protected void testExecute() { output = (JoinStatus) result.getOutput(); assertTrue(output.getHasJoined()); - assertNull(output.getUserId()); + assertEquals("unreg.user", output.getUserId()); ______TS("Normal case: instructor is not registered"); diff --git a/src/test/java/teammates/test/cases/webapi/GetCourseSectionNamesActionTest.java b/src/test/java/teammates/ui/webapi/GetCourseSectionNamesActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetCourseSectionNamesActionTest.java rename to src/test/java/teammates/ui/webapi/GetCourseSectionNamesActionTest.java index 8dc7f59caec..fdcd0ecd665 100644 --- a/src/test/java/teammates/test/cases/webapi/GetCourseSectionNamesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetCourseSectionNamesActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -9,9 +9,7 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetCourseSectionNamesAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.CourseSectionNamesData; +import teammates.ui.output.CourseSectionNamesData; /** * SUT: {@link GetCourseSectionNamesAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetCoursesActionTest.java b/src/test/java/teammates/ui/webapi/GetCoursesActionTest.java similarity index 90% rename from src/test/java/teammates/test/cases/webapi/GetCoursesActionTest.java rename to src/test/java/teammates/ui/webapi/GetCoursesActionTest.java index cf35f317c84..fe7b3008536 100644 --- a/src/test/java/teammates/test/cases/webapi/GetCoursesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetCoursesActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,10 +8,8 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetCoursesAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.CourseData; -import teammates.ui.webapi.output.CoursesData; +import teammates.ui.output.CourseData; +import teammates.ui.output.CoursesData; /** * SUT: {@link GetCoursesAction}. @@ -140,9 +138,9 @@ public void testGetCoursesAction_withStudentEntityType_shouldReturnCorrectCourse CourseAttributes expectedCourse2 = testData.courses.get("typicalCourse2"); CourseAttributes expectedCourse3 = testData.courses.get("typicalCourse4"); - verifySameCourseData(courses.getCourses().get(0), expectedCourse1); - verifySameCourseData(courses.getCourses().get(1), expectedCourse2); - verifySameCourseData(courses.getCourses().get(2), expectedCourse3); + verifySameCourseDataStudent(courses.getCourses().get(0), expectedCourse1); + verifySameCourseDataStudent(courses.getCourses().get(1), expectedCourse2); + verifySameCourseDataStudent(courses.getCourses().get(2), expectedCourse3); } private void verifySameCourseData(CourseData actualCourse, CourseAttributes expectedCourse) { @@ -155,6 +153,14 @@ private void verifySameCourseData(CourseData actualCourse, CourseAttributes expe assertEquals(actualCourse.getTimeZone(), expectedCourse.getTimeZone().getId()); } + private void verifySameCourseDataStudent(CourseData actualCourse, CourseAttributes expectedCourse) { + assertEquals(actualCourse.getCourseId(), expectedCourse.getId()); + assertEquals(actualCourse.getCourseName(), expectedCourse.getName()); + assertEquals(actualCourse.getCreationTimestamp(), 0); + assertEquals(actualCourse.getDeletionTimestamp(), 0); + assertEquals(actualCourse.getTimeZone(), expectedCourse.getTimeZone().getId()); + } + private void assertBadRequest(String... params) { GetCoursesAction action = getAction(params); JsonResult result = getJsonResult(action); diff --git a/src/test/java/teammates/test/cases/webapi/GetFeedbackQuestionRecipientsActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackQuestionRecipientsActionTest.java similarity index 98% rename from src/test/java/teammates/test/cases/webapi/GetFeedbackQuestionRecipientsActionTest.java rename to src/test/java/teammates/ui/webapi/GetFeedbackQuestionRecipientsActionTest.java index 586f1a07232..d859d266473 100644 --- a/src/test/java/teammates/test/cases/webapi/GetFeedbackQuestionRecipientsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackQuestionRecipientsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -12,10 +12,8 @@ import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.action.GetFeedbackQuestionRecipientsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackQuestionRecipientsData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackQuestionRecipientsData; +import teammates.ui.request.Intent; /** * SUT: {@link GetFeedbackQuestionRecipientsAction}. @@ -291,7 +289,8 @@ protected void testAccessControl_instructorSubmission() generateParameters(firstSessionInCourse1, 3, Intent.INSTRUCTOR_SUBMISSION, "", instructor1OfCourse1.email, ""); verifyOnlyInstructorsOfTheSameCourseWithCorrectCoursePrivilegeCanAccess( - Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION, moderatedInstructorSubmissionParams); + Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS, + moderatedInstructorSubmissionParams); ______TS("Instructor previews another instructor's question," + " should be accessible if he has privilege"); diff --git a/src/test/java/teammates/test/cases/webapi/GetFeedbackQuestionsActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackQuestionsActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetFeedbackQuestionsActionTest.java rename to src/test/java/teammates/ui/webapi/GetFeedbackQuestionsActionTest.java index b82b14abd0d..49babc5720f 100644 --- a/src/test/java/teammates/test/cases/webapi/GetFeedbackQuestionsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackQuestionsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -15,13 +15,11 @@ import teammates.common.datatransfer.questions.FeedbackMcqQuestionDetails; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.ui.webapi.action.GetFeedbackQuestionsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackQuestionData; -import teammates.ui.webapi.output.FeedbackQuestionsData; -import teammates.ui.webapi.output.FeedbackVisibilityType; -import teammates.ui.webapi.output.NumberOfEntitiesToGiveFeedbackToSetting; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackQuestionData; +import teammates.ui.output.FeedbackQuestionsData; +import teammates.ui.output.FeedbackVisibilityType; +import teammates.ui.output.NumberOfEntitiesToGiveFeedbackToSetting; +import teammates.ui.request.Intent; /** * SUT: {@link GetFeedbackQuestionsAction}. @@ -196,7 +194,7 @@ protected void testAccessControl() throws Exception { }; loginAsInstructor(instructor1OfCourse1.googleId); - verifyCannotAccess(params); + verifyEntityNotFound(params); ______TS("only instructors of the same course can access"); diff --git a/src/test/java/teammates/test/cases/webapi/GetFeedbackResponseCommentActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackResponseCommentActionTest.java similarity index 80% rename from src/test/java/teammates/test/cases/webapi/GetFeedbackResponseCommentActionTest.java rename to src/test/java/teammates/ui/webapi/GetFeedbackResponseCommentActionTest.java index 266f59c26fa..3c203c2e891 100644 --- a/src/test/java/teammates/test/cases/webapi/GetFeedbackResponseCommentActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackResponseCommentActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -13,10 +13,9 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetFeedbackResponseCommentAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackResponseCommentData; -import teammates.ui.webapi.request.Intent; +import teammates.common.util.StringHelper; +import teammates.ui.output.FeedbackResponseCommentData; +import teammates.ui.request.Intent; /** * SUT: {@link GetFeedbackResponseCommentAction}. @@ -74,11 +73,17 @@ protected void testExecute() { @Test protected void testExecute_notEnoughParameters_shouldFail() { - loginAsStudent(student1InCourse1.getGoogleId()); + loginAsInstructor(instructor1OfCourse1.getGoogleId()); verifyHttpParameterFailure(); - verifyHttpParameterFailure(Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId()); - verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString()); + verifyHttpParameterFailure(Const.ParamsNames.FEEDBACK_RESPONSE_ID, + StringHelper.encrypt(response1ForQ1.getId())); + verifyHttpParameterFailure(Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString()); + String[] submissionParams = new String[] { + Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + }; + verifyHttpParameterFailure(submissionParams); } @Test @@ -89,7 +94,7 @@ protected void testExecute_invalidIntent_shouldFail() { String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; verifyHttpParameterFailure(submissionParams); @@ -97,7 +102,7 @@ protected void testExecute_invalidIntent_shouldFail() { loginAsStudent(student1InCourse1.getGoogleId()); submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; verifyHttpParameterFailure(submissionParams); } @@ -111,13 +116,12 @@ protected void testExecute_typicalSuccessCase_shouldPass() { String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; FeedbackResponseCommentData actualComment = getFeedbackResponseComments(submissionParams); FeedbackResponseCommentAttributes expected = logic.getFeedbackResponseCommentForResponseFromParticipant(response1ForQ3.getId()); - assertNotNull(actualComment.getFeedbackResponseCommentId()); assertEquals(actualComment.getFeedbackCommentText(), expected.getCommentText()); assertEquals(actualComment.getCommentGiver(), expected.getCommentGiver()); @@ -131,25 +135,33 @@ protected void testExecute_typicalSuccessCase_shouldPass() { submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; actualComment = getFeedbackResponseComments(submissionParams); expected = logic.getFeedbackResponseCommentForResponseFromParticipant(response1ForQ1.getId()); - assertNotNull(actualComment.getFeedbackResponseCommentId()); assertEquals(actualComment.getFeedbackCommentText(), expected.getCommentText()); assertEquals(actualComment.getCommentGiver(), expected.getCommentGiver()); - ______TS("non-existent comment, should return 404"); + ______TS("non-existent comment in existing response, should return 204"); loginAsStudent(student1InCourse1.getGoogleId()); submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response2ForQ4.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response2ForQ4.getId()), }; GetFeedbackResponseCommentAction action = getAction(submissionParams); JsonResult actualResult = getJsonResult(action); - assertEquals(HttpStatus.SC_NOT_FOUND, actualResult.getStatusCode()); + assertEquals(HttpStatus.SC_NO_CONTENT, actualResult.getStatusCode()); + + ______TS("non-existent response, should return 404"); + + String[] nonExistentResponseSubmissionParams = new String[] { + Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt("randomresponseid"), + }; + + assertThrows(EntityNotFoundException.class, () -> getAction(nonExistentResponseSubmissionParams).execute()); } @Override @@ -166,7 +178,7 @@ protected void testAccessControl_typicalSuccessCase_shouldPass() { String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; verifyCanAccess(submissionParams); @@ -176,7 +188,7 @@ protected void testAccessControl_typicalSuccessCase_shouldPass() { submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; verifyCanAccess(submissionParams); } @@ -188,7 +200,7 @@ protected void testAccessControl_invalidIntent_shouldFail() { loginAsStudent(student1InCourse1.getGoogleId()); String[] studentInvalidIntentParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; assertThrows(InvalidHttpParameterException.class, () -> getAction(studentInvalidIntentParams).checkSpecificAccessControl()); @@ -197,7 +209,7 @@ protected void testAccessControl_invalidIntent_shouldFail() { loginAsInstructor(instructor1OfCourse1.getGoogleId()); String[] instructorInvalidIntentParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_RESULT.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; assertThrows(InvalidHttpParameterException.class, () -> getAction(instructorInvalidIntentParams).checkSpecificAccessControl()); @@ -209,7 +221,7 @@ protected void testAccessControl_responseNotExisting_shouldFail() { String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, "responseIdOfNonExistingResponse", + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt("responseIdOfNonExistingResponse"), }; assertThrows(EntityNotFoundException.class, () -> getAction(submissionParams).checkSpecificAccessControl()); @@ -222,7 +234,7 @@ protected void testAccessControl_accessAcrossCourses_shouldFail() { loginAsInstructor(instructor1OfCourse2.getGoogleId()); String[] submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ1.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ1.getId()), }; verifyCannotAccess(submissionParams); @@ -231,7 +243,7 @@ protected void testAccessControl_accessAcrossCourses_shouldFail() { loginAsStudent(student1InCourse2.getGoogleId()); submissionParams = new String[] { Const.ParamsNames.INTENT, Intent.INSTRUCTOR_SUBMISSION.toString(), - Const.ParamsNames.FEEDBACK_RESPONSE_ID, response1ForQ3.getId(), + Const.ParamsNames.FEEDBACK_RESPONSE_ID, StringHelper.encrypt(response1ForQ3.getId()), }; verifyCannotAccess(submissionParams); diff --git a/src/test/java/teammates/test/cases/webapi/GetFeedbackResponsesActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackResponsesActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetFeedbackResponsesActionTest.java rename to src/test/java/teammates/ui/webapi/GetFeedbackResponsesActionTest.java index 096c37c9e27..966cb954690 100644 --- a/src/test/java/teammates/test/cases/webapi/GetFeedbackResponsesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackResponsesActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -13,13 +13,13 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; +import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.ui.webapi.action.GetFeedbackResponsesAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackResponseData; -import teammates.ui.webapi.output.FeedbackResponsesData; -import teammates.ui.webapi.request.Intent; +import teammates.common.util.StringHelper; +import teammates.ui.output.FeedbackResponseData; +import teammates.ui.output.FeedbackResponsesData; +import teammates.ui.request.Intent; /** * SUT: {@link GetFeedbackResponsesAction}. @@ -85,7 +85,7 @@ protected void testExecute_invalidIntent_shouldFail() { } @Test - protected void testExecute_studentSubmission_shouldGetResponseSuccessfully() { + protected void testExecute_studentSubmission_shouldGetResponseSuccessfully() throws InvalidParametersException { loginAsStudent(student1InCourse1.getGoogleId()); String[] params = { @@ -104,7 +104,7 @@ protected void testExecute_studentSubmission_shouldGetResponseSuccessfully() { } @Test - protected void testExecute_instructorSubmission_shouldGetResponseSuccessfully() { + protected void testExecute_instructorSubmission_shouldGetResponseSuccessfully() throws InvalidParametersException { loginAsInstructor(instructor1OfCourse1.getGoogleId()); String[] params = { @@ -251,8 +251,9 @@ private FeedbackResponsesData getFeedbackResponse(String[] params) { return (FeedbackResponsesData) actualResult.getOutput(); } - private void verifyFeedbackResponseEquals(FeedbackResponseAttributes expected, FeedbackResponseData actual) { - assertEquals(expected.getId(), actual.getFeedbackResponseId()); + private void verifyFeedbackResponseEquals(FeedbackResponseAttributes expected, FeedbackResponseData actual) + throws InvalidParametersException { + assertEquals(expected.getId(), StringHelper.decrypt(actual.getFeedbackResponseId())); assertEquals(expected.getGiver(), actual.getGiverIdentifier()); assertEquals(expected.getRecipient(), actual.getRecipientIdentifier()); assertEquals(expected.getResponseDetails().getAnswerString(), actual.getResponseDetails().getAnswerString()); diff --git a/src/test/java/teammates/test/cases/webapi/GetFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackSessionActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/GetFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/GetFeedbackSessionActionTest.java index e7fbe3a41ea..0af5b667d5f 100644 --- a/src/test/java/teammates/test/cases/webapi/GetFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackSessionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -9,14 +9,12 @@ import teammates.common.exception.EntityDoesNotExistException; import teammates.common.exception.InvalidParametersException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetFeedbackSessionAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.output.FeedbackSessionPublishStatus; -import teammates.ui.webapi.output.FeedbackSessionSubmissionStatus; -import teammates.ui.webapi.output.ResponseVisibleSetting; -import teammates.ui.webapi.output.SessionVisibleSetting; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionPublishStatus; +import teammates.ui.output.FeedbackSessionSubmissionStatus; +import teammates.ui.output.ResponseVisibleSetting; +import teammates.ui.output.SessionVisibleSetting; +import teammates.ui.request.Intent; /** * SUT: {@link GetFeedbackSessionAction}. @@ -106,7 +104,7 @@ protected void testAccessControl() throws Exception { }; loginAsInstructor(instructor1OfCourse1.googleId); - verifyCannotAccess(submissionParams); + verifyEntityNotFound(submissionParams); ______TS("only instructors of the same course can access full detail"); @@ -209,21 +207,21 @@ protected void testAccessControl_instructorResult() throws InvalidParametersExce ______TS("Only instructor with correct privilege can access"); verifyOnlyInstructorsOfTheSameCourseWithCorrectCoursePrivilegeCanAccess( - Const.ParamsNames.INSTRUCTOR_PERMISSION_SUBMIT_SESSION_IN_SECTIONS, params + Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS, params ); ______TS("Instructor moderates instructor submission with correct privilege will pass"); InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); - params = generateParameters(feedbackSession, intent, "", instructor1OfCourse1.email, ""); + params = generateParameters(feedbackSession, Intent.INSTRUCTOR_SUBMISSION, "", instructor1OfCourse1.email, ""); verifyOnlyInstructorsOfTheSameCourseWithCorrectCoursePrivilegeCanAccess( - Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION, params); + Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS, params); ______TS("Instructor preview instructor result with correct privilege will pass"); String[] previewInstructorSubmissionParams = - generateParameters(feedbackSession, intent, + generateParameters(feedbackSession, Intent.INSTRUCTOR_SUBMISSION, "", "", instructor1OfCourse1.email); verifyOnlyInstructorsOfTheSameCourseWithCorrectCoursePrivilegeCanAccess( Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION, previewInstructorSubmissionParams); diff --git a/src/test/java/teammates/test/cases/webapi/GetFeedbackSessionSubmittedGiverSetActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackSessionSubmittedGiverSetActionTest.java similarity index 92% rename from src/test/java/teammates/test/cases/webapi/GetFeedbackSessionSubmittedGiverSetActionTest.java rename to src/test/java/teammates/ui/webapi/GetFeedbackSessionSubmittedGiverSetActionTest.java index 3cd688f9df2..0e45264ade4 100644 --- a/src/test/java/teammates/test/cases/webapi/GetFeedbackSessionSubmittedGiverSetActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackSessionSubmittedGiverSetActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -9,9 +9,7 @@ import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetFeedbackSessionSubmittedGiverSetAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackSessionSubmittedGiverSet; +import teammates.ui.output.FeedbackSessionSubmittedGiverSet; /** * SUT: {@link GetFeedbackSessionSubmittedGiverSetAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetFeedbackSessionsActionTest.java b/src/test/java/teammates/ui/webapi/GetFeedbackSessionsActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/GetFeedbackSessionsActionTest.java rename to src/test/java/teammates/ui/webapi/GetFeedbackSessionsActionTest.java index 88e5c1e4774..64c64bbb0e2 100644 --- a/src/test/java/teammates/test/cases/webapi/GetFeedbackSessionsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetFeedbackSessionsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.time.Instant; import java.util.ArrayList; @@ -11,13 +11,12 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetFeedbackSessionsAction; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.output.FeedbackSessionPublishStatus; -import teammates.ui.webapi.output.FeedbackSessionSubmissionStatus; -import teammates.ui.webapi.output.FeedbackSessionsData; -import teammates.ui.webapi.output.ResponseVisibleSetting; -import teammates.ui.webapi.output.SessionVisibleSetting; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionPublishStatus; +import teammates.ui.output.FeedbackSessionSubmissionStatus; +import teammates.ui.output.FeedbackSessionsData; +import teammates.ui.output.ResponseVisibleSetting; +import teammates.ui.output.SessionVisibleSetting; /** * SUT: {@link GetFeedbackSessionsAction}. @@ -286,6 +285,14 @@ private void assertInformationHiddenForStudent(FeedbackSessionData data) { assertNull(data.getCustomResponseVisibleTimestamp()); assertNull(data.getIsClosingEmailEnabled()); assertNull(data.getIsPublishedEmailEnabled()); + assertEquals(data.getCreatedAtTimestamp(), 0); + } + + private void assertInformationHidden(FeedbackSessionData data) { + assertNull(data.getGracePeriod()); + assertNull(data.getIsClosingEmailEnabled()); + assertNull(data.getIsPublishedEmailEnabled()); + assertEquals(data.getCreatedAtTimestamp(), 0); } private void assertPartialInformationMatch(FeedbackSessionData data, FeedbackSessionAttributes expectedSession) { @@ -308,12 +315,13 @@ private void assertPartialInformationMatch(FeedbackSessionData data, FeedbackSes assertEquals(FeedbackSessionSubmissionStatus.VISIBLE_NOT_OPEN, data.getSubmissionStatus()); } - assertEquals(expectedSession.getCreatedTime().toEpochMilli(), data.getCreatedAtTimestamp()); if (expectedSession.getDeletedTime() == null) { assertNull(data.getDeletedAtTimestamp()); } else { assertEquals(expectedSession.getDeletedTime().toEpochMilli(), data.getDeletedAtTimestamp().longValue()); } + + assertInformationHidden(data); } private void assertAllInformationMatch(FeedbackSessionData data, FeedbackSessionAttributes expectedSession) { diff --git a/src/test/java/teammates/test/cases/webapi/GetHasResponsesActionTest.java b/src/test/java/teammates/ui/webapi/GetHasResponsesActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/GetHasResponsesActionTest.java rename to src/test/java/teammates/ui/webapi/GetHasResponsesActionTest.java index 243eccefb86..abb0861650a 100644 --- a/src/test/java/teammates/test/cases/webapi/GetHasResponsesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetHasResponsesActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -10,11 +10,10 @@ import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; +import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetHasResponsesAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.HasResponsesData; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.HasResponsesData; +import teammates.ui.output.MessageOutput; /** * SUT: {@link GetHasResponsesAction}. @@ -225,11 +224,7 @@ protected void testExecute_asStudentWithFakeFeedbackSessionName_shouldFail() { }; GetHasResponsesAction getHasResponsesAction = getAction(params); - JsonResult jsonResult = getJsonResult(getHasResponsesAction); - MessageOutput messageOutput = (MessageOutput) jsonResult.getOutput(); - - assertEquals(HttpStatus.SC_NOT_FOUND, jsonResult.getStatusCode()); - assertEquals("No feedback session found with name: fake-session-name", messageOutput.getMessage()); + assertThrows(EntityNotFoundException.class, () -> getJsonResult(getHasResponsesAction)); } @Test diff --git a/src/test/java/teammates/test/cases/webapi/GetInstructorActionTest.java b/src/test/java/teammates/ui/webapi/GetInstructorActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/GetInstructorActionTest.java rename to src/test/java/teammates/ui/webapi/GetInstructorActionTest.java index 62861b30bf9..7f8f5edf3d6 100644 --- a/src/test/java/teammates/test/cases/webapi/GetInstructorActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetInstructorActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,11 +8,9 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetInstructorAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.InstructorData; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.Intent; /** * SUT: {@link GetInstructorAction}. @@ -59,6 +57,8 @@ protected void testExecute() throws Exception { assertEquals(HttpStatus.SC_OK, actionOutput.getStatusCode()); InstructorData response = (InstructorData) actionOutput.getOutput(); assertEquals(instructor1OfCourse1.name, response.getName()); + assertNull(response.getGoogleId()); + assertNull(response.getKey()); ______TS("Typical Success Case with FULL_DETAIL"); params = new String[] { diff --git a/src/test/java/teammates/test/cases/webapi/GetInstructorPrivilegeActionTest.java b/src/test/java/teammates/ui/webapi/GetInstructorPrivilegeActionTest.java similarity index 98% rename from src/test/java/teammates/test/cases/webapi/GetInstructorPrivilegeActionTest.java rename to src/test/java/teammates/ui/webapi/GetInstructorPrivilegeActionTest.java index 5db555d0588..f7acb45af10 100644 --- a/src/test/java/teammates/test/cases/webapi/GetInstructorPrivilegeActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetInstructorPrivilegeActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -9,11 +9,9 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetInstructorPrivilegeAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.InstructorPermissionRole; -import teammates.ui.webapi.output.InstructorPrivilegeData; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.InstructorPermissionRole; +import teammates.ui.output.InstructorPrivilegeData; +import teammates.ui.output.MessageOutput; /** * SUT: {@link GetInstructorPrivilegeAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetInstructorsActionTest.java b/src/test/java/teammates/ui/webapi/GetInstructorsActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetInstructorsActionTest.java rename to src/test/java/teammates/ui/webapi/GetInstructorsActionTest.java index 72a0429c9c9..14b47430d55 100644 --- a/src/test/java/teammates/test/cases/webapi/GetInstructorsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetInstructorsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -10,13 +10,11 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetInstructorsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.output.InstructorPermissionRole; -import teammates.ui.webapi.output.InstructorsData; -import teammates.ui.webapi.output.JoinState; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.InstructorData; +import teammates.ui.output.InstructorPermissionRole; +import teammates.ui.output.InstructorsData; +import teammates.ui.output.JoinState; +import teammates.ui.request.Intent; /** * SUT: {@link GetInstructorsAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetLocalDateTimeInfoActionTest.java b/src/test/java/teammates/ui/webapi/GetLocalDateTimeInfoActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetLocalDateTimeInfoActionTest.java rename to src/test/java/teammates/ui/webapi/GetLocalDateTimeInfoActionTest.java index 6d25a1ea6f8..206c4c9224c 100644 --- a/src/test/java/teammates/test/cases/webapi/GetLocalDateTimeInfoActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetLocalDateTimeInfoActionTest.java @@ -1,12 +1,10 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.testng.annotations.Test; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetLocalDateTimeInfoAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.LocalDateTimeInfo; +import teammates.ui.output.LocalDateTimeInfo; /** * SUT: {@link GetLocalDateTimeInfoAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetNationalitiesActionTest.java b/src/test/java/teammates/ui/webapi/GetNationalitiesActionTest.java similarity index 85% rename from src/test/java/teammates/test/cases/webapi/GetNationalitiesActionTest.java rename to src/test/java/teammates/ui/webapi/GetNationalitiesActionTest.java index 1b1f92c6289..7a01da60c19 100644 --- a/src/test/java/teammates/test/cases/webapi/GetNationalitiesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetNationalitiesActionTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.util.Const; import teammates.common.util.NationalityHelper; -import teammates.ui.webapi.action.GetNationalitiesAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.NationalitiesData; +import teammates.ui.output.NationalitiesData; /** * SUT: {@link GetNationalitiesAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetOngoingSessionsActionTest.java b/src/test/java/teammates/ui/webapi/GetOngoingSessionsActionTest.java similarity index 69% rename from src/test/java/teammates/test/cases/webapi/GetOngoingSessionsActionTest.java rename to src/test/java/teammates/ui/webapi/GetOngoingSessionsActionTest.java index 80b57509213..fdd5bfee4d9 100644 --- a/src/test/java/teammates/test/cases/webapi/GetOngoingSessionsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetOngoingSessionsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -9,9 +9,7 @@ import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetOngoingSessionsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.OngoingSessionsData; +import teammates.ui.output.OngoingSessionsData; /** * SUT: {@link GetOngoingSessionsAction}. @@ -43,16 +41,17 @@ protected void testExecute() throws Exception { verifyNoExistingSession(r); - ______TS("Typical use case"); + ______TS("Typical use case; one ongoing session, should be returned"); InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); String courseId = instructor1OfCourse1.courseId; + String feedbackSessionName = "new-session"; Instant startTime = Instant.now(); Instant endTime = Instant.now().plus(5, ChronoUnit.DAYS); logic.createFeedbackSession( - FeedbackSessionAttributes.builder("new-session", courseId) + FeedbackSessionAttributes.builder(feedbackSessionName, courseId) .withCreatorEmail(instructor1OfCourse1.email) .withStartTime(startTime) .withEndTime(endTime) @@ -77,6 +76,37 @@ protected void testExecute() throws Exception { assertEquals(1, response.getTotalOngoingSessions()); assertEquals(1, response.getTotalInstitutes()); assertEquals(1, response.getSessions().size()); + + ______TS("Typical use case; one future session, should not be returned"); + + startTime = Instant.now().minus(2, ChronoUnit.DAYS); + endTime = Instant.now().minus(1, ChronoUnit.DAYS); + + params = new String[] { + Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, String.valueOf(startTime.toEpochMilli()), + Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, String.valueOf(endTime.toEpochMilli()), + }; + + getOngoingSessionsAction = getAction(params); + r = getJsonResult(getOngoingSessionsAction); + + verifyNoExistingSession(r); + + ______TS("Typical use case; one past session, should not be returned"); + + startTime = Instant.now().plus(6, ChronoUnit.DAYS); + endTime = Instant.now().plus(7, ChronoUnit.DAYS); + + params = new String[] { + Const.ParamsNames.FEEDBACK_SESSION_STARTTIME, String.valueOf(startTime.toEpochMilli()), + Const.ParamsNames.FEEDBACK_SESSION_ENDTIME, String.valueOf(endTime.toEpochMilli()), + }; + + getOngoingSessionsAction = getAction(params); + r = getJsonResult(getOngoingSessionsAction); + + verifyNoExistingSession(r); + } @Override diff --git a/src/test/java/teammates/test/cases/webapi/GetRegkeyValidityActionTest.java b/src/test/java/teammates/ui/webapi/GetRegkeyValidityActionTest.java similarity index 72% rename from src/test/java/teammates/test/cases/webapi/GetRegkeyValidityActionTest.java rename to src/test/java/teammates/ui/webapi/GetRegkeyValidityActionTest.java index 92045cdd42e..6c7ad9b6045 100644 --- a/src/test/java/teammates/test/cases/webapi/GetRegkeyValidityActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetRegkeyValidityActionTest.java @@ -1,14 +1,12 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.ui.webapi.action.GetRegkeyValidityAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.RegkeyValidityData; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.RegkeyValidityData; +import teammates.ui.request.Intent; /** * SUT: {@link GetRegkeyValidityAction}. @@ -51,7 +49,7 @@ protected void testExecute() throws Exception { verifyHttpParameterFailure(params); - ______TS("Normal case: No logged in user for a used regkey; should be invalid"); + ______TS("Normal case: No logged in user for a used regkey; should be valid/used/disallowed"); gaeSimulation.logoutUser(); @@ -66,9 +64,11 @@ protected void testExecute() throws Exception { assertEquals(HttpStatus.SC_OK, r.getStatusCode()); RegkeyValidityData output = (RegkeyValidityData) r.getOutput(); - assertFalse(output.isValid()); + assertTrue(output.isValid()); + assertTrue(output.isUsed()); + assertFalse(output.isAllowedAccess()); - ______TS("Normal case: Wrong logged in user for a used regkey; should be invalid"); + ______TS("Normal case: Wrong logged in user for a used regkey; should be valid/used/disallowed"); loginAsStudent("student2InCourse1"); @@ -83,9 +83,11 @@ protected void testExecute() throws Exception { assertEquals(HttpStatus.SC_OK, r.getStatusCode()); output = (RegkeyValidityData) r.getOutput(); - assertFalse(output.isValid()); + assertTrue(output.isValid()); + assertTrue(output.isUsed()); + assertFalse(output.isAllowedAccess()); - ______TS("Normal case: Correct logged in user for a used regkey; should be valid"); + ______TS("Normal case: Correct logged in user for a used regkey; should be valid/used/allowed"); loginAsStudent("student1InCourse1"); @@ -96,8 +98,10 @@ protected void testExecute() throws Exception { output = (RegkeyValidityData) r.getOutput(); assertTrue(output.isValid()); + assertTrue(output.isUsed()); + assertTrue(output.isAllowedAccess()); - ______TS("Normal case: No logged in user for an unused regkey; should be valid"); + ______TS("Normal case: No logged in user for an unused regkey; should be valid/unused/allowed"); logic.resetStudentGoogleId("student1InCourse1@gmail.tmt", "idOfTypicalCourse1"); @@ -110,8 +114,10 @@ protected void testExecute() throws Exception { output = (RegkeyValidityData) r.getOutput(); assertTrue(output.isValid()); + assertFalse(output.isUsed()); + assertTrue(output.isAllowedAccess()); - ______TS("Normal case: Any logged in user for an unused regkey; should be valid"); + ______TS("Normal case: Any logged in user for an unused regkey; should be valid/unused/allowed"); loginAsStudent("student2InCourse1"); @@ -122,6 +128,8 @@ protected void testExecute() throws Exception { output = (RegkeyValidityData) r.getOutput(); assertTrue(output.isValid()); + assertFalse(output.isUsed()); + assertTrue(output.isAllowedAccess()); loginAsStudent("student3InCourse1"); @@ -132,8 +140,27 @@ protected void testExecute() throws Exception { output = (RegkeyValidityData) r.getOutput(); assertTrue(output.isValid()); + assertFalse(output.isUsed()); + assertTrue(output.isAllowedAccess()); + + ______TS("Normal case: Invalid regkey; should be invalid/unused/disallowed"); + + params = new String[] { + Const.ParamsNames.REGKEY, StringHelper.encrypt("invalid-key"), + Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.name(), + }; + + a = getAction(params); + r = getJsonResult(a); + + assertEquals(HttpStatus.SC_OK, r.getStatusCode()); + + output = (RegkeyValidityData) r.getOutput(); + assertFalse(output.isValid()); + assertFalse(output.isUsed()); + assertFalse(output.isAllowedAccess()); - ______TS("Normal case: Invalid intent; should be invalid"); + ______TS("Normal case: Invalid intent; should be invalid/unused/disallowed"); gaeSimulation.logoutUser(); @@ -149,6 +176,8 @@ protected void testExecute() throws Exception { output = (RegkeyValidityData) r.getOutput(); assertFalse(output.isValid()); + assertFalse(output.isUsed()); + assertFalse(output.isAllowedAccess()); } @Override diff --git a/src/test/java/teammates/test/cases/webapi/GetSessionResponseStatsActionTest.java b/src/test/java/teammates/ui/webapi/GetSessionResponseStatsActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/GetSessionResponseStatsActionTest.java rename to src/test/java/teammates/ui/webapi/GetSessionResponseStatsActionTest.java index 7b6ad3889fd..4ee98779fbc 100644 --- a/src/test/java/teammates/test/cases/webapi/GetSessionResponseStatsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetSessionResponseStatsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,9 +7,7 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetSessionResponseStatsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.FeedbackSessionStatsData; +import teammates.ui.output.FeedbackSessionStatsData; /** * SUT: {@link GetSessionResponseStatsAction}. diff --git a/src/test/java/teammates/test/cases/webapi/GetSessionResultsActionTest.java b/src/test/java/teammates/ui/webapi/GetSessionResultsActionTest.java similarity index 92% rename from src/test/java/teammates/test/cases/webapi/GetSessionResultsActionTest.java rename to src/test/java/teammates/ui/webapi/GetSessionResultsActionTest.java index b4b7b5fadbf..8c32e847ea2 100644 --- a/src/test/java/teammates/test/cases/webapi/GetSessionResultsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetSessionResultsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -13,10 +13,9 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.ui.webapi.action.GetSessionResultsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.SessionResultsData; -import teammates.ui.webapi.request.Intent; +import teammates.common.util.StringHelper; +import teammates.ui.output.SessionResultsData; +import teammates.ui.request.Intent; /** * SUT: {@link GetSessionResultsAction}. @@ -187,6 +186,24 @@ private boolean isResponseOutputEqual(SessionResultsData.ResponseOutput self, && self.getResponseDetails().getJsonString().equals(other.getResponseDetails().getJsonString()); } + @Test + public void testAccessControl_withRegistrationKey_shouldPass() { + CourseAttributes typicalCourse1 = typicalBundle.courses.get("typicalCourse1"); + FeedbackSessionAttributes feedbackSessionAttributes = typicalBundle.feedbackSessions.get("session1InCourse1"); + StudentAttributes student1 = typicalBundle.students.get("student1InCourse1"); + student1 = logic.getStudentForEmail(student1.course, student1.email); + + String[] submissionParams = new String[] { + Const.ParamsNames.COURSE_ID, typicalCourse1.getId(), + Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionAttributes.getFeedbackSessionName(), + Const.ParamsNames.INTENT, Intent.STUDENT_RESULT.toString(), + Const.ParamsNames.REGKEY, StringHelper.encrypt(student1.key), + }; + + publishSession(feedbackSessionAttributes.getFeedbackSessionName(), typicalCourse1.getId()); + verifyAccessibleForUnregisteredUsers(submissionParams); + } + @Test public void testAccessControl_withoutCorrectAuthInfoAccessStudentResult_shouldFail() { CourseAttributes typicalCourse1 = typicalBundle.courses.get("typicalCourse1"); diff --git a/src/test/java/teammates/test/cases/webapi/GetStudentActionTest.java b/src/test/java/teammates/ui/webapi/GetStudentActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetStudentActionTest.java rename to src/test/java/teammates/ui/webapi/GetStudentActionTest.java index d6803fdf0a2..83baca914c3 100644 --- a/src/test/java/teammates/test/cases/webapi/GetStudentActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetStudentActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,12 +8,9 @@ import teammates.common.exception.UnauthorizedAccessException; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.logic.core.StudentsLogic; -import teammates.ui.webapi.action.GetStudentAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.JoinState; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.output.StudentData; +import teammates.ui.output.JoinState; +import teammates.ui.output.MessageOutput; +import teammates.ui.output.StudentData; /** * SUT: {@link GetStudentAction}. @@ -32,6 +29,8 @@ protected String getRequestMethod() { private void assertStudentDataMatches(StudentData studentData, StudentAttributes student, boolean isRequestFromInstructor) { + assertNull(studentData.getGoogleId()); + assertNull(studentData.getKey()); assertEquals(student.getEmail(), studentData.getEmail()); assertEquals(student.getCourse(), studentData.getCourseId()); assertEquals(student.getName(), studentData.getName()); @@ -73,7 +72,7 @@ protected void testExecute() throws Exception { gaeSimulation.logoutUser(); StudentAttributes unregStudent = - StudentsLogic.inst().getStudentForEmail("idOfTypicalCourse1", "student1InCourse1@gmail.tmt"); + logic.getStudentForEmail("idOfTypicalCourse1", "student1InCourse1@gmail.tmt"); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, unregStudent.getCourse(), @@ -270,7 +269,7 @@ protected void testAccessControl() throws Exception { ______TS("Unregistered Student - can access with key"); StudentAttributes unregStudent = - StudentsLogic.inst().getStudentForEmail("idOfTypicalCourse1", "student1InCourse1@gmail.tmt"); + logic.getStudentForEmail("idOfTypicalCourse1", "student1InCourse1@gmail.tmt"); submissionParams = new String[] { Const.ParamsNames.COURSE_ID, unregStudent.getCourse(), diff --git a/src/test/java/teammates/test/cases/webapi/GetStudentProfileActionTest.java b/src/test/java/teammates/ui/webapi/GetStudentProfileActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/GetStudentProfileActionTest.java rename to src/test/java/teammates/ui/webapi/GetStudentProfileActionTest.java index fb16a5e183d..388b2b72c3f 100644 --- a/src/test/java/teammates/test/cases/webapi/GetStudentProfileActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetStudentProfileActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -9,10 +9,7 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.util.Const; -import teammates.logic.core.StudentsLogic; -import teammates.ui.webapi.action.GetStudentProfileAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.StudentProfileData; +import teammates.ui.output.StudentProfileData; /** * SUT: {@link GetStudentProfileAction}. @@ -93,7 +90,7 @@ public void testExecute_withProfileNotYetCreated_shouldReturnEmptyProfile() { } @Test - public void testExecute_getProfileOfUnregisteredStudent_shouldReturnNotFoundMessage() throws Exception { + public void testExecute_getProfileOfUnregisteredStudent_shouldReturnEmptyProfile() throws Exception { StudentAttributes student1InCourse1 = typicalBundle.students.get("student1InCourse1"); // Prepare an unregistered teammate StudentAttributes unregisteredStudentInCourse1 = @@ -104,15 +101,25 @@ public void testExecute_getProfileOfUnregisteredStudent_shouldReturnNotFoundMess .withSectionName(student1InCourse1.getSection()) .withTeamName(student1InCourse1.getTeam()) .build(); - StudentsLogic.inst().createStudent(unregisteredStudentInCourse1); + logic.createStudent(unregisteredStudentInCourse1); String[] submissionParams = new String[] { Const.ParamsNames.STUDENT_EMAIL, unregisteredStudentInCourse1.getEmail(), Const.ParamsNames.COURSE_ID, unregisteredStudentInCourse1.getCourse(), }; loginAsStudent(student1InCourse1.getGoogleId()); + StudentProfileAttributes expectedProfile = StudentProfileAttributes.builder("").build(); + GetStudentProfileAction action = getAction(submissionParams); JsonResult result = getJsonResult(action); - assertEquals(HttpStatus.SC_NOT_FOUND, result.getStatusCode()); + assertEquals(HttpStatus.SC_OK, result.getStatusCode()); + StudentProfileData actualProfile = (StudentProfileData) result.getOutput(); + assertEquals("unregistered student in course 1", actualProfile.getName()); + assertNull(actualProfile.getEmail()); + assertNull(expectedProfile.shortName, actualProfile.getShortName()); + assertEquals(expectedProfile.institute, actualProfile.getInstitute()); + assertEquals(expectedProfile.moreInfo, actualProfile.getMoreInfo()); + assertEquals(expectedProfile.nationality, actualProfile.getNationality()); + assertEquals(expectedProfile.gender, actualProfile.getGender()); } private void testGetCorrectProfile(StudentProfileAttributes expectedProfile, diff --git a/src/test/java/teammates/test/cases/webapi/GetStudentProfilePictureActionTest.java b/src/test/java/teammates/ui/webapi/GetStudentProfilePictureActionTest.java similarity index 87% rename from src/test/java/teammates/test/cases/webapi/GetStudentProfilePictureActionTest.java rename to src/test/java/teammates/ui/webapi/GetStudentProfilePictureActionTest.java index 4fb117be920..611c94dace6 100644 --- a/src/test/java/teammates/test/cases/webapi/GetStudentProfilePictureActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetStudentProfilePictureActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,10 +7,7 @@ import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.datatransfer.attributes.StudentProfileAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetStudentProfilePictureAction; -import teammates.ui.webapi.action.ImageResult; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link GetStudentProfilePictureAction}. @@ -42,7 +39,7 @@ public void testExecute() throws Exception { // check image key is the same as well StudentProfileAttributes student1Profile = logic.getStudentProfile(student1InCourse1.googleId); - assertEquals(student1Profile.pictureKey, imageResult.blobKey); + assertEquals(student1Profile.pictureKey, imageResult.getBlobKey()); ______TS("Success case: student passes in incomplete params but still gets his own image"); @@ -63,7 +60,7 @@ public void testExecute() throws Exception { imageResult = getImageResult(action); assertEquals(HttpStatus.SC_OK, imageResult.getStatusCode()); - assertEquals(student1Profile.pictureKey, imageResult.blobKey); + assertEquals(student1Profile.pictureKey, imageResult.getBlobKey()); ______TS("Success case: student gets his teammate's image"); StudentAttributes student2InCourse1 = typicalBundle.students.get("student2InCourse1"); @@ -79,7 +76,7 @@ public void testExecute() throws Exception { imageResult = getImageResult(action); assertEquals(HttpStatus.SC_OK, imageResult.getStatusCode()); - assertEquals(student1Profile.pictureKey, imageResult.blobKey); + assertEquals(student1Profile.pictureKey, imageResult.getBlobKey()); ______TS("Success case: instructor with privilege views image of his student"); gaeSimulation.logoutUser(); @@ -95,7 +92,7 @@ public void testExecute() throws Exception { imageResult = getImageResult(action); assertEquals(HttpStatus.SC_OK, imageResult.getStatusCode()); - assertEquals(student1Profile.pictureKey, imageResult.blobKey); + assertEquals(student1Profile.pictureKey, imageResult.getBlobKey()); ______TS("Failure case: requesting image of an unregistered student"); @@ -107,13 +104,11 @@ public void testExecute() throws Exception { }; action = getAction(submissionParams); - JsonResult jsonResult = getJsonResult(action); - MessageOutput message = (MessageOutput) jsonResult.getOutput(); + imageResult = getImageResult(action); - assertEquals(HttpStatus.SC_NOT_FOUND, jsonResult.getStatusCode()); - assertEquals(GetStudentProfilePictureAction.PROFILE_PIC_NOT_FOUND, message.getMessage()); + assertEquals(HttpStatus.SC_NO_CONTENT, imageResult.getStatusCode()); - ______TS("Failure case: requested student has no profile picture"); + ______TS("Success case: requested student has no profile picture"); submissionParams = new String[] { Const.ParamsNames.COURSE_ID, student2InCourse1.getCourse(), @@ -121,11 +116,24 @@ public void testExecute() throws Exception { }; action = getAction(submissionParams); - jsonResult = getJsonResult(action); - message = (MessageOutput) jsonResult.getOutput(); + imageResult = getImageResult(action); + + assertEquals(HttpStatus.SC_NO_CONTENT, imageResult.getStatusCode()); + + ______TS("Failure case: requesting image of a non-existing student"); + + submissionParams = new String[] { + Const.ParamsNames.COURSE_ID, student2InCourse1.getCourse(), + Const.ParamsNames.STUDENT_EMAIL, "non-existent@student.com", + }; + + action = getAction(submissionParams); + JsonResult jsonResult = getJsonResult(action); + MessageOutput message = (MessageOutput) jsonResult.getOutput(); assertEquals(HttpStatus.SC_NOT_FOUND, jsonResult.getStatusCode()); - assertEquals(GetStudentProfilePictureAction.PROFILE_PIC_NOT_FOUND, message.getMessage()); + assertEquals("No student found", message.getMessage()); + } @Test diff --git a/src/test/java/teammates/test/cases/webapi/GetStudentsActionTest.java b/src/test/java/teammates/ui/webapi/GetStudentsActionTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/GetStudentsActionTest.java rename to src/test/java/teammates/ui/webapi/GetStudentsActionTest.java index 84d90bdb0a5..83ca630c864 100644 --- a/src/test/java/teammates/test/cases/webapi/GetStudentsActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetStudentsActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -8,11 +8,9 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetStudentsAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.JoinState; -import teammates.ui.webapi.output.StudentData; -import teammates.ui.webapi.output.StudentsData; +import teammates.ui.output.JoinState; +import teammates.ui.output.StudentData; +import teammates.ui.output.StudentsData; /** * SUT: {@link GetStudentsAction}. @@ -57,6 +55,8 @@ public void testExecute_withOnlyCourseId_shouldReturnAllStudentsOfTheCourse() { assertEquals(5, students.size()); StudentData typicalStudent = students.get(0); + assertNull(typicalStudent.getGoogleId()); + assertNull(typicalStudent.getKey()); assertEquals("idOfTypicalCourse1", typicalStudent.getCourseId()); assertEquals("student1InCourse1@gmail.tmt", typicalStudent.getEmail()); assertEquals("student1 In Course1'\"", typicalStudent.getName()); @@ -85,6 +85,8 @@ public void testExecute_withCourseIdAndTeamName_shouldReturnAllStudentsOfTheTeam assertEquals(4, students.size()); StudentData typicalStudent = students.get(0); + assertNull(typicalStudent.getGoogleId()); + assertNull(typicalStudent.getKey()); assertEquals("idOfTypicalCourse1", typicalStudent.getCourseId()); assertEquals("student1InCourse1@gmail.tmt", typicalStudent.getEmail()); assertEquals("student1 In Course1'\"", typicalStudent.getName()); diff --git a/src/test/java/teammates/test/cases/webapi/GetTimeZonesActionTest.java b/src/test/java/teammates/ui/webapi/GetTimeZonesActionTest.java similarity index 91% rename from src/test/java/teammates/test/cases/webapi/GetTimeZonesActionTest.java rename to src/test/java/teammates/ui/webapi/GetTimeZonesActionTest.java index d9fb0928ba0..e510fd5fbd8 100644 --- a/src/test/java/teammates/test/cases/webapi/GetTimeZonesActionTest.java +++ b/src/test/java/teammates/ui/webapi/GetTimeZonesActionTest.java @@ -1,12 +1,10 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.util.Const; -import teammates.ui.webapi.action.GetTimeZonesAction; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.TimeZonesData; +import teammates.ui.output.TimeZonesData; /** * SUT: {@link GetTimeZonesAction}. diff --git a/src/test/java/teammates/test/cases/automated/InstructorCourseJoinEmailWorkerActionTest.java b/src/test/java/teammates/ui/webapi/InstructorCourseJoinEmailWorkerActionTest.java similarity index 79% rename from src/test/java/teammates/test/cases/automated/InstructorCourseJoinEmailWorkerActionTest.java rename to src/test/java/teammates/ui/webapi/InstructorCourseJoinEmailWorkerActionTest.java index 7997e2c5193..ce723cb54ef 100644 --- a/src/test/java/teammates/test/cases/automated/InstructorCourseJoinEmailWorkerActionTest.java +++ b/src/test/java/teammates/ui/webapi/InstructorCourseJoinEmailWorkerActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import org.testng.annotations.Test; @@ -9,26 +9,36 @@ import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; import teammates.common.util.EmailWrapper; -import teammates.logic.core.AccountsLogic; -import teammates.ui.automated.InstructorCourseJoinEmailWorkerAction; /** * SUT: {@link InstructorCourseJoinEmailWorkerAction}. */ public class InstructorCourseJoinEmailWorkerActionTest - extends BaseAutomatedActionTest { + extends BaseActionTest { @Override protected String getActionUri() { return Const.TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_WORKER_URL; } + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() { + public void testExecute() { - CourseAttributes course1 = dataBundle.courses.get("typicalCourse1"); - InstructorAttributes instr1InCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); - AccountAttributes inviter = AccountsLogic.inst().getAccount("idOfInstructor2OfCourse1"); + CourseAttributes course1 = typicalBundle.courses.get("typicalCourse1"); + InstructorAttributes instr1InCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); + AccountAttributes inviter = logic.getAccount("idOfInstructor2OfCourse1"); ______TS("typical case: new instructor joining"); diff --git a/src/test/java/teammates/test/cases/webapi/JoinCourseActionTest.java b/src/test/java/teammates/ui/webapi/JoinCourseActionTest.java similarity index 97% rename from src/test/java/teammates/test/cases/webapi/JoinCourseActionTest.java rename to src/test/java/teammates/ui/webapi/JoinCourseActionTest.java index cb6fb3c26b6..857ee2593dd 100644 --- a/src/test/java/teammates/test/cases/webapi/JoinCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/JoinCourseActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,8 +7,6 @@ import teammates.common.util.EmailType; import teammates.common.util.EmailWrapper; import teammates.common.util.StringHelper; -import teammates.ui.webapi.action.JoinCourseAction; -import teammates.ui.webapi.action.JsonResult; /** * SUT: {@link JoinCourseAction}. diff --git a/src/test/java/teammates/test/cases/webapi/JsonResultTest.java b/src/test/java/teammates/ui/webapi/JsonResultTest.java similarity index 86% rename from src/test/java/teammates/test/cases/webapi/JsonResultTest.java rename to src/test/java/teammates/ui/webapi/JsonResultTest.java index c3cbda2f1c4..683bead55e0 100644 --- a/src/test/java/teammates/test/cases/webapi/JsonResultTest.java +++ b/src/test/java/teammates/ui/webapi/JsonResultTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -8,10 +8,9 @@ import org.apache.http.HttpStatus; import org.testng.annotations.Test; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.MockHttpServletResponse; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.output.MessageOutput; +import teammates.test.BaseTestCase; +import teammates.test.MockHttpServletResponse; +import teammates.ui.output.MessageOutput; /** * SUT: {@link JsonResult}. diff --git a/src/test/java/teammates/test/cases/webapi/LegacyUrlMapperTest.java b/src/test/java/teammates/ui/webapi/LegacyUrlMapperTest.java similarity index 89% rename from src/test/java/teammates/test/cases/webapi/LegacyUrlMapperTest.java rename to src/test/java/teammates/ui/webapi/LegacyUrlMapperTest.java index abf499755b6..c367637bc9b 100644 --- a/src/test/java/teammates/test/cases/webapi/LegacyUrlMapperTest.java +++ b/src/test/java/teammates/ui/webapi/LegacyUrlMapperTest.java @@ -1,14 +1,13 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.client.methods.HttpGet; import org.testng.annotations.Test; import teammates.common.util.Config; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.MockHttpServletRequest; -import teammates.test.driver.MockHttpServletResponse; -import teammates.ui.webapi.action.LegacyUrlMapper; +import teammates.test.BaseTestCase; +import teammates.test.MockHttpServletRequest; +import teammates.test.MockHttpServletResponse; /** * SUT: {@link LegacyUrlMapper}. diff --git a/src/test/java/teammates/test/cases/webapi/OriginCheckFilterTest.java b/src/test/java/teammates/ui/webapi/OriginCheckFilterTest.java similarity index 94% rename from src/test/java/teammates/test/cases/webapi/OriginCheckFilterTest.java rename to src/test/java/teammates/ui/webapi/OriginCheckFilterTest.java index 004ad951f33..d13f7e0b89b 100644 --- a/src/test/java/teammates/test/cases/webapi/OriginCheckFilterTest.java +++ b/src/test/java/teammates/ui/webapi/OriginCheckFilterTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpGet; @@ -8,11 +8,10 @@ import teammates.common.util.Config; import teammates.common.util.Const; import teammates.common.util.StringHelper; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.MockFilterChain; -import teammates.test.driver.MockHttpServletRequest; -import teammates.test.driver.MockHttpServletResponse; -import teammates.ui.webapi.action.OriginCheckFilter; +import teammates.test.BaseTestCase; +import teammates.test.MockFilterChain; +import teammates.test.MockHttpServletRequest; +import teammates.test.MockHttpServletResponse; /** * SUT: {@link OriginCheckFilter}. diff --git a/src/test/java/teammates/test/cases/webapi/PostStudentProfilePictureActionTest.java b/src/test/java/teammates/ui/webapi/PostStudentProfilePictureActionTest.java similarity index 92% rename from src/test/java/teammates/test/cases/webapi/PostStudentProfilePictureActionTest.java rename to src/test/java/teammates/ui/webapi/PostStudentProfilePictureActionTest.java index 587d6141bff..ba79096e9ec 100644 --- a/src/test/java/teammates/test/cases/webapi/PostStudentProfilePictureActionTest.java +++ b/src/test/java/teammates/ui/webapi/PostStudentProfilePictureActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -6,9 +6,7 @@ import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.PostStudentProfilePictureAction; -import teammates.ui.webapi.output.StudentProfilePictureResults; +import teammates.ui.output.StudentProfilePictureResults; /** * SUT: {@link PostStudentProfilePictureAction}. diff --git a/src/test/java/teammates/test/cases/webapi/PublishFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/PublishFeedbackSessionActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/PublishFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/PublishFeedbackSessionActionTest.java index 3e62cc7d338..2fd6a1be9cf 100644 --- a/src/test/java/teammates/test/cases/webapi/PublishFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/PublishFeedbackSessionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -6,11 +6,9 @@ import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.PublishFeedbackSessionAction; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.output.FeedbackSessionPublishStatus; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionPublishStatus; +import teammates.ui.output.MessageOutput; /** * SUT: {@link PublishFeedbackSessionAction}. diff --git a/src/test/java/teammates/test/cases/webapi/RegenerateStudentCourseLinksActionTest.java b/src/test/java/teammates/ui/webapi/RegenerateStudentCourseLinksActionTest.java similarity index 94% rename from src/test/java/teammates/test/cases/webapi/RegenerateStudentCourseLinksActionTest.java rename to src/test/java/teammates/ui/webapi/RegenerateStudentCourseLinksActionTest.java index b16dbd5aee3..661ff6fc519 100644 --- a/src/test/java/teammates/test/cases/webapi/RegenerateStudentCourseLinksActionTest.java +++ b/src/test/java/teammates/ui/webapi/RegenerateStudentCourseLinksActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.BeforeMethod; @@ -8,10 +8,8 @@ import teammates.common.util.Const; import teammates.common.util.EmailType; import teammates.common.util.EmailWrapper; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.RegenerateStudentCourseLinksAction; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.output.RegenerateStudentCourseLinksData; +import teammates.ui.output.MessageOutput; +import teammates.ui.output.RegenerateStudentCourseLinksData; /** * SUT: {@link RegenerateStudentCourseLinksAction}. diff --git a/src/test/java/teammates/test/cases/webapi/RemindFeedbackSessionResultActionTest.java b/src/test/java/teammates/ui/webapi/RemindFeedbackSessionResultActionTest.java similarity index 84% rename from src/test/java/teammates/test/cases/webapi/RemindFeedbackSessionResultActionTest.java rename to src/test/java/teammates/ui/webapi/RemindFeedbackSessionResultActionTest.java index 50cb55346de..9f3b4fb7f13 100644 --- a/src/test/java/teammates/test/cases/webapi/RemindFeedbackSessionResultActionTest.java +++ b/src/test/java/teammates/ui/webapi/RemindFeedbackSessionResultActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,10 +7,8 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.RemindFeedbackSessionResultAction; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.FeedbackSessionStudentRemindRequest; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.FeedbackSessionRespondentRemindRequest; /** * SUT: {@link RemindFeedbackSessionResultAction}. @@ -33,6 +31,10 @@ protected void testExecute() throws Exception { InstructorAttributes instructor1ofCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("closedSession"); StudentAttributes studentToEmail = typicalBundle.students.get("student1InCourse1"); + InstructorAttributes instructorToEmail = typicalBundle.instructors.get("instructor2OfCourse1"); + String[] usersToRemind = new String[2]; + usersToRemind[0] = studentToEmail.getEmail(); + usersToRemind[1] = instructorToEmail.getEmail(); loginAsInstructor(instructor1ofCourse1.googleId); @@ -55,8 +57,8 @@ protected void testExecute() throws Exception { Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), }; - FeedbackSessionStudentRemindRequest remindRequest = new FeedbackSessionStudentRemindRequest(); - remindRequest.setUsersToRemind(studentToEmail.getEmail().split("")); + FeedbackSessionRespondentRemindRequest remindRequest = new FeedbackSessionRespondentRemindRequest(); + remindRequest.setUsersToRemind(usersToRemind); RemindFeedbackSessionResultAction action = getAction(remindRequest, paramsFeedbackSessionNotPublshed); JsonResult result = getJsonResult(action); @@ -87,11 +89,9 @@ protected void testExecute() throws Exception { @Override protected void testAccessControl() throws Exception { FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("closedSession"); - StudentAttributes studentNotSubmitFeedback = typicalBundle.students.get("student1InCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), - Const.ParamsNames.SUBMISSION_RESEND_PUBLISHED_EMAIL_USER_LIST, studentNotSubmitFeedback.getEmail(), }; verifyOnlyInstructorsOfTheSameCourseWithCorrectCoursePrivilegeCanAccess( diff --git a/src/test/java/teammates/test/cases/webapi/RemindFeedbackSessionSubmissionActionTest.java b/src/test/java/teammates/ui/webapi/RemindFeedbackSessionSubmissionActionTest.java similarity index 84% rename from src/test/java/teammates/test/cases/webapi/RemindFeedbackSessionSubmissionActionTest.java rename to src/test/java/teammates/ui/webapi/RemindFeedbackSessionSubmissionActionTest.java index aa3ff3a4801..c67dcfafb93 100644 --- a/src/test/java/teammates/test/cases/webapi/RemindFeedbackSessionSubmissionActionTest.java +++ b/src/test/java/teammates/ui/webapi/RemindFeedbackSessionSubmissionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,10 +7,8 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.RemindFeedbackSessionSubmissionAction; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.FeedbackSessionStudentRemindRequest; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.FeedbackSessionRespondentRemindRequest; /** * SUT: {@link RemindFeedbackSessionSubmissionAction}. @@ -33,6 +31,10 @@ protected void testExecute() throws Exception { InstructorAttributes instructor1ofCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1"); StudentAttributes studentNotSubmitFeedback = typicalBundle.students.get("student5InCourse1"); + InstructorAttributes instructorNotSubmitFeedback = typicalBundle.instructors.get("instructor2OfCourse1"); + String[] usersToRemind = new String[2]; + usersToRemind[0] = studentNotSubmitFeedback.getEmail(); + usersToRemind[1] = instructorNotSubmitFeedback.getEmail(); loginAsInstructor(instructor1ofCourse1.googleId); @@ -55,8 +57,8 @@ protected void testExecute() throws Exception { Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), }; - FeedbackSessionStudentRemindRequest remindRequest = new FeedbackSessionStudentRemindRequest(); - remindRequest.setUsersToRemind(studentNotSubmitFeedback.getEmail().split("")); + FeedbackSessionRespondentRemindRequest remindRequest = new FeedbackSessionRespondentRemindRequest(); + remindRequest.setUsersToRemind(usersToRemind); RemindFeedbackSessionSubmissionAction action = getAction(remindRequest, paramsFeedbackSessionNotOpen); JsonResult result = getJsonResult(action); @@ -86,11 +88,9 @@ protected void testExecute() throws Exception { @Override protected void testAccessControl() throws Exception { FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1"); - StudentAttributes studentNotSubmitFeedback = typicalBundle.students.get("student5InCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), - Const.ParamsNames.SUBMISSION_REMIND_USERLIST, studentNotSubmitFeedback.getEmail(), }; verifyOnlyInstructorsOfTheSameCourseWithCorrectCoursePrivilegeCanAccess( diff --git a/src/test/java/teammates/test/cases/webapi/ResetAccountActionTest.java b/src/test/java/teammates/ui/webapi/ResetAccountActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/ResetAccountActionTest.java rename to src/test/java/teammates/ui/webapi/ResetAccountActionTest.java index 91116b12287..04a2d8e6b9f 100644 --- a/src/test/java/teammates/test/cases/webapi/ResetAccountActionTest.java +++ b/src/test/java/teammates/ui/webapi/ResetAccountActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -6,9 +6,7 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.ResetAccountAction; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link ResetAccountAction}. diff --git a/src/test/java/teammates/test/cases/webapi/RestoreCourseActionTest.java b/src/test/java/teammates/ui/webapi/RestoreCourseActionTest.java similarity index 87% rename from src/test/java/teammates/test/cases/webapi/RestoreCourseActionTest.java rename to src/test/java/teammates/ui/webapi/RestoreCourseActionTest.java index eda73c18731..cfa86e9cb62 100644 --- a/src/test/java/teammates/test/cases/webapi/RestoreCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/RestoreCourseActionTest.java @@ -1,15 +1,13 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; +import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.NullHttpParameterException; import teammates.common.util.Const; -import teammates.storage.api.CoursesDb; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.RestoreCourseAction; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link RestoreCourseAction}. @@ -57,7 +55,9 @@ public void testExecute() throws Exception { }; logic.moveCourseToRecycleBin(courseId); - assertEquals(courseId, logic.getSoftDeletedCourseForInstructor(instructor1OfCourse1).getId()); + CourseAttributes deletedCourse = logic.getCourse(courseId); + assertNotNull(deletedCourse); + assertTrue(deletedCourse.isCourseDeleted()); action = getAction(submissionParams); result = getJsonResult(action); @@ -83,10 +83,8 @@ public void testExecute() throws Exception { }; action = getAction(nonExistentCourse); result = getJsonResult(action); - message = (MessageOutput) result.getOutput(); assertEquals(HttpStatus.SC_NOT_FOUND, result.getStatusCode()); - assertEquals(CoursesDb.ERROR_UPDATE_NON_EXISTENT, message.getMessage()); } @Override diff --git a/src/test/java/teammates/test/cases/webapi/RestoreFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/RestoreFeedbackSessionActionTest.java similarity index 94% rename from src/test/java/teammates/test/cases/webapi/RestoreFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/RestoreFeedbackSessionActionTest.java index 18a69865379..ab3f325e1fd 100644 --- a/src/test/java/teammates/test/cases/webapi/RestoreFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/RestoreFeedbackSessionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,9 +8,7 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.NullHttpParameterException; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.RestoreFeedbackSessionAction; -import teammates.ui.webapi.output.FeedbackSessionData; +import teammates.ui.output.FeedbackSessionData; /** * SUT: {@link RestoreFeedbackSessionAction}. diff --git a/src/test/java/teammates/test/cases/webapi/SearchCommentsActionTest.java b/src/test/java/teammates/ui/webapi/SearchCommentsActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/SearchCommentsActionTest.java rename to src/test/java/teammates/ui/webapi/SearchCommentsActionTest.java index 7c2da649a3f..427bd39b316 100644 --- a/src/test/java/teammates/test/cases/webapi/SearchCommentsActionTest.java +++ b/src/test/java/teammates/ui/webapi/SearchCommentsActionTest.java @@ -1,12 +1,10 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.testng.annotations.Test; import teammates.common.datatransfer.DataBundle; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.SearchCommentsAction; -import teammates.ui.webapi.output.CommentSearchResultsData; +import teammates.ui.output.CommentSearchResultsData; /** * SUT:{@link SearchCommentsAction}. diff --git a/src/test/java/teammates/test/cases/webapi/SearchInstructorsActionTest.java b/src/test/java/teammates/ui/webapi/SearchInstructorsActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/SearchInstructorsActionTest.java rename to src/test/java/teammates/ui/webapi/SearchInstructorsActionTest.java index 75bf30b91ab..233de95a82c 100644 --- a/src/test/java/teammates/test/cases/webapi/SearchInstructorsActionTest.java +++ b/src/test/java/teammates/ui/webapi/SearchInstructorsActionTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.testng.annotations.Test; import teammates.common.datatransfer.DataBundle; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.SearchInstructorsAction; -import teammates.ui.webapi.output.InstructorsData; +import teammates.ui.output.InstructorsData; /** * SUT: {@link SearchInstructorsAction}. diff --git a/src/test/java/teammates/test/cases/webapi/SearchStudentsActionTest.java b/src/test/java/teammates/ui/webapi/SearchStudentsActionTest.java similarity index 73% rename from src/test/java/teammates/test/cases/webapi/SearchStudentsActionTest.java rename to src/test/java/teammates/ui/webapi/SearchStudentsActionTest.java index 627a5e36c14..b7203655f69 100644 --- a/src/test/java/teammates/test/cases/webapi/SearchStudentsActionTest.java +++ b/src/test/java/teammates/ui/webapi/SearchStudentsActionTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.testng.annotations.Test; import teammates.common.datatransfer.DataBundle; import teammates.common.datatransfer.attributes.StudentAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.SearchStudentsAction; -import teammates.ui.webapi.output.StudentsData; +import teammates.ui.output.StudentsData; /** * SUT:{@link SearchStudentsAction}. @@ -37,9 +35,35 @@ protected void testExecute() { } @Test - public void execute_notEnoughParameters_parameterFailure() { + public void execute_invalidParameters_parameterFailure() { loginAsAdmin(); verifyHttpParameterFailure(); + + String[] notEnoughParams = new String[] { + Const.ParamsNames.SEARCH_KEY, "dummy", + }; + verifyHttpParameterFailure(notEnoughParams); + + String[] invalidEntityParams = new String[] { + Const.ParamsNames.SEARCH_KEY, "dummy", + Const.ParamsNames.ENTITY_TYPE, "dummy", + }; + verifyHttpParameterFailure(invalidEntityParams); + + String[] adminParams = new String[] { + Const.ParamsNames.SEARCH_KEY, "dummy", + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.ADMIN, + }; + String[] instructorParams = new String[] { + Const.ParamsNames.SEARCH_KEY, "dummy", + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR, + }; + + loginAsAdmin(); + verifyHttpParameterFailure(instructorParams); + + loginAsInstructor("idOfInstructor1OfCourse1"); + verifyHttpParameterFailure(adminParams); } @Test @@ -48,6 +72,7 @@ public void execute_adminSearchName_success() { loginAsAdmin(); String[] accNameParams = new String[] { Const.ParamsNames.SEARCH_KEY, acc.getName(), + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.ADMIN, }; SearchStudentsAction a = getAction(accNameParams); JsonResult result = getJsonResult(a); @@ -61,6 +86,7 @@ public void execute_adminSearchCourseId_success() { loginAsAdmin(); String[] accCourseIdParams = new String[] { Const.ParamsNames.SEARCH_KEY, acc.getCourse(), + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.ADMIN, }; SearchStudentsAction a = getAction(accCourseIdParams); JsonResult result = getJsonResult(a); @@ -73,6 +99,7 @@ public void execute_adminSearchAccountsGeneral_success() { loginAsAdmin(); String[] accNameParams = new String[] { Const.ParamsNames.SEARCH_KEY, "Course2", + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.ADMIN, }; SearchStudentsAction a = getAction(accNameParams); JsonResult result = getJsonResult(a); @@ -87,6 +114,7 @@ public void execute_adminSearchEmail_success() { StudentAttributes acc = typicalBundle.students.get("student1InCourse1"); String[] emailParams = new String[] { Const.ParamsNames.SEARCH_KEY, acc.getEmail(), + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.ADMIN, }; SearchStudentsAction a = getAction(emailParams); @@ -101,6 +129,7 @@ public void execute_adminSearchNoMatch_noMatch() { loginAsAdmin(); String[] accNameParams = new String[] { Const.ParamsNames.SEARCH_KEY, "minuscoronavirus", + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.ADMIN, }; SearchStudentsAction a = getAction(accNameParams); JsonResult result = getJsonResult(a); @@ -114,6 +143,7 @@ public void execute_adminSearchGoogleId_success() { loginAsAdmin(); String[] googleIdParams = new String[] { Const.ParamsNames.SEARCH_KEY, "Course", + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.ADMIN, }; SearchStudentsAction a = getAction(googleIdParams); JsonResult result = getJsonResult(a); @@ -127,6 +157,7 @@ public void execute_instructorSearchGoogleId_matchOnlyStudentsInCourse() { loginAsInstructor("idOfInstructor1OfCourse1"); String[] googleIdParams = new String[] { Const.ParamsNames.SEARCH_KEY, "Course", + Const.ParamsNames.ENTITY_TYPE, Const.EntityType.INSTRUCTOR, }; SearchStudentsAction a = getAction(googleIdParams); diff --git a/src/test/java/teammates/test/cases/webapi/SendErrorReportActionTest.java b/src/test/java/teammates/ui/webapi/SendErrorReportActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/SendErrorReportActionTest.java rename to src/test/java/teammates/ui/webapi/SendErrorReportActionTest.java index 83b4917f715..a6a9d6dba52 100644 --- a/src/test/java/teammates/test/cases/webapi/SendErrorReportActionTest.java +++ b/src/test/java/teammates/ui/webapi/SendErrorReportActionTest.java @@ -1,13 +1,11 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.SendErrorReportAction; -import teammates.ui.webapi.request.ErrorReportRequest; +import teammates.ui.request.ErrorReportRequest; /** * SUT: {@link SendErrorReportAction}. diff --git a/src/test/java/teammates/test/cases/webapi/SendJoinReminderEmailActionTest.java b/src/test/java/teammates/ui/webapi/SendJoinReminderEmailActionTest.java similarity index 90% rename from src/test/java/teammates/test/cases/webapi/SendJoinReminderEmailActionTest.java rename to src/test/java/teammates/ui/webapi/SendJoinReminderEmailActionTest.java index d03a99ba75a..3b4048198ac 100644 --- a/src/test/java/teammates/test/cases/webapi/SendJoinReminderEmailActionTest.java +++ b/src/test/java/teammates/ui/webapi/SendJoinReminderEmailActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; import java.util.Map; @@ -11,10 +11,7 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.util.Const; import teammates.common.util.TaskWrapper; -import teammates.logic.core.StudentsLogic; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.SendJoinReminderEmailAction; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link SendJoinReminderEmailActionTest}. @@ -63,9 +60,9 @@ protected void testExecute() throws Exception { verifySpecifiedTasksAdded(sendJoinReminderEmailAction, Const.TaskQueue.INSTRUCTOR_COURSE_JOIN_EMAIL_QUEUE_NAME, 1); TaskWrapper taskAdded = sendJoinReminderEmailAction.getTaskQueuer().getTasksAdded().get(0); - Map paramMap = taskAdded.getParamMap(); - assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)[0]); - assertEquals(anotherInstructorOfCourse1.email, paramMap.get(Const.ParamsNames.INSTRUCTOR_EMAIL)[0]); + Map paramMap = taskAdded.getParamMap(); + assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)); + assertEquals(anotherInstructorOfCourse1.email, paramMap.get(Const.ParamsNames.INSTRUCTOR_EMAIL)); ______TS("Typical case: Send email to remind a student to register for the course"); @@ -87,8 +84,8 @@ protected void testExecute() throws Exception { taskAdded = sendJoinReminderEmailAction.getTaskQueuer().getTasksAdded().get(0); paramMap = taskAdded.getParamMap(); - assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)[0]); - assertEquals(student1InCourse1.email, paramMap.get(Const.ParamsNames.STUDENT_EMAIL)[0]); + assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)); + assertEquals(student1InCourse1.email, paramMap.get(Const.ParamsNames.STUDENT_EMAIL)); ______TS("Masquerade mode: Send emails to all unregistered student to remind registering for the course"); @@ -107,12 +104,12 @@ protected void testExecute() throws Exception { .withTeamName("Team Unregistered") .withComment("") .build(); - StudentsLogic.inst().createStudent(unregisteredStudent1); - StudentsLogic.inst().createStudent(unregisteredStudent2); + logic.createStudent(unregisteredStudent1); + logic.createStudent(unregisteredStudent2); /* Reassign the attributes to retrieve their keys */ - unregisteredStudent1 = StudentsLogic.inst().getStudentForEmail(courseId, unregisteredStudent1.email); - unregisteredStudent2 = StudentsLogic.inst().getStudentForEmail(courseId, unregisteredStudent2.email); + unregisteredStudent1 = logic.getStudentForEmail(courseId, unregisteredStudent1.email); + unregisteredStudent2 = logic.getStudentForEmail(courseId, unregisteredStudent2.email); submissionParams = new String[] { Const.ParamsNames.COURSE_ID, courseId, @@ -131,11 +128,11 @@ protected void testExecute() throws Exception { List tasksAdded = sendJoinReminderEmailAction.getTaskQueuer().getTasksAdded(); for (TaskWrapper task : tasksAdded) { paramMap = task.getParamMap(); - assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)[0]); + assertEquals(courseId, paramMap.get(Const.ParamsNames.COURSE_ID)); } - StudentsLogic.inst().deleteStudentCascade(courseId, unregisteredStudent1.email); - StudentsLogic.inst().deleteStudentCascade(courseId, unregisteredStudent2.email); + logic.deleteStudentCascade(courseId, unregisteredStudent1.email); + logic.deleteStudentCascade(courseId, unregisteredStudent2.email); ______TS("Typical case: no unregistered students in course"); diff --git a/src/test/java/teammates/test/cases/webapi/SessionLinksRecoveryActionTest.java b/src/test/java/teammates/ui/webapi/SessionLinksRecoveryActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/SessionLinksRecoveryActionTest.java rename to src/test/java/teammates/ui/webapi/SessionLinksRecoveryActionTest.java index 84f87b13174..977702a0a15 100644 --- a/src/test/java/teammates/test/cases/webapi/SessionLinksRecoveryActionTest.java +++ b/src/test/java/teammates/ui/webapi/SessionLinksRecoveryActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,10 +7,8 @@ import teammates.common.util.Const; import teammates.common.util.EmailType; import teammates.common.util.EmailWrapper; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.SessionLinksRecoveryAction; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.output.SessionLinksRecoveryResponseData; +import teammates.ui.output.MessageOutput; +import teammates.ui.output.SessionLinksRecoveryResponseData; /** * SUT: {@link SessionLinksRecoveryAction}. diff --git a/src/test/java/teammates/test/cases/automated/StudentCourseJoinEmailWorkerActionTest.java b/src/test/java/teammates/ui/webapi/StudentCourseJoinEmailWorkerActionTest.java similarity index 81% rename from src/test/java/teammates/test/cases/automated/StudentCourseJoinEmailWorkerActionTest.java rename to src/test/java/teammates/ui/webapi/StudentCourseJoinEmailWorkerActionTest.java index 9d56163b9d1..fe904f8ca10 100644 --- a/src/test/java/teammates/test/cases/automated/StudentCourseJoinEmailWorkerActionTest.java +++ b/src/test/java/teammates/ui/webapi/StudentCourseJoinEmailWorkerActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.automated; +package teammates.ui.webapi; import org.testng.annotations.Test; @@ -8,23 +8,34 @@ import teammates.common.util.Const.ParamsNames; import teammates.common.util.EmailType; import teammates.common.util.EmailWrapper; -import teammates.ui.automated.StudentCourseJoinEmailWorkerAction; /** * SUT: {@link StudentCourseJoinEmailWorkerAction}. */ -public class StudentCourseJoinEmailWorkerActionTest extends BaseAutomatedActionTest { +public class StudentCourseJoinEmailWorkerActionTest extends BaseActionTest { @Override protected String getActionUri() { return Const.TaskQueue.STUDENT_COURSE_JOIN_EMAIL_WORKER_URL; } + @Override + protected String getRequestMethod() { + return POST; + } + + @Override + @Test + protected void testAccessControl() throws Exception { + verifyOnlyAdminCanAccess(); + } + + @Override @Test - public void allTests() { + public void testExecute() { - CourseAttributes course1 = dataBundle.courses.get("typicalCourse1"); - StudentAttributes stu1InCourse1 = dataBundle.students.get("student1InCourse1"); + CourseAttributes course1 = typicalBundle.courses.get("typicalCourse1"); + StudentAttributes stu1InCourse1 = typicalBundle.students.get("student1InCourse1"); ______TS("typical case: new student joining"); diff --git a/src/test/java/teammates/test/cases/webapi/StudentsEnrollRequestTest.java b/src/test/java/teammates/ui/webapi/StudentsEnrollRequestTest.java similarity index 95% rename from src/test/java/teammates/test/cases/webapi/StudentsEnrollRequestTest.java rename to src/test/java/teammates/ui/webapi/StudentsEnrollRequestTest.java index 2d5b17cba88..76bc793cd50 100644 --- a/src/test/java/teammates/test/cases/webapi/StudentsEnrollRequestTest.java +++ b/src/test/java/teammates/ui/webapi/StudentsEnrollRequestTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -8,8 +8,8 @@ import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.test.cases.BaseTestCase; -import teammates.ui.webapi.request.StudentsEnrollRequest; +import teammates.test.BaseTestCase; +import teammates.ui.request.StudentsEnrollRequest; /** * SUT: {@link StudentsEnrollRequest}. diff --git a/src/test/java/teammates/test/cases/webapi/UnpublishFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/UnpublishFeedbackSessionActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/UnpublishFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/UnpublishFeedbackSessionActionTest.java index 0bfac923cf0..043589c696a 100644 --- a/src/test/java/teammates/test/cases/webapi/UnpublishFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/UnpublishFeedbackSessionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -7,9 +7,7 @@ import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UnpublishFeedbackSessionAction; -import teammates.ui.webapi.output.MessageOutput; +import teammates.ui.output.MessageOutput; /** * SUT: {@link UnpublishFeedbackSessionAction}. @@ -95,7 +93,7 @@ protected void testAccessControl() throws Exception { Const.ParamsNames.FEEDBACK_SESSION_NAME, session1InCourse1.getFeedbackSessionName(), }; - verifyCannotAccess(nonExistParams); + verifyEntityNotFound(nonExistParams); ______TS("non-existent feedback session"); @@ -104,7 +102,7 @@ protected void testAccessControl() throws Exception { Const.ParamsNames.FEEDBACK_SESSION_NAME, "abcRandomSession", }; - verifyCannotAccess(nonExistParams); + verifyEntityNotFound(nonExistParams); ______TS("accessible only for instructor with ModifySessionPrivilege"); diff --git a/src/test/java/teammates/test/cases/webapi/UpdateCourseActionTest.java b/src/test/java/teammates/ui/webapi/UpdateCourseActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/UpdateCourseActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateCourseActionTest.java index 263240acf22..acf1129fe5d 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateCourseActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateCourseActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -10,11 +10,9 @@ import teammates.common.exception.NullHttpParameterException; import teammates.common.util.Const; import teammates.common.util.FieldValidator; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateCourseAction; -import teammates.ui.webapi.output.CourseData; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.CourseUpdateRequest; +import teammates.ui.output.CourseData; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.CourseUpdateRequest; /** * SUT: {@link UpdateCourseAction}. diff --git a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackQuestionActionTest.java b/src/test/java/teammates/ui/webapi/UpdateFeedbackQuestionActionTest.java similarity index 92% rename from src/test/java/teammates/test/cases/webapi/UpdateFeedbackQuestionActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateFeedbackQuestionActionTest.java index d79bce25971..a93d2f39c98 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackQuestionActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateFeedbackQuestionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -8,7 +8,6 @@ import teammates.common.datatransfer.DataBundle; import teammates.common.datatransfer.FeedbackParticipantType; -import teammates.common.datatransfer.FeedbackSessionDetailsBundle; import teammates.common.datatransfer.attributes.FeedbackQuestionAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; import teammates.common.datatransfer.attributes.InstructorAttributes; @@ -19,13 +18,10 @@ import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; import teammates.common.util.JsonUtils; -import teammates.storage.api.FeedbackResponsesDb; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateFeedbackQuestionAction; -import teammates.ui.webapi.output.FeedbackQuestionData; -import teammates.ui.webapi.output.FeedbackVisibilityType; -import teammates.ui.webapi.output.NumberOfEntitiesToGiveFeedbackToSetting; -import teammates.ui.webapi.request.FeedbackQuestionUpdateRequest; +import teammates.ui.output.FeedbackQuestionData; +import teammates.ui.output.FeedbackVisibilityType; +import teammates.ui.output.NumberOfEntitiesToGiveFeedbackToSetting; +import teammates.ui.request.FeedbackQuestionUpdateRequest; /** * SUT: {@link UpdateFeedbackQuestionAction}. @@ -86,7 +82,7 @@ protected void testExecute() throws Exception { assertEquals(JsonUtils.toJson(typicalQuestion.getQuestionDetails()), JsonUtils.toJson(response.getQuestionDetails())); assertEquals(800, ((FeedbackTextQuestionDetails) - typicalQuestion.getQuestionDetails()).getRecommendedLength()); + typicalQuestion.getQuestionDetails()).getRecommendedLength().intValue()); assertEquals(typicalQuestion.getGiverType(), typicalQuestion.getGiverType()); assertEquals(FeedbackParticipantType.STUDENTS, typicalQuestion.getGiverType()); @@ -209,12 +205,11 @@ public void testExecute_editingContributionTypeQuestion_shouldUpdateSuccessfully FeedbackSessionAttributes fs = dataBundle.feedbackSessions.get("contribSession"); FeedbackQuestionAttributes fq = logic.getFeedbackQuestion(fs.getFeedbackSessionName(), fs.getCourseId(), 1); - FeedbackResponsesDb frDb = new FeedbackResponsesDb(); ______TS("Edit text won't delete response"); // There are already responses for this question - assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty()); + assertFalse(logic.getFeedbackResponsesForQuestion(fq.getId()).isEmpty()); FeedbackQuestionUpdateRequest updateRequest = getTypicalContributionQuestionUpdateRequest(); updateRequest.setQuestionNumber(fq.getQuestionNumber()); @@ -231,7 +226,7 @@ public void testExecute_editingContributionTypeQuestion_shouldUpdateSuccessfully assertEquals(HttpStatus.SC_OK, r.getStatusCode()); // All existing responses should remain - assertFalse(frDb.getFeedbackResponsesForQuestion(fq.getId()).isEmpty()); + assertFalse(logic.getFeedbackResponsesForQuestion(fq.getId()).isEmpty()); ______TS("Edit: Invalid recipient type"); @@ -297,8 +292,7 @@ public void testExecute_invalidRecommendedLength_shouldThrowException() { logic.getFeedbackQuestion(typicalQuestion.getId()).getQuestionDescription()); // recommended length does not change - assertEquals(0, ((FeedbackTextQuestionDetails) typicalQuestion.getQuestionDetails()) - .getRecommendedLength()); + assertNull(((FeedbackTextQuestionDetails) typicalQuestion.getQuestionDetails()).getRecommendedLength()); } @Test @@ -344,10 +338,10 @@ public void testExecute_differentScenarios_shouldUpdateResponseRateCorrectly() t ______TS("Check response rate before editing question 1"); fs = logic.getFeedbackSession(fs.getFeedbackSessionName(), fs.getCourseId()); - FeedbackSessionDetailsBundle details = - logic.getFeedbackSessionDetails(fs.getFeedbackSessionName(), fs.getCourseId()); - assertEquals(numStudentRespondents + numInstructorRespondents, details.stats.submittedTotal); - assertEquals(totalStudents + totalInstructors, details.stats.expectedTotal); + int submittedTotal = logic.getActualTotalSubmission(fs); + int expectedTotal = logic.getExpectedTotalSubmission(fs); + assertEquals(numStudentRespondents + numInstructorRespondents, submittedTotal); + assertEquals(totalStudents + totalInstructors, expectedTotal); ______TS("Change the feedback path of a question with no unique respondents, " + "response rate should not be updated"); @@ -372,9 +366,10 @@ public void testExecute_differentScenarios_shouldUpdateResponseRateCorrectly() t // Response rate should decrease by 1 as response from student1 in qn1 is changed numStudentRespondents--; fs = logic.getFeedbackSession(fs.getFeedbackSessionName(), fs.getCourseId()); - details = logic.getFeedbackSessionDetails(fs.getFeedbackSessionName(), fs.getCourseId()); - assertEquals(numStudentRespondents + numInstructorRespondents, details.stats.submittedTotal); - assertEquals(totalStudents + totalInstructors, details.stats.expectedTotal); + submittedTotal = logic.getActualTotalSubmission(fs); + expectedTotal = logic.getExpectedTotalSubmission(fs); + assertEquals(numStudentRespondents + numInstructorRespondents, submittedTotal); + assertEquals(totalStudents + totalInstructors, expectedTotal); ______TS("Change the feedback path of a question with a unique instructor respondent, " + "response rate changed"); @@ -393,9 +388,10 @@ public void testExecute_differentScenarios_shouldUpdateResponseRateCorrectly() t // Response rate should decrease by 1 because the response of the unique instructor respondent is deleted fs = logic.getFeedbackSession(fs.getFeedbackSessionName(), fs.getCourseId()); - details = logic.getFeedbackSessionDetails(fs.getFeedbackSessionName(), fs.getCourseId()); - assertEquals(numStudentRespondents, details.stats.submittedTotal); - assertEquals(totalStudents + totalInstructors, details.stats.expectedTotal); + submittedTotal = logic.getActualTotalSubmission(fs); + expectedTotal = logic.getExpectedTotalSubmission(fs); + assertEquals(numStudentRespondents, submittedTotal); + assertEquals(totalStudents + totalInstructors, expectedTotal); ______TS("Change the feedback path of a question so that some possible respondents are removed"); @@ -414,9 +410,10 @@ public void testExecute_differentScenarios_shouldUpdateResponseRateCorrectly() t // Total possible respondents should decrease because instructors // (except session creator) are no longer possible respondents fs = logic.getFeedbackSession(fs.getFeedbackSessionName(), fs.getCourseId()); - details = logic.getFeedbackSessionDetails(fs.getFeedbackSessionName(), fs.getCourseId()); - assertEquals(numStudentRespondents, details.stats.submittedTotal); - assertEquals(totalStudents + 1, details.stats.expectedTotal); + submittedTotal = logic.getActualTotalSubmission(fs); + expectedTotal = logic.getExpectedTotalSubmission(fs); + assertEquals(numStudentRespondents, submittedTotal); + assertEquals(totalStudents + 1, expectedTotal); } private FeedbackQuestionUpdateRequest getTypicalTextQuestionUpdateRequest() { diff --git a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackResponseCommentActionTest.java b/src/test/java/teammates/ui/webapi/UpdateFeedbackResponseCommentActionTest.java similarity index 98% rename from src/test/java/teammates/test/cases/webapi/UpdateFeedbackResponseCommentActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateFeedbackResponseCommentActionTest.java index 14d9e02c649..82d2c080367 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackResponseCommentActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateFeedbackResponseCommentActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.Arrays; @@ -19,13 +19,10 @@ import teammates.common.exception.EntityNotFoundException; import teammates.common.exception.InvalidHttpParameterException; import teammates.common.util.Const; -import teammates.logic.core.FeedbackSessionsLogic; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateFeedbackResponseCommentAction; -import teammates.ui.webapi.output.CommentVisibilityType; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.FeedbackResponseCommentUpdateRequest; -import teammates.ui.webapi.request.Intent; +import teammates.ui.output.CommentVisibilityType; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.FeedbackResponseCommentUpdateRequest; +import teammates.ui.request.Intent; /** * SUT: {@link UpdateFeedbackResponseCommentAction}. @@ -327,7 +324,7 @@ protected void testExecute_typicalCasePublishedSession_shouldPass() throws Excep loginAsInstructor(instructor1OfCourse1.getGoogleId()); - FeedbackSessionsLogic.inst().publishFeedbackSession( + logic.publishFeedbackSession( comment1FromInstructor1Q2.feedbackSessionName, comment1FromInstructor1Q2.courseId); String[] submissionParams = new String[] { diff --git a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackSessionActionTest.java b/src/test/java/teammates/ui/webapi/UpdateFeedbackSessionActionTest.java similarity index 96% rename from src/test/java/teammates/test/cases/webapi/UpdateFeedbackSessionActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateFeedbackSessionActionTest.java index 02910524b2a..0ba86eda911 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateFeedbackSessionActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateFeedbackSessionActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.time.ZoneId; @@ -10,12 +10,10 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateFeedbackSessionAction; -import teammates.ui.webapi.output.FeedbackSessionData; -import teammates.ui.webapi.output.ResponseVisibleSetting; -import teammates.ui.webapi.output.SessionVisibleSetting; -import teammates.ui.webapi.request.FeedbackSessionUpdateRequest; +import teammates.ui.output.FeedbackSessionData; +import teammates.ui.output.ResponseVisibleSetting; +import teammates.ui.output.SessionVisibleSetting; +import teammates.ui.request.FeedbackSessionUpdateRequest; /** * SUT: {@link UpdateFeedbackSessionAction}. @@ -258,7 +256,7 @@ protected void testAccessControl() throws Exception { }; loginAsInstructor(instructor1OfCourse1.googleId); - verifyCannotAccess(submissionParams); + verifyEntityNotFound(submissionParams); ______TS("inaccessible without ModifySessionPrivilege"); diff --git a/src/test/java/teammates/test/cases/webapi/UpdateInstructorActionTest.java b/src/test/java/teammates/ui/webapi/UpdateInstructorActionTest.java similarity index 91% rename from src/test/java/teammates/test/cases/webapi/UpdateInstructorActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateInstructorActionTest.java index 7fb221bec91..f5d77150bba 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateInstructorActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateInstructorActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.testng.annotations.Test; @@ -8,19 +8,14 @@ import teammates.common.exception.NullHttpParameterException; import teammates.common.util.Const; import teammates.common.util.FieldValidator; -import teammates.logic.core.CoursesLogic; -import teammates.logic.core.InstructorsLogic; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateInstructorAction; -import teammates.ui.webapi.output.InstructorData; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.InstructorCreateRequest; +import teammates.ui.output.InstructorData; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.InstructorCreateRequest; /** * SUT: {@link UpdateInstructorAction}. */ public class UpdateInstructorActionTest extends BaseActionTest { - private final InstructorsLogic instructorsLogic = InstructorsLogic.inst(); @Override protected String getActionUri() { @@ -60,7 +55,7 @@ protected void testExecute() { InstructorData response = (InstructorData) actionOutput.getOutput(); - InstructorAttributes editedInstructor = instructorsLogic.getInstructorForGoogleId(courseId, instructorId); + InstructorAttributes editedInstructor = logic.getInstructorForGoogleId(courseId, instructorId); assertEquals(newInstructorName, editedInstructor.name); assertEquals(newInstructorName, response.getName()); assertEquals(newInstructorEmail, editedInstructor.email); @@ -117,14 +112,14 @@ protected void testExecute() { response = (InstructorData) actionOutput.getOutput(); - editedInstructor = instructorsLogic.getInstructorForGoogleId(courseId, instructorId); + editedInstructor = logic.getInstructorForGoogleId(courseId, instructorId); assertEquals(newInstructorEmail, editedInstructor.email); assertEquals(newInstructorEmail, response.getEmail()); assertEquals(newInstructorName, editedInstructor.name); assertEquals(newInstructorName, response.getName()); //remove the new instructor entity that was created - CoursesLogic.inst().deleteCourseCascade("icieat.courseId"); + logic.deleteCourseCascade("icieat.courseId"); ______TS("Unsuccessful case: test null course id parameter"); diff --git a/src/test/java/teammates/test/cases/webapi/UpdateInstructorPrivilegeActionTest.java b/src/test/java/teammates/ui/webapi/UpdateInstructorPrivilegeActionTest.java similarity index 98% rename from src/test/java/teammates/test/cases/webapi/UpdateInstructorPrivilegeActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateInstructorPrivilegeActionTest.java index fc27bfb5384..c25445ec48e 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateInstructorPrivilegeActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateInstructorPrivilegeActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; import java.util.stream.Collectors; @@ -9,11 +9,9 @@ import teammates.common.datatransfer.attributes.InstructorAttributes; import teammates.common.exception.InvalidHttpRequestBodyException; import teammates.common.util.Const; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateInstructorPrivilegeAction; -import teammates.ui.webapi.output.InstructorPrivilegeData; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.InstructorPrivilegeUpdateRequest; +import teammates.ui.output.InstructorPrivilegeData; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.InstructorPrivilegeUpdateRequest; /** * SUT: {@link UpdateInstructorPrivilegeAction}. diff --git a/src/test/java/teammates/test/cases/webapi/UpdateStudentActionTest.java b/src/test/java/teammates/ui/webapi/UpdateStudentActionTest.java similarity index 94% rename from src/test/java/teammates/test/cases/webapi/UpdateStudentActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateStudentActionTest.java index 806e2caa611..62cd2ee5d54 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateStudentActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateStudentActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.List; @@ -11,21 +11,15 @@ import teammates.common.util.EmailType; import teammates.common.util.EmailWrapper; import teammates.common.util.FieldValidator; -import teammates.logic.core.AccountsLogic; -import teammates.logic.core.CoursesLogic; -import teammates.test.driver.StringHelperExtension; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateStudentAction; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.StudentUpdateRequest; +import teammates.common.util.StringHelperExtension; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.StudentUpdateRequest; /** * SUT: {@link UpdateStudentAction}. */ public class UpdateStudentActionTest extends BaseActionTest { - private static final CoursesLogic coursesLogic = CoursesLogic.inst(); - @Override protected String getActionUri() { return Const.ResourceURIs.STUDENT; @@ -83,7 +77,7 @@ public void testExecute() throws Exception { verifyNumberOfEmailsSent(updateAction, 1); EmailWrapper email = getEmailsSent(updateAction).get(0); - String courseName = coursesLogic.getCourse(instructor1OfCourse1.courseId).getName(); + String courseName = logic.getCourse(instructor1OfCourse1.courseId).getName(); assertEquals(String.format(EmailType.STUDENT_EMAIL_CHANGED.getSubject(), courseName, instructor1OfCourse1.courseId), email.getSubject()); assertEquals(newStudentEmail, email.getRecipient()); @@ -155,8 +149,8 @@ public void testExecute() throws Exception { assertEquals("Trying to update to an email that is already in use", invalidParamsOutput.getMessage()); // deleting edited student - AccountsLogic.inst().deleteAccountCascade(student2InCourse1.googleId); - AccountsLogic.inst().deleteAccountCascade(student1InCourse1.googleId); + logic.deleteAccountCascade(student2InCourse1.googleId); + logic.deleteAccountCascade(student1InCourse1.googleId); ______TS("Error case, student does not exist"); @@ -209,7 +203,7 @@ public void testExecute_withSectionAlreadyHasMaxNumberOfStudents_shouldFail() th String sectionInMaxCapacity = "sectionInMaxCapacity"; StudentAttributes studentToJoinMaxSection = StudentAttributes - .builder(courseId, "studentToJoinMaxSection@com") + .builder(courseId, "studentToJoinMaxSection@test.com") .withName("studentToJoinMaxSection ") .withSectionName("RandomUniqueSection") .withTeamName("RandomUniqueTeamName") @@ -220,7 +214,7 @@ public void testExecute_withSectionAlreadyHasMaxNumberOfStudents_shouldFail() th for (int i = 0; i < Const.StudentsLogicConst.SECTION_SIZE_LIMIT; i++) { StudentAttributes addedStudent = StudentAttributes - .builder(courseId, i + "email@com") + .builder(courseId, i + "email@test.com") .withName("Name " + i) .withSectionName(sectionInMaxCapacity) .withTeamName("Team " + i) diff --git a/src/test/java/teammates/test/cases/webapi/UpdateStudentProfileActionTest.java b/src/test/java/teammates/ui/webapi/UpdateStudentProfileActionTest.java similarity index 93% rename from src/test/java/teammates/test/cases/webapi/UpdateStudentProfileActionTest.java rename to src/test/java/teammates/ui/webapi/UpdateStudentProfileActionTest.java index e495d43fccf..fdfe15d4d2f 100644 --- a/src/test/java/teammates/test/cases/webapi/UpdateStudentProfileActionTest.java +++ b/src/test/java/teammates/ui/webapi/UpdateStudentProfileActionTest.java @@ -1,4 +1,4 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import java.util.ArrayList; import java.util.List; @@ -10,10 +10,8 @@ import teammates.common.util.Const; import teammates.common.util.FieldValidator; import teammates.common.util.SanitizationHelper; -import teammates.ui.webapi.action.JsonResult; -import teammates.ui.webapi.action.UpdateStudentProfileAction; -import teammates.ui.webapi.output.MessageOutput; -import teammates.ui.webapi.request.StudentProfileUpdateRequest; +import teammates.ui.output.MessageOutput; +import teammates.ui.request.StudentProfileUpdateRequest; /** * SUT: {@link UpdateStudentProfileAction}. @@ -96,25 +94,25 @@ private void testActionWithScriptInjection(AccountAttributes student) throws Exc expectedErrorMessages.add( getPopulatedErrorMessage(FieldValidator.INVALID_NAME_ERROR_MESSAGE, - SanitizationHelper.sanitizeForHtml(req.getShortName()), + req.getShortName(), FieldValidator.PERSON_NAME_FIELD_NAME, FieldValidator.REASON_CONTAINS_INVALID_CHAR, FieldValidator.PERSON_NAME_MAX_LENGTH)); expectedErrorMessages.add( getPopulatedErrorMessage(FieldValidator.EMAIL_ERROR_MESSAGE, - SanitizationHelper.sanitizeForHtml(req.getEmail()), + req.getEmail(), FieldValidator.EMAIL_FIELD_NAME, FieldValidator.REASON_INCORRECT_FORMAT, FieldValidator.EMAIL_MAX_LENGTH)); expectedErrorMessages.add( getPopulatedErrorMessage(FieldValidator.INVALID_NAME_ERROR_MESSAGE, - SanitizationHelper.sanitizeForHtml(req.getInstitute()), + req.getInstitute(), FieldValidator.INSTITUTE_NAME_FIELD_NAME, FieldValidator.REASON_START_WITH_NON_ALPHANUMERIC_CHAR, FieldValidator.INSTITUTE_NAME_MAX_LENGTH)); expectedErrorMessages.add( String.format(FieldValidator.NATIONALITY_ERROR_MESSAGE, - SanitizationHelper.sanitizeForHtml(req.getNationality()))); + req.getNationality())); assertEquals(String.join(System.lineSeparator(), expectedErrorMessages), invalidOutput.getMessage()); } diff --git a/src/test/java/teammates/ui/webapi/WebApiServletTest.java b/src/test/java/teammates/ui/webapi/WebApiServletTest.java new file mode 100644 index 00000000000..e95e20c63cf --- /dev/null +++ b/src/test/java/teammates/ui/webapi/WebApiServletTest.java @@ -0,0 +1,222 @@ +package teammates.ui.webapi; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.http.HttpStatus; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.testng.annotations.Test; + +import com.google.appengine.api.datastore.DatastoreTimeoutException; +import com.google.apphosting.api.DeadlineExceededException; + +import teammates.common.exception.EntityNotFoundException; +import teammates.common.exception.InvalidHttpParameterException; +import teammates.common.exception.UnauthorizedAccessException; +import teammates.common.util.Const; +import teammates.test.BaseTestCaseWithObjectifyAccess; +import teammates.test.MockHttpServletRequest; +import teammates.test.MockHttpServletResponse; + +/** + * SUT: {@link WebApiServlet}. + */ +public class WebApiServletTest extends BaseTestCaseWithObjectifyAccess { + + private static final WebApiServlet SERVLET = new WebApiServlet(); + + private MockHttpServletRequest mockRequest; + private MockHttpServletResponse mockResponse; + + private void setupMocks(String method, String requestUrl) { + mockRequest = new MockHttpServletRequest(method, requestUrl); + mockResponse = new MockHttpServletResponse(); + } + + private void setupMocksFromGaeQueue(String method, String requestUrl) { + Map> headers = new HashMap<>(); + headers.put("X-AppEngine-QueueName", Collections.singletonList("queuename")); + mockRequest = new MockHttpServletRequest(method, requestUrl, headers); + mockResponse = new MockHttpServletResponse(); + } + + @Test + public void testUserInvokedRequests() throws Exception { + + ______TS("Typical case: valid action mapping"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, "NoException"); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_OK, mockResponse.getStatus()); + + ______TS("Failure case: invalid action mapping"); + + setupMocks(HttpGet.METHOD_NAME, "nonexistent"); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_NOT_FOUND, mockResponse.getStatus()); + + setupMocks(HttpPost.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, mockResponse.getStatus()); + + ______TS("Failure case: NullHttpParameterException"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_BAD_REQUEST, mockResponse.getStatus()); + + ______TS("Failure case: InvalidHttpParameterException"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, InvalidHttpParameterException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_BAD_REQUEST, mockResponse.getStatus()); + + ______TS("Failure case: DeadlineExceededException"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, DeadlineExceededException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); + + ______TS("Failure case: DatastoreTimeoutException"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, DatastoreTimeoutException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); + + ______TS("Failure case: UnauthorizedAccessException"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, UnauthorizedAccessException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_FORBIDDEN, mockResponse.getStatus()); + + ______TS("Failure case: EntityNotFoundException"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, EntityNotFoundException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_NOT_FOUND, mockResponse.getStatus()); + + ______TS("Failure case: NullPointerException"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, NullPointerException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); + + ______TS("Failure case: AssertionError"); + + setupMocks(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, AssertionError.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); + + } + + @Test + public void testGaeQueueInvokedRequests() throws Exception { + + ______TS("Typical case: valid action mapping"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, "NoException"); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_OK, mockResponse.getStatus()); + + ______TS("\"Successful\" case: invalid action mapping"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, "nonexistent"); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_ACCEPTED, mockResponse.getStatus()); + + setupMocksFromGaeQueue(HttpPost.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_ACCEPTED, mockResponse.getStatus()); + + ______TS("\"Successful\" case: NullHttpParameterException"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_ACCEPTED, mockResponse.getStatus()); + + ______TS("\"Successful\" case: InvalidHttpParameterException"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, InvalidHttpParameterException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_ACCEPTED, mockResponse.getStatus()); + + ______TS("Failure case: DeadlineExceededException"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, DeadlineExceededException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); + + ______TS("Failure case: DatastoreTimeoutException"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, DatastoreTimeoutException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_GATEWAY_TIMEOUT, mockResponse.getStatus()); + + ______TS("Failure case: UnauthorizedAccessException"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, UnauthorizedAccessException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_FORBIDDEN, mockResponse.getStatus()); + + ______TS("Failure case: EntityNotFoundException"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, EntityNotFoundException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_NOT_FOUND, mockResponse.getStatus()); + + ______TS("Failure case: NullPointerException"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, NullPointerException.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); + + ______TS("Failure case: AssertionError"); + + setupMocksFromGaeQueue(HttpGet.METHOD_NAME, Const.ResourceURIs.EXCEPTION); + mockRequest.addParam(Const.ParamsNames.ERROR, AssertionError.class.getSimpleName()); + + SERVLET.doGet(mockRequest, mockResponse); + assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, mockResponse.getStatus()); + + } + +} diff --git a/src/test/java/teammates/test/cases/webapi/WebPageServletTest.java b/src/test/java/teammates/ui/webapi/WebPageServletTest.java similarity index 75% rename from src/test/java/teammates/test/cases/webapi/WebPageServletTest.java rename to src/test/java/teammates/ui/webapi/WebPageServletTest.java index 31d63e411e2..d16296cf668 100644 --- a/src/test/java/teammates/test/cases/webapi/WebPageServletTest.java +++ b/src/test/java/teammates/ui/webapi/WebPageServletTest.java @@ -1,13 +1,12 @@ -package teammates.test.cases.webapi; +package teammates.ui.webapi; import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpGet; import org.testng.annotations.Test; -import teammates.test.cases.BaseTestCase; -import teammates.test.driver.MockHttpServletRequest; -import teammates.test.driver.MockHttpServletResponse; -import teammates.ui.webapi.action.WebPageServlet; +import teammates.test.BaseTestCase; +import teammates.test.MockHttpServletRequest; +import teammates.test.MockHttpServletResponse; /** * SUT: {@link WebPageServlet}. diff --git a/src/test/java/teammates/ui/webapi/package-info.java b/src/test/java/teammates/ui/webapi/package-info.java new file mode 100644 index 00000000000..ee3f131cbfe --- /dev/null +++ b/src/test/java/teammates/ui/webapi/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains test cases for {@link teammates.ui.webapi} package. + */ +package teammates.ui.webapi; diff --git a/src/test/resources/data/FeedbackConstSumOptionQuestionUiTest.json b/src/test/resources/data/FeedbackConstSumOptionQuestionUiTest.json deleted file mode 100644 index 6e7759e64e7..00000000000 --- a/src/test/resources/data/FeedbackConstSumOptionQuestionUiTest.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "accounts": { - "instructor1": { - "googleId": "FConstSumOptionQnUiT.instructor", - "name": "Teammates Test", - "isInstructor": true, - "email": "tmms.test@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "alice.tmms": { - "googleId": "FConstSumOptionQnUiT.alice.tmms", - "name": "Alice Betsy", - "isInstructor": false, - "email": "alice.b.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "course": { - "id": "FConstSumOptionQnUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - } - }, - "instructors": { - "teammates.test.instructor": { - "googleId": "FConstSumOptionQnUiT.instructor", - "courseId": "FConstSumOptionQnUiT.CS2104", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "alice.tmms@FConstSumOptionQnUiT.CS2104": { - "googleId": "FConstSumOptionQnUiT.alice.tmms", - "email": "alice.b.tmms@gmail.tmt", - "course": "FConstSumOptionQnUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - } - }, - "feedbackSessions": { - "openSession": { - "feedbackSessionName": "First Session", - "courseId": "FConstSumOptionQnUiT.CS2104", - "creatorEmail": "tmms.test@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2026-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2026-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/FeedbackConstSumRecipientQuestionUiTest.json b/src/test/resources/data/FeedbackConstSumRecipientQuestionUiTest.json deleted file mode 100644 index caf011bf9a9..00000000000 --- a/src/test/resources/data/FeedbackConstSumRecipientQuestionUiTest.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "accounts": { - "instructor1": { - "googleId": "FConstSumRecipientQnUiT.instructor", - "name": "Teammates Test", - "isInstructor": true, - "email": "tmms.test@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "alice.tmms": { - "googleId": "FConstSumRecipientQnUiT.alice.tmms", - "name": "Alice Betsy", - "isInstructor": false, - "email": "alice.b.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "course": { - "id": "FConstSumRecipientQnUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - } - }, - "instructors": { - "teammates.test.instructor": { - "googleId": "FConstSumRecipientQnUiT.instructor", - "courseId": "FConstSumRecipientQnUiT.CS2104", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "alice.tmms@FConstSumRecipientQnUiT.CS2104": { - "googleId": "FConstSumRecipientQnUiT.alice.tmms", - "email": "alice.b.tmms@gmail.tmt", - "course": "FConstSumRecipientQnUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team '\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "comments": "comment for student1InCourse1'\"", - "team": "Team 1.1'\"", - "section": "None" - }, - "student2InCourse1": { - "googleId": "FSDTest.student2InCourse1", - "email": "FSDTest.student2InCourse1@gmail.tmt", - "course": "FSDTest.idOfTypicalCourse1", - "name": "student2 In Course1", - "comments": "student is in 2 courses", - "team": "Team 1.1'\"", - "section": "None" - }, - "student3InCourse1": { - "googleId": "FSDTest.student3InCourse1", - "email": "FSDTest.student3InCourse1@gmail.tmt", - "course": "FSDTest.idOfTypicalCourse1", - "name": "student3 In Course1", - "comments": "comment for student3InCourse1", - "team": "Team 1.2", - "section": "None" - }, - "student4InCourse1": { - "googleId": "FSDTest.student4InCourse1", - "email": "FSDTest.student4InCourse1@gmail.tmt", - "course": "FSDTest.idOfTypicalCourse1", - "name": "student4 In Course1", - "comments": "comment for student4InCourse1", - "team": "Team 1.2", - "section": "None" - }, - "student5InCourse1": { - "googleId": "FSDTest.student5InCourse1", - "email": "FSDTest.student5InCourse1@gmail.tmt", - "course": "FSDTest.idOfTypicalCourse1", - "name": "student5 In Course1", - "comments": "comment for student5InCourse1", - "team": "Team 1.3", - "section": "None" - }, - "student6InCourse1": { - "googleId": "FSDTest.student5InCourse1", - "email": "FSDTest.student6InCourse1@gmail.tmt", - "course": "FSDTest.idOfTypicalCourse1", - "name": "student6 In Course1", - "comments": "same googleId as student5InCourse1", - "team": "Team 1.4", - "section": "None" - }, - "student1InCourse2": { - "googleId": "FSDTest.student1InCourse1", - "email": "FSDTest.student1InCourse2@gmail.tmt", - "course": "FSDTest.idOfTypicalCourse2", - "name": "student1 In Course1", - "comments": "student is in 2 courses", - "team": "Team A", - "section": "None" - } - }, - "feedbackSessions": { - "standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "creatorEmail": "FSDTest.instr1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T03:00:00Z", - "endTime": "2027-04-30T06:00:00Z", - "sessionVisibleFromTime": "2012-03-28T15:59:00Z", - "resultsVisibleFromTime": "2027-05-01T08:00:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "no.responses.session": { - "feedbackSessionName": "No responses feedback session", - "courseId": "FSDTest.idOfTypicalCourse2", - "creatorEmail": "FSDTest.instr1@course2.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2026-03-20T13:00:00Z", - "startTime": "2026-04-01T23:59:00Z", - "endTime": "2027-04-30T15:00:00Z", - "sessionVisibleFromTime": "2026-01-28T17:00:00Z", - "resultsVisibleFromTime": "2027-05-01T22:00:00Z", - "timeZone": "UTC", - "gracePeriod": 10, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "no.recipients.session": { - "feedbackSessionName": "Special feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "creatorEmail": "FSDTest.instr1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T19:59:00Z", - "endTime": "2012-08-15T19:59:00Z", - "sessionVisibleFromTime": "2011-03-28T19:59:00Z", - "resultsVisibleFromTime": "2012-05-01T19:59:00Z", - "timeZone": "Asia/Dubai", - "gracePeriod": 0, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "student self feedback" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn2.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "student feedback to team members. only recipient can see names." - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn3.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "student to instructors. recipient name protected." - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [] - }, - "qn4.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "student to 2 teams with extra responses. only instructor can see giver name." - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 2, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "INSTRUCTORS" - ] - }, - "qn5.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "student to students. only giver team + receiver can see giver name" - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "OWN_TEAM_MEMBERS", - "RECEIVER_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER", - "RECEIVER_TEAM_MEMBERS" - ] - }, - "qn6.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "instructor to none. only instructors can see." - }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn7.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "teams to students. all students can see everything, but not instr inc creator." - }, - "questionNumber": 7, - "giverType": "TEAMS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "STUDENTS" - ], - "showGiverNameTo": [ - "STUDENTS" - ], - "showRecipientNameTo": [ - "STUDENTS" - ] - }, - "qn8.standard.session": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "teams to teams test." - }, - "questionNumber": 8, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1.no.recipient.session": { - "feedbackSessionName": "Special feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "student > none" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2.no.recipient.session": { - "feedbackSessionName": "Special feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "instructor > none" - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ] - }, - "qn1.no.responses.session": { - "feedbackSessionName": "No responses feedback session", - "courseId": "FSDTest.idOfTypicalCourse2", - "questionDetails": { - "questionType": "TEXT", - "questionText": "students" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "STUDENTS" - ], - "showGiverNameTo": [ - "STUDENTS" - ], - "showRecipientNameTo": [ - "STUDENTS" - ] - }, - "qn2.no.responses.session": { - "feedbackSessionName": "No responses feedback session", - "courseId": "FSDTest.idOfTypicalCourse2", - "questionDetails": { - "questionType": "TEXT", - "questionText": "instructors" - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": { - "qn1.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "FSDTest.student1InCourse1@gmail.tmt", - "recipient": "FSDTest.student1InCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "student self feedback." - } - }, - "qn2.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "FSDTest.student1InCourse1@gmail.tmt", - "recipient": "FSDTest.student2InCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "student 1 feedback to student 2." - } - }, - "qn2.resp2": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "FSDTest.student6InCourse1@gmail.tmt", - "recipient": "FSDTest.student3InCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "student 6 feedback to student 3." - } - }, - "qn2.resp3": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "FSDTest.student2InCourse1@gmail.tmt", - "recipient": "FSDTest.student1InCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "student 2 feedback to student 1." - } - }, - "qn3.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "3", - "giver": "FSDTest.student1InCourse1@gmail.tmt", - "recipient": "FSDTest.instr1@course1.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "student 1 feedback to instr 1." - } - }, - "qn3.resp2": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "3", - "giver": "FSDTest.student3InCourse1@gmail.tmt", - "recipient": "FSDTest.instr2@course1.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "student 3 feedback to instr 2." - } - }, - "qn4.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "4", - "giver": "FSDTest.student4InCourse1@gmail.tmt", - "recipient": "Team 1.2", - "responseDetails": { - "questionType": "TEXT", - "answer": "student 5 feedback to Team 1.2." - } - }, - "qn4.resp2": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "4", - "giver": "FSDTest.student1InCourse1@gmail.tmt", - "recipient": "Team 1.3", - "responseDetails": { - "questionType": "TEXT", - "answer": "student 1 feedback to Team 1.3." - } - }, - "qn4.resp3": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "4", - "giver": "FSDTest.student2InCourse1@gmail.tmt", - "recipient": "Team 1.4", - "responseDetails": { - "questionType": "TEXT", - "answer": "extra response to Team 1.4." - } - }, - "qn5.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "5", - "giver": "FSDTest.student2InCourse1@gmail.tmt", - "recipient": "FSDTest.student4InCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "standard stu>stu, diff teams" - } - }, - "qn6.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "6", - "giver": "FSDTest.instr1@course1.tmt", - "recipient": "%GENERAL%", - "responseDetails": { - "questionType": "TEXT", - "answer": "instr > all" - } - }, - "qn7.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "7", - "giver": "FSDTest.student1InCourse1@gmail.tmt", - "recipient": "FSDTest.student2InCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "team 1.1 > student (in own team)" - } - }, - "qn7.resp2": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "7", - "giver": "FSDTest.student2InCourse1@gmail.tmt", - "recipient": "FSDTest.student4InCourse1@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "team 1.1 > student (in Team 1.2)" - } - }, - "qn8.resp1": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "8", - "giver": "FSDTest.student1InCourse1@gmail.tmt", - "recipient": "Team 1.2", - "responseDetails": { - "questionType": "TEXT", - "answer": "team 1.1 > team 1.2" - } - }, - "qn8.resp2": { - "feedbackSessionName": "Standard feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "8", - "giver": "FSDTest.student4InCourse1@gmail.tmt", - "recipient": "Team 1.1'\"", - "responseDetails": { - "questionType": "TEXT", - "answer": "team 1.2 > team 1.1" - } - }, - "no.recipients.qn1.resp1": { - "feedbackSessionName": "Special feedback session", - "courseId": "FSDTest.idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "FSDTest.student5InCourse1@gmail.tmt", - "recipient": "%GENERAL%", - "responseDetails": { - "questionType": "TEXT", - "answer": "creator self feedback" - } - } - }, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/FeedbackSessionResultsCsvActionTest.json b/src/test/resources/data/FeedbackSessionResultsCsvActionTest.json deleted file mode 100644 index b32f4cfbe4f..00000000000 --- a/src/test/resources/data/FeedbackSessionResultsCsvActionTest.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "accounts": { - "instructor1OfCourse1": { - "googleId": "idOfInstructor1OfCourse1", - "name": "Instructor 1 of Course 1", - "isInstructor": true, - "email": "instr1@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student1InCourse1": { - "googleId": "student1InCourse1", - "name": "Student 1 in course 1", - "isInstructor": false, - "email": "student1InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "typicalCourse1": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "idOfTypicalCourse1", - "name": "Typical Course 1 with 2 Evals", - "timeZone": "Africa/Johannesburg" - } - }, - "instructors": { - "instructor1OfCourse1": { - "googleId": "idOfInstructor1OfCourse1", - "courseId": "idOfTypicalCourse1", - "name": "Instructor1 Course1", - "email": "instructor1@course1.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canmodifycourse": true, - "canmodifyinstructor": true, - "canmodifysession": true, - "canmodifystudent": true, - "canviewstudentinsection": true, - "canviewsessioninsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "email": "student1InCourse1@gmail.tmt", - "course": "idOfTypicalCourse1", - "name": "student1 In Course1'\"", - "comments": "comment for student1InCourse1'\"", - "team": "Team 1.1'\"", - "section": "Section 1" - } - }, - "feedbackSessions": { - "sessionWithMcq": { - "feedbackSessionName": "Session with MCQ", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InStatsSessionInCourse1": { - "feedbackSessionName": "Session with MCQ", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "Price", - "Quality" - ], - "questionType": "MCQ", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": { - "response1ForQ1StatsSessionC1": { - "feedbackSessionName": "Session with MCQ", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "student1InCourse1@gmail.tmt", - "recipient": "student1InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "MCQ", - "otherFieldContent": "", - "answer": "Quality" - } - } - }, - "feedbackResponseComments": { - }, - "profiles": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "shortName": "Stud1", - "email": "i.m.stud1@gmail.tmt", - "institute": "TEAMMATES Test Institute 3", - "nationality": "American", - "gender": "MALE", - "moreInfo": "I am just a student :P", - "pictureKey": "asdf34&hfn3!@" - } - } -} diff --git a/src/test/resources/data/InstructorCourseDetailsPageUiTest.json b/src/test/resources/data/InstructorCourseDetailsPageUiTest.json deleted file mode 100644 index 990cbcfa2ce..00000000000 --- a/src/test/resources/data/InstructorCourseDetailsPageUiTest.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "accounts": { - "CCDetailsUiT.instr": { - "googleId": "CCDetailsUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "CCDetailsUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CCDetailsUiT.instr2": { - "googleId": "CCDetailsUiT.instr2", - "name": "Teammates Test 2", - "isInstructor": true, - "email": "CCDetailsUiT.instr2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CCDetailsUiT.instr2Helper": { - "googleId": "CCDetailsUiT.instr2Helper", - "name": "Teammates Test 2", - "isInstructor": true, - "email": "CCDetailsUiT.instr2Helper@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CCDetailsUiT.coord": { - "googleId": "CCDetailsUiT.coord", - "name": "Teammates Coord", - "isInstructor": true, - "email": "CCDetailsUiT.coord@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CCDetailsUiT.instructor1OfTSCourse": { - "googleId": "CCDetailsUiT.idOfInstructor1OfTSCourse", - "name": "Instructor", - "isInstructor": true, - "email": "CCDetailsUiT.instructor1@sanitization.tmt", - "institute": "inst" - }, - "Alice": { - "googleId": "${value.injected.in.testfile}", - "name": "Alice Betsy", - "isInstructor": false, - "email": "alice.b.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "Charlie": { - "googleId": "${value.injected.in.testfile}", - "name": "Charlie Davis", - "isInstructor": false, - "email": "charlie.d.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CCDetailsUiT.student1InTSCourse": { - "googleId": "CCDetailsUiT.student1InTSCourse", - "name": "Stud1", - "isInstructor": false, - "email": "CCDetailsUiT.normal@sanitization.tmt", - "institute": "inst" - } - }, - "courses": { - "CCDetailsUiT.CS2104": { - "id": "CCDetailsUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "CCDetailsUiT.CS2103": { - "id": "CCDetailsUiT.CS2103", - "name": "Software Engineering", - "timeZone": "UTC" - }, - "CCDetailsUiT.CourseWithoutStudents": { - "id": "CCDetailsUiT.CourseWithoutStudents", - "name": "A course with no students", - "timeZone": "UTC" - }, - "CCDetailsUiT.TSCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "CCDetailsUiT.idOfTSCourse", - "name": "Testing", - "timeZone": "UTC" - } - }, - "instructors": { - "CCDetailsUiT.instr": { - "googleId": "CCDetailsUiT.instr", - "courseId": "CCDetailsUiT.CS2104", - "name": "Teammates Test", - "email": "CCDetailsUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CCDetailsUiT.coord": { - "googleId": "CCDetailsUiT.coord", - "courseId": "CCDetailsUiT.CS2104", - "name": "Teammates Coord", - "email": "CCDetailsUiT.coord@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CCDetailsUiT.instr2": { - "googleId": "CCDetailsUiT.instr2", - "courseId": "CCDetailsUiT.CS2103", - "name": "Teammates Test 2", - "email": "CCDetailsUiT.instr2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CCDetailsUiT.instr2Helper": { - "googleId": "CCDetailsUiT.instr2Helper", - "courseId": "CCDetailsUiT.CS2103", - "name": "Teammates Test 2", - "email": "CCDetailsUiT.instr2Helper@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CCDetailsUiT.instrForEmptyCourse": { - "googleId": "CCDetailsUiT.instr", - "courseId": "CCDetailsUiT.CourseWithoutStudents", - "name": "Teammates Test", - "email": "CCDetailsUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CCDetailsUiT.instructor1OfTSCourse": { - "googleId": "CCDetailsUiT.idOfInstructor1OfTSCourse", - "courseId": "CCDetailsUiT.idOfTSCourse", - "name": "Instructor", - "email": "CCDetailsUiT.instructor1@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cangivecommentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canviewcommentinsection": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "CCDetailsUiT.alice.tmms@CCDetailsUiT.CS2104": { - "googleId": "${value.injected.in.testfile}", - "email": "${value.injected.in.testfile}", - "course": "CCDetailsUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy", - "team": "Team 1'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "Section 1'\"" - }, - "benny.c.tmms@CCEnrollScT.CS2104": { - "googleId": "CCEnrollScT.benny.c.tmms", - "email": "benny.c.tmms@gmail.tmt", - "course": "CCEnrollScT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "Section 1'\"" - }, - "charlie.d.tmms@CCEnrollScT.CS2104": { - "googleId": "CCEnrollScT.charlie.d.tmms", - "email": "charlie.d.tmms@gmail.tmt", - "course": "CCEnrollScT.CS2104", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "Section 2" - }, - "danny.e.tmms@CCEnrollScT.CS2104": { - "googleId": "CCEnrollScT.danny.e.tmms", - "email": "danny.e.tmms@gmail.tmt", - "course": "CCEnrollScT.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "Section 2" - } - }, - "feedbackSessions": {}, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorCourseJoinConfirmationPageUiTest.json b/src/test/resources/data/InstructorCourseJoinConfirmationPageUiTest.json deleted file mode 100644 index 4ea4d15d959..00000000000 --- a/src/test/resources/data/InstructorCourseJoinConfirmationPageUiTest.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "accounts": { - "ICJConfirmationUiT.instr": { - "googleId": "ICJConfirmationUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "ICJConfirmationUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "ICJConfirmationUiT.CS2104": { - "id": "ICJConfirmationUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "ICJConfirmationUiT.CS1101": { - "id": "ICJConfirmationUiT.CS1101", - "name": "Programming Methodology", - "timeZone": "UTC" - } - }, - "instructors": { - "ICJConfirmationUiT.instr.CS2104": { - "googleId": "${value.injected.in.testfile}", - "courseId": "ICJConfirmationUiT.CS2104", - "name": "Teammates Test 2", - "email": "${value.injected.in.testfile}", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "ICJConfirmationUiT.instr.CS1101": { - "courseId": "ICJConfirmationUiT.CS1101", - "name": "Teammates Test 2", - "email": "${value.injected.in.testfile}", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "ICJConfirmationUiT.instr2.CS1101": { - "googleId": "ICJConfirmationUiT.instr", - "courseId": "ICJConfirmationUiT.CS1101", - "name": "Teammates Test", - "email": "ICJConfirmationUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": {}, - "feedbackSessions": {}, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorCourseStudentDetailsPageUiTest.json b/src/test/resources/data/InstructorCourseStudentDetailsPageUiTest.json deleted file mode 100644 index f953a8a3446..00000000000 --- a/src/test/resources/data/InstructorCourseStudentDetailsPageUiTest.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "accounts": { - "CCSDetailsUiT.instr": { - "googleId": "CCSDetailsUiT.instr.veryLongGoogleId", - "name": "Teammates Test", - "isInstructor": true, - "email": "CCSDetailsUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CCSDetailsUiT.Helper": { - "googleId": "CCSDetailsUiT.Helper", - "name": "Teammates Test", - "isInstructor": true, - "email": "CCSDetailsUiT.Helper@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "registeredStudent": { - "googleId": "CCSDetailsUiT.jose.tmms", - "name": "José Gómez", - "isInstructor": false, - "email": "CCSDetailsUiT.jose.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "CCSDetailsUiT.sanitizationInstruct", - "name": "Instructor", - "isInstructor": true, - "email": "CCSDetailsUiT.instruct@sanitization.tmt", - "institute": "inst\"" - }, - "student1InTestingSanitizationCourse": { - "googleId": "CCSDetailsUiT.sanitizationStud", - "name": "Stud1", - "isInstructor": false, - "email": "CCSDetailsUiT.stud@sanitization.tmt", - "institute": "inst" - } - }, - "courses": { - "CCSDetailsUiT.CS2104": { - "id": "CCSDetailsUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "testingSanitizationCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "CCSDetailsUiT.sanitizationCourse", - "name": "Testing", - "timeZone": "UTC" - } - }, - "instructors": { - "CCSDetailsUiT.instr": { - "googleId": "CCSDetailsUiT.instr.veryLongGoogleId", - "courseId": "CCSDetailsUiT.CS2104", - "name": "Teammates Test", - "email": "CCSDetailsUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CCSDetailsUiT.Helper": { - "googleId": "CCSDetailsUiT.Helper", - "courseId": "CCSDetailsUiT.CS2104", - "name": "Teammates Test", - "email": "CCSDetailsUiT.Helper@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "CCSDetailsUiT.sanitizationInstruct", - "courseId": "CCSDetailsUiT.sanitizationCourse", - "name": "Instructor", - "email": "CCSDetailsUiT.instruct@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "registeredStudent": { - "googleId": "CCSDetailsUiT.jose.tmms", - "email": "CCSDetailsUiT.jose.tmms@gmail.tmt", - "course": "CCSDetailsUiT.CS2104", - "name": "José Gómez", - "comments": "This student's name is José Gómez", - "team": "Team 1", - "section": "None" - }, - "unregisteredStudent": { - "googleId": "", - "email": "benny.c.tmms@gmail.tmt", - "course": "CCSDetailsUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1", - "section": "None" - }, - "student1InTestingSanitizationCourse": { - "googleId": "CCSDetailsUiT.sanitizationStud", - "email": "CCSDetailsUiT.stud@sanitization.tmt", - "course": "CCSDetailsUiT.sanitizationCourse", - "name": "Stud1'\"", - "comments": "

    '\"", - "team": "Team tags&\"", - "section": "Section'" - } - }, - "feedbackSessions": {}, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": { - "registeredStudent": { - "googleId": "CCSDetailsUiT.jose.tmms", - "shortName": "Jose", - "email": "jose@e.tmt", - "institute": "TEAMMATES Test Institute 7", - "nationality": "Laotian", - "gender": "OTHER", - "moreInfo": "This is a lot of info...", - "pictureKey": "" - }, - "student1InTestingSanitizationCourse": { - "googleId": "CCSDetailsUiT.sanitizationStud", - "shortName": "name\"/>", - "email": "weird&'@gmail.tmt", - "institute": "school'/>", - "nationality": "American", - "gender": "OTHER", - "moreInfo": "I am just a student :P", - "pictureKey": "" - } - } -} diff --git a/src/test/resources/data/InstructorEditInstructorFeedbackPageTest.json b/src/test/resources/data/InstructorEditInstructorFeedbackPageTest.json deleted file mode 100644 index f879f359ed6..00000000000 --- a/src/test/resources/data/InstructorEditInstructorFeedbackPageTest.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "accounts": { - "IEIFPTCourseinstr": { - "googleId": "IEIFPTCourseinstr", - "name": "IEIFPTCourseinstr", - "isInstructor": true, - "email": "IEIFPTCourseintr@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IEIFPTCoursehelper1": { - "googleId": "IEIFPTCoursehelper1", - "name": "IEIFPTCoursehelper1", - "isInstructor": true, - "email": "IEIFPTCoursehelper1@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IEIFPTCoursehelper2": { - "googleId": "IEIFPTCoursehelper2", - "name": "IEIFPTCoursehelper2", - "isInstructor": true, - "email": "IEIFPTCoursehelper2@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IEIFPTCoursehelper3": { - "googleId": "IEIFPTCoursehelper3", - "name": "IEIFPTCoursehelper3", - "isInstructor": true, - "email": "IEIFPTCoursehelper3@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student1InIEIFPTCourse": { - "googleId": "student1InIEIFPTCourse", - "name": "Student 1 in course IEIFPTCourse", - "isInstructor": false, - "email": "student1InIEIFPTCourse@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student2InIEIFPTCourse": { - "googleId": "student2InIEIFPTCourse", - "name": "Student 2 in IEIFPTCourse", - "isInstructor": false, - "email": "student2InIEIFPTCourse@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "IEIFPTCourse": { - "id": "IEIFPTCourse", - "name": "IEIFPTCourse", - "timeZone": "UTC" - } - }, - "instructors": { - "IEIFPTCourseinstr": { - "googleId": "IEIFPTCourseinstr", - "courseId": "IEIFPTCourse", - "name": "IEIFPTCourseinstr", - "email": "IEIFPTCourseintr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IEIFPTCoursehelper1": { - "googleId": "IEIFPTCoursehelper1", - "courseId": "IEIFPTCourse", - "name": "Teammates Helper1", - "email": "IEIFPTCoursehelper1@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Instructor Helper 1", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section 2": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": {} - } - }, - "IEIFPTCoursehelper2": { - "googleId": "IEIFPTCoursehelper2", - "courseId": "IEIFPTCourse", - "name": "Instructor Two", - "email": "IEIFPTCoursehelper2@email.tmt", - "isArchived": false, - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor Helper 2", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section 2": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": { - "Section 2": { - "First feedback session": { - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canviewsessioninsection": true - } - } - } - } - }, - "IEIFPTCoursehelper3": { - "googleId": "IEIFPTCoursehelper3", - "courseId": "IEIFPTCourse", - "name": "Instructor Three", - "email": "IEIFPTCoursehelper3@email.tmt", - "isArchived": false, - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor Helper 3", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section 2": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canviewsessioninsection": true - } - }, - "sessionLevel": { - "Section 2": { - "First feedback session": { - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - } - } - } - } - }, - "students": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "email": "student1InIEIFPTCourse@gmail.tmt", - "course": "IEIFPTCourse", - "name": "student1 In Course1", - "comments": "comment for student1InCourse1", - "team": "Team 1.1", - "section": "Section 1" - }, - "student2InCourse1": { - "googleId": "student2InCourse1", - "email": "student2InIEIFPTCourse@gmail.tmt", - "course": "IEIFPTCourse", - "name": "student2 In Course1", - "comments": "comment for student2InCourse1", - "team": "Team 2.1", - "section": "Section 2" - } - }, - "feedbackSessions": { - "session1InIEIFPTCourse": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session2InIEIFPTCourse": { - "feedbackSessionName": "Another feedback session", - "courseId": "IEIFPTCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "closedsession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IEIFPTCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "How do you think you can improve yourself?" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn2InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "minScale": 1, - "questionText": "Rate your perceived contribution of these people.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "STUDENTS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS", - "RECEIVER" - ] - }, - "qn3InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What do you think of the students?" - }, - "questionNumber": 3, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn4InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should NOT appear when moderated by an instructor, as instructors are unable to see which recipient received responses for this question" - }, - "questionNumber": 4, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn5InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should NOT appear when moderated by an instructor, as instructors are unable to see the givers for this question" - }, - "questionNumber": 5, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn6InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "hasAssignedWeights": false, - "mcqWeights": [], - "mcqOtherWeight": 0.0, - "numOfMcqChoices": 2, - "mcqChoices": [ - "It's good", - "It's perfect" - ], - "otherEnabled": false, - "generateOptionsFor": "NONE", - "questionType": "MCQ", - "questionText": "What do you like best about the class' product?" - }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2InCourse1": { - "feedbackSessionName": "Another feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Talk about your contributions" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn1InClosedsession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Talk about your contributions" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn2InClosedSession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IEIFPTCourse", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "It's good", - "It's perfect" - ], - "questionText": "What do you like best about our product?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": { - "response1ForQ1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "1", - "giver": "IEIFPTCoursehelper1@gmail.tmt", - "recipient": "IEIFPTCoursehelper1@gmail.tmt", - "giverSection": "", - "recipientSection": "", - "responseDetails": { - "questionType": "TEXT", - "answer": "Helper 1 self feedback." - } - }, - "response2ForQ1": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "1", - "giver": "IEIFPTCourseintr@gmail.tmt", - "recipient": "IEIFPTCourseintr@gmail.tmt", - "giverSection": "", - "recipientSection": "", - "responseDetails": { - "questionType": "TEXT", - "answer": "Instructor 1 self feedback." - } - }, - "response1ForQ3": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "3", - "giver": "IEIFPTCoursehelper1@gmail.tmt", - "recipient": "student1InIEIFPTCourse@gmail.tmt", - "giverSection": "", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Helper 1 opinion about Student 1." - } - }, - "response1ForQ4": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "4", - "giver": "IEIFPTCoursehelper1@gmail.tmt", - "recipient": "student1InIEIFPTCourse@gmail.tmt", - "giverSection": "", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "response whereby receipient should not be seen by instructors" - } - }, - "response1ForQ5": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "5", - "giver": "IEIFPTCoursehelper1@gmail.tmt", - "recipient": "student1InIEIFPTCourse@gmail.tmt", - "giverSection": "", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "response whereby giver should not be seen by instructors" - } - }, - "response1ForQ6": { - "feedbackSessionName": "First feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "6", - "giver": "IEIFPTCoursehelper1@gmail.tmt", - "recipient": "IEIFPTCoursehelper1@gmail.tmt", - "responseDetails": { - "answer": "It's good", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "response1ForS2Q1": { - "feedbackSessionName": "Another feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "1", - "giver": "IEIFPTCourseintr@gmail.tmt", - "recipient": "IEIFPTCourseintr@gmail.tmt", - "giverSection": "", - "recipientSection": "", - "responseDetails": { - "questionType": "TEXT", - "answer": "Session 2 Question 1 Response 1" - } - }, - "response2ForS2Q1": { - "feedbackSessionName": "Another feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "1", - "giver": "IEIFPTCoursehelper1@gmail.tmt", - "recipient": "IEIFPTCoursehelper1@gmail.tmt", - "giverSection": "", - "recipientSection": "", - "responseDetails": { - "questionType": "TEXT", - "answer": "Session 2 Question 1 Response 2" - } - }, - "response1ForQ1InClosedSession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "1", - "giver": "IEIFPTCourseintr@gmail.tmt", - "recipient": "IEIFPTCourseintr@gmail.tmt", - "giverSection": "", - "recipientSection": "", - "responseDetails": { - "questionType": "TEXT", - "answer": "Closed session response" - } - }, - "response1ForQ2InClosedSession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IEIFPTCourse", - "feedbackQuestionId": "2", - "giver": "IEIFPTCoursehelper1@gmail.tmt", - "recipient": "IEIFPTCoursehelper1@gmail.tmt", - "responseDetails": { - "answer": "It's good", - "otherFieldContent": "", - "questionType": "MCQ" - } - } - }, - "feedbackResponseComments": {}, - "profiles": { - "student1InIEIFPTCourse": { - "googleId": "student1InIEIFPTCourse", - "shortName": "Stud1", - "email": "i.m.stud1@gmail.tmt", - "institute": "TEAMMATES Test Institute 3", - "nationality": "American", - "gender": "MALE", - "moreInfo": "I am just a student :P", - "pictureKey": "asdf34&hfn3!@" - } - } -} diff --git a/src/test/resources/data/InstructorEditStudentFeedbackPageTest.json b/src/test/resources/data/InstructorEditStudentFeedbackPageTest.json deleted file mode 100644 index ca7eaaa70ce..00000000000 --- a/src/test/resources/data/InstructorEditStudentFeedbackPageTest.json +++ /dev/null @@ -1,634 +0,0 @@ -{ - "accounts": { - "IESFPTCourseinstr": { - "googleId": "IESFPTCourseinstr", - "name": "IESFPTCourseinstr", - "isInstructor": true, - "email": "IESFPTCourseintr@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IESFPTCoursehelper1": { - "googleId": "IESFPTCoursehelper1", - "name": "IESFPTCoursehelper1", - "isInstructor": true, - "email": "IESFPTCoursehelper1@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IESFPTCoursehelper2": { - "googleId": "IESFPTCoursehelper2", - "name": "IESFPTCoursehelper2", - "isInstructor": true, - "email": "IESFPTCoursehelper2@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IESFPTCoursehelper3": { - "googleId": "IESFPTCoursehelper3", - "name": "IESFPTCoursehelper3", - "isInstructor": true, - "email": "IESFPTCoursehelper3@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student1InIESFPTCourse": { - "googleId": "student1InIESFPTCourse", - "name": "Student 1 in course IESFPTCourse", - "isInstructor": false, - "email": "student1InIESFPTCourse@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student2InIESFPTCourse": { - "googleId": "student2InIESFPTCourse", - "name": "Student 2 in IESFPTCourse", - "isInstructor": false, - "email": "student2InIESFPTCourse@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "IESFPTCourse": { - "id": "IESFPTCourse", - "name": "IESFPTCourse", - "timeZone": "UTC" - } - }, - "instructors": { - "IESFPTCourseinstr": { - "googleId": "IESFPTCourseinstr", - "courseId": "IESFPTCourse", - "name": "IESFPTCourseinstr", - "email": "IESFPTCourseintr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IESFPTCoursehelper1": { - "googleId": "IESFPTCoursehelper1", - "courseId": "IESFPTCourse", - "name": "Teammates Helper1", - "email": "IESFPTCoursehelper1@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Instructor Helper 1", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section 2": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": {} - } - }, - "IESFPTCoursehelper2": { - "googleId": "IESFPTCoursehelper2", - "courseId": "IESFPTCourse", - "name": "Instructor Two", - "email": "IESFPTCoursehelper2@email.tmt", - "isArchived": false, - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor Helper 2", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section 2": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": { - "Section 2": { - "First feedback session": { - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canviewsessioninsection": true - } - } - } - } - }, - "IESFPTCoursehelper3": { - "googleId": "IESFPTCoursehelper3", - "courseId": "IESFPTCourse", - "name": "Instructor Three", - "email": "IESFPTCoursehelper3@email.tmt", - "isArchived": false, - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor Helper 3", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section 2": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canviewsessioninsection": true - } - }, - "sessionLevel": { - "Section 2": { - "First feedback session": { - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - } - } - } - } - }, - "students": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "email": "student1InIESFPTCourse@gmail.tmt", - "course": "IESFPTCourse", - "name": "student1 In Course1'\"", - "comments": "comment for student1InCourse1'\"", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student2InCourse1": { - "googleId": "student2InCourse1", - "email": "student2InIESFPTCourse@gmail.tmt", - "course": "IESFPTCourse", - "name": "student2 In Course1", - "comments": "comment for student2InCourse1", - "team": "Team 2.1", - "section": "Section 2" - } - }, - "feedbackSessions": { - "session1InIESFPTCourse": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session2InIESFPTCourse": { - "feedbackSessionName": "Another feedback session", - "courseId": "IESFPTCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "closedsession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IESFPTCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "minScale": 1, - "questionText": "Rate your product.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should NOT appear when moderated by an instructor, as instructors are unable to see which giver gave responses for this question" - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn4InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should NOT appear when moderated by an instructor, as instructors are unable to see which recipient received responses for this question" - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn5InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should NOT appear when moderated by an instructor, as instructors are unable to see responses for this question" - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn6InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "It's good", - "It's perfect" - ], - "questionText": "What do you like best about our product?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 6, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn1InSession2InCourse1": { - "feedbackSessionName": "Another feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Talk about your contributions" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn1InClosedsession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Talk about your contributions" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn2InClosedSession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IESFPTCourse", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "It's good", - "It's perfect" - ], - "questionText": "What do you like best about our product?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": { - "response1ForQ1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "1", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Student 1 self feedback." - } - }, - "response2ForQ1": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "1", - "giver": "student2InIESFPTCourse@gmail.tmt", - "recipient": "student2InIESFPTCourse@gmail.tmt", - "giverSection": "Section 2", - "recipientSection": "Section 2", - "responseDetails": { - "questionType": "TEXT", - "answer": "Student 2 self feedback." - } - }, - "response1ForQ3": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "3", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "response whereby giver should not be seen by instructors" - } - }, - "response1ForQ4": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "4", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "response whereby receipient should not be seen by instructors" - } - }, - "response1ForQ5": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "5", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "response with everything should not be seen by instructors" - } - }, - "response1ForQ6": { - "feedbackSessionName": "First feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "6", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "answer": "It's good", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "response1ForS2Q1": { - "feedbackSessionName": "Another feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "1", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Session 2 Question 1 Response 1" - } - }, - "response2ForS2Q1": { - "feedbackSessionName": "Another feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "1", - "giver": "student2InIESFPTCourse@gmail.tmt", - "recipient": "student2InIESFPTCourse@gmail.tmt", - "giverSection": "Section 2", - "recipientSection": "Section 2", - "responseDetails": { - "questionType": "TEXT", - "answer": "Session 2 Question 1 Response 2" - } - }, - "response1ForQ1InClosedSession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "1", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Closed session response" - } - }, - "response1ForQ2InClosedSession": { - "feedbackSessionName": "Closed feedback session", - "courseId": "IESFPTCourse", - "feedbackQuestionId": "2", - "giver": "student1InIESFPTCourse@gmail.tmt", - "recipient": "student1InIESFPTCourse@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "answer": "It's good", - "otherFieldContent": "", - "questionType": "MCQ" - } - } - }, - "feedbackResponseComments": {}, - "profiles": { - "student1InIESFPTCourse": { - "googleId": "student1InIESFPTCourse", - "shortName": "Stud1", - "email": "i.m.stud1@gmail.tmt", - "institute": "TEAMMATES Test Institute 3", - "nationality": "American", - "gender": "MALE", - "moreInfo": "I am just a student :P", - "pictureKey": "asdf34&hfn3!@" - } - } -} diff --git a/src/test/resources/data/InstructorFeedbackEditCopyTest.json b/src/test/resources/data/InstructorFeedbackEditCopyTest.json deleted file mode 100644 index 831e10a5311..00000000000 --- a/src/test/resources/data/InstructorFeedbackEditCopyTest.json +++ /dev/null @@ -1,446 +0,0 @@ -{ - "accounts": { - "instructorWithSessions": { - "googleId": "FeedbackEditCopyinstructor", - "name": "Teammates Test", - "isInstructor": true, - "email": "tmms.test@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "otherInstructor": { - "googleId": "FeedbackEditCopyinstructor2", - "name": "Instructor 2", - "isInstructor": true, - "email": "tmms.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "alice.tmms": { - "googleId": "FeedbackEditCopy.alice.tmms", - "name": "Alice Betsy", - "isInstructor": false, - "email": "alice.b.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "course": { - "createdAt": "2012-04-01T20:00:00Z", - "id": "FeedbackEditCopy.CS2104", - "name": "Programming Language Concepts", - "timeZone": "Africa/Johannesburg" - }, - "course2": { - "id": "FeedbackEditCopy.CS1101", - "name": "Programming Methodology", - "timeZone": "UTC" - }, - "course3": { - "createdAt": "2012-04-01T21:00:00Z", - "id": "FeedbackEditCopy.CS2105", - "name": "Introduction to Computer Networks", - "timeZone": "UTC" - }, - "course4": { - "createdAt": "2012-04-01T22:00:00Z", - "id": "FeedbackEditCopy.CS2103", - "name": "Software Engineering", - "timeZone": "UTC" - }, - "course5": { - "id": "FeedbackEditCopy.CS2107", - "name": "Introduction to Information and System Security", - "timeZone": "UTC" - }, - "course6": { - "id": "FeedbackEditCopy.CS2103R", - "name": "Software Engineering (R)", - "timeZone": "Asia/Singapore" - }, - "course7": { - "id": "FeedbackEditCopy.CS2102", - "name": "Introduction to Databases", - "timeZone": "UTC" - } - }, - "instructors": { - "teammates.test.instructor": { - "googleId": "FeedbackEditCopyinstructor", - "courseId": "FeedbackEditCopy.CS2104", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor1a": { - "googleId": "FeedbackEditCopyinstructor", - "courseId": "FeedbackEditCopy.CS2105", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor1b": { - "googleId": "FeedbackEditCopyinstructor", - "courseId": "FeedbackEditCopy.CS1101", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "isArchived": true, - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor1c": { - "googleId": "FeedbackEditCopyinstructor", - "courseId": "FeedbackEditCopy.CS2103", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor1d": { - "googleId": "FeedbackEditCopyinstructor", - "courseId": "FeedbackEditCopy.CS2107", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": false, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2": { - "googleId": "FeedbackEditCopyinstructor2", - "courseId": "FeedbackEditCopy.CS2104", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2a": { - "googleId": "FeedbackEditCopyinstructor2", - "courseId": "FeedbackEditCopy.CS2103", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2b": { - "googleId": "FeedbackEditCopyinstructor2", - "courseId": "FeedbackEditCopy.CS1101", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "isArchived": true, - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2c": { - "googleId": "FeedbackEditCopyinstructor2", - "courseId": "FeedbackEditCopy.CS2103R", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2d": { - "googleId": "FeedbackEditCopyinstructor2", - "courseId": "FeedbackEditCopy.CS2102", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2e": { - "googleId": "FeedbackEditCopyinstructor2", - "courseId": "FeedbackEditCopy.CS2107", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": false, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor3": { - "googleId": "FeedbackEditCopyinstructor3", - "courseId": "FeedbackEditCopy.CS2104", - "name": "Instructor 3", - "email": "tmms.instr.cust@course.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "alice.tmms@FeedbackEditCopy.CS2104": { - "googleId": "FeedbackEditCopy.alice.tmms", - "email": "alice.b.tmms@gmail.tmt", - "course": "FeedbackEditCopy.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "benny.tmms@FeedbackEditCopy.CS2104": { - "googleId": "FeedbackEditCopy.benny.tmms", - "email": "benny.tmms@gmail.tmt", - "course": "FeedbackEditCopy.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "charlie.tmms@FeedbackEditCopy.CS1101": { - "googleId": "charlie.tmms", - "email": "FeedbackEditCopy.charlie.tmms@gmail.tmt", - "course": "FeedbackEditCopy.CS1101", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "danny.tmms@FeedbackEditCopy.CS1101": { - "googleId": "danny.tmms", - "email": "FeedbackEditCopy.danny.tmms@gmail.tmt", - "course": "FeedbackEditCopy.CS1101", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - } - }, - "feedbackSessions": { - "openSession": { - "feedbackSessionName": "First Session", - "courseId": "FeedbackEditCopy.CS2104", - "creatorEmail": "tmms.test@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2026-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2026-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1": { - "feedbackSessionName": "First Session", - "courseId": "FeedbackEditCopy.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "student self feedback" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - } - }, - "feedbackResponses": { - "qn1.resp1": { - "feedbackSessionName": "First Session", - "courseId": "FeedbackEditCopy.CS2104", - "feedbackQuestionId": "1", - "giver": "benny.tmms@gmail.tmt", - "recipient": "benny.tmms@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "student self feedback." - } - } - }, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorFeedbackEditPageUiTest.json b/src/test/resources/data/InstructorFeedbackEditPageUiTest.json deleted file mode 100644 index af83e062730..00000000000 --- a/src/test/resources/data/InstructorFeedbackEditPageUiTest.json +++ /dev/null @@ -1,353 +0,0 @@ -{ - "accounts": { - "instructorWithSessions": { - "googleId": "CFeedbackEditUiT.instructor", - "name": "Teammates Test", - "isInstructor": true, - "email": "tmms.test@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "otherInstructor": { - "googleId": "CFeedbackEditUiT.instructor2", - "name": "Instructor 2", - "isInstructor": true, - "email": "tmms.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "thirdInstructor": { - "googleId": "CFeedbackEditUiT.instructor3", - "name": "Instructor 3", - "isInstructor": true, - "email": "tmms.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "CFeedbackEditUiT.instructor1OfTSCourse", - "name": "Instructor", - "isInstructor": true, - "email": "CFeedbackEditUiT.instructor1@sanitization.tmt", - "institute": "inst" - }, - "instructorOfDstCourse": { - "googleId": "CFeedbackEditUiT.instructorOfDstCourse", - "name": "Instructor DST", - "isInstructor": true, - "email": "tmms.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "alice.tmms": { - "googleId": "CFeedbackEditUiT.alice.tmms", - "name": "Alice Betsy", - "isInstructor": false, - "email": "alice.b.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "course": { - "id": "CFeedbackEditUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "Africa/Johannesburg" - }, - "course2": { - "id": "CFeedbackEditUiT.CS1101", - "name": "Programming Methodology", - "timeZone": "Africa/Johannesburg" - }, - "testingSanitizationCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "CFeedbackEditUiT.idOfTSCourse", - "name": "Testing", - "timeZone": "Africa/Johannesburg" - }, - "courseWithDstTimeZone": { - "id": "CFeedbackEditUiT.idOfDstCourse", - "name": "Course with daylight saving time zone", - "timeZone": "Australia/Victoria" - } - }, - "instructors": { - "teammates.test.instructor": { - "googleId": "CFeedbackEditUiT.instructor", - "courseId": "CFeedbackEditUiT.CS2104", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2": { - "googleId": "CFeedbackEditUiT.instructor2", - "courseId": "CFeedbackEditUiT.CS2104", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor3": { - "googleId": "CFeedbackEditUiT.instructor3", - "courseId": "CFeedbackEditUiT.CS1101", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "CFeedbackEditUiT.instructor1OfTSCourse", - "courseId": "CFeedbackEditUiT.idOfTSCourse", - "name": "Instructor", - "email": "CFeedbackEditUiT.instructor1@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfDstCourse": { - "googleId": "CFeedbackEditUiT.instructorOfDstCourse", - "courseId": "CFeedbackEditUiT.idOfDstCourse", - "name": "Instructor DST", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "alice.tmms@CFeedbackEditUiT.CS2104": { - "googleId": "CFeedbackEditUiT.alice.tmms", - "email": "alice.b.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "benny.tmms@CFeedbackEditUiT.CS2104": { - "googleId": "CFeedbackEditUiT.benny.tmms", - "email": "benny.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "charlie.tmms@CFeedbackEditUiT.CS1101": { - "googleId": "charlie.tmms", - "email": "CFeedbackEditUiT.charlie.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS1101", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "danny.tmms@CFeedbackEditUiT.CS1101": { - "googleId": "danny.tmms", - "email": "CFeedbackEditUiT.danny.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS1101", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - } - }, - "feedbackSessions": { - "openSession": { - "feedbackSessionName": "First Session", - "courseId": "CFeedbackEditUiT.CS2104", - "creatorEmail": "tmms.test@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2026-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2026-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "openSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFeedbackEditUiT.CS2104", - "creatorEmail": "tmms.test@gmail.tmt", - "instructions": "Instructions for Second session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2026-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2026-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "openSession3": { - "feedbackSessionName": "Third Session", - "courseId": "CFeedbackEditUiT.CS1101", - "creatorEmail": "tmms.test@gmail.tmt", - "instructions": "Instructions for Third session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2026-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2026-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session1InTestingSanitizationCourse": { - "feedbackSessionName": "Normal feedback session name", - "courseId": "CFeedbackEditUiT.idOfTSCourse", - "creatorEmail": "CFeedbackEditUiT.instructor1@sanitization.tmt", - "instructions": "unclosed tags Attempted script injection '\" ", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "dstSession": { - "feedbackSessionName": "DST Session", - "courseId": "CFeedbackEditUiT.idOfDstCourse", - "creatorEmail": "tmms.test@gmail.tmt", - "instructions": "Instructions for DST session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2026-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2026-05-01T21:59:00Z", - "timeZone": "Australia/Victoria", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1InTestingSanitizationCourse": { - "feedbackSessionName": "Normal feedback session name", - "courseId": "CFeedbackEditUiT.idOfTSCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Testing quotation marks '\" Testing unclosed tags Testing script injection " - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorFeedbackEditQuestionsUiTest.json b/src/test/resources/data/InstructorFeedbackEditQuestionsUiTest.json deleted file mode 100644 index a8704d3128f..00000000000 --- a/src/test/resources/data/InstructorFeedbackEditQuestionsUiTest.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "accounts": { - "instructorWithSessions": { - "googleId": "CFeedbackEditUiT.instructor", - "name": "Teammates Test", - "isInstructor": true, - "email": "tmms.test@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "otherInstructor": { - "googleId": "CFeedbackEditUiT.instructor2", - "name": "Instructor 2", - "isInstructor": true, - "email": "tmms.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "alice.tmms": { - "googleId": "CFeedbackEditUiT.alice.tmms", - "name": "Alice Betsy", - "isInstructor": false, - "email": "alice.b.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "course": { - "id": "CFeedbackEditUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "course2": { - "id": "CFeedbackEditUiT.CS1101", - "name": "Programming Methodology", - "timeZone": "UTC" - } - }, - "instructors": { - "teammates.test.instructor": { - "googleId": "CFeedbackEditUiT.instructor", - "courseId": "CFeedbackEditUiT.CS2104", - "name": "Teammates Test", - "email": "tmms.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2": { - "googleId": "CFeedbackEditUiT.instructor2", - "courseId": "CFeedbackEditUiT.CS2104", - "name": "Instructor 2", - "email": "tmms.instr@course.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "alice.tmms@CFeedbackEditUiT.CS2104": { - "googleId": "CFeedbackEditUiT.alice.tmms", - "email": "alice.b.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "benny.tmms@CFeedbackEditUiT.CS2104": { - "googleId": "CFeedbackEditUiT.benny.tmms", - "email": "benny.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "charlie.tmms@CFeedbackEditUiT.CS1101": { - "googleId": "charlie.tmms", - "email": "CFeedbackEditUiT.charlie.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS1101", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "danny.tmms@CFeedbackEditUiT.CS1101": { - "googleId": "danny.tmms", - "email": "CFeedbackEditUiT.danny.tmms@gmail.tmt", - "course": "CFeedbackEditUiT.CS1101", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - } - }, - "feedbackSessions": { - "openSession": { - "feedbackSessionName": "First Session", - "courseId": "CFeedbackEditUiT.CS2104", - "creatorEmail": "tmms.test@gmail.tmt", - "instructions": "Please fill in the edited feedback session.", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2026-05-01T20:00:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2026-05-01T20:00:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 30, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorFeedbackQuestionSubmitPageUiTest.json b/src/test/resources/data/InstructorFeedbackQuestionSubmitPageUiTest.json deleted file mode 100644 index 9f56310d616..00000000000 --- a/src/test/resources/data/InstructorFeedbackQuestionSubmitPageUiTest.json +++ /dev/null @@ -1,336 +0,0 @@ -{ - "accounts": { - "IFQSubmitUiT.instr": { - "googleId": "IFQSubmitUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "IFQSubmitUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFQSubmitUiT.instr2": { - "googleId": "IFQSubmitUiT.instr2", - "name": "Teammates Test2", - "isInstructor": true, - "email": "IFQSubmitUiT.instr2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFQSubmitUiT.instr3": { - "googleId": "IFQSubmitUiT.instr3", - "name": "Teammates Test3", - "isInstructor": true, - "email": "IFQSubmitUiT.instr3@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFQSubmitUiT.instr4": { - "googleId": "IFQSubmitUiT.instr4", - "name": "Teammates Test4", - "isInstructor": true, - "email": "IFQSubmitUiT.instr4@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFQSubmitUiT.instr5": { - "googleId": "IFQSubmitUiT.instr5", - "name": "Teammates Test5", - "isInstructor": true, - "email": "IFQSubmitUiT.instr5@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "IFQSubmitUiT.CS2104": { - "id": "IFQSubmitUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - } - }, - "instructors": { - "IFQSubmitUiT.instr": { - "googleId": "IFQSubmitUiT.instr", - "courseId": "IFQSubmitUiT.CS2104", - "name": "Teammates Test", - "email": "IFQSubmitUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFQSubmitUiT.instr2": { - "googleId": "IFQSubmitUiT.instr2", - "courseId": "IFQSubmitUiT.CS2104", - "name": "Teammates Test2", - "email": "IFQSubmitUiT.instr2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFQSubmitUiT.instr3": { - "googleId": "IFQSubmitUiT.instr3", - "courseId": "IFQSubmitUiT.CS2104", - "name": "Teammates Test3", - "email": "IFQSubmitUiT.instr3@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFQSubmitUiT.instr4": { - "googleId": "IFQSubmitUiT.instr4", - "courseId": "IFQSubmitUiT.CS2104", - "name": "Teammates Test4", - "email": "IFQSubmitUiT.instr4@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFQSubmitUiT.instr5": { - "googleId": "IFQSubmitUiT.instr5", - "courseId": "IFQSubmitUiT.CS2104", - "name": "Teammates Test5", - "email": "IFQSubmitUiT.instr5@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": {}, - "feedbackSessions": { - "Open Session": { - "feedbackSessionName": "Open Session", - "courseId": "IFQSubmitUiT.CS2104", - "creatorEmail": "IFQSubmitUiT.instr@gmail.tmt", - "instructions": "Instructions for Open Session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Grace Period Session": { - "feedbackSessionName": "Grace Period Session", - "courseId": "IFQSubmitUiT.CS2104", - "creatorEmail": "IFQSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2012-04-02T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 1440000, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Closed Session": { - "feedbackSessionName": "Closed Session", - "courseId": "IFQSubmitUiT.CS2104", - "creatorEmail": "IFQSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2026-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Awaiting Session": { - "feedbackSessionName": "Awaiting Session", - "courseId": "IFQSubmitUiT.CS2104", - "creatorEmail": "IFQSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the last feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2035-04-02T15:59:00Z", - "endTime": "2036-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2035-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1": { - "feedbackSessionName": "Open Session", - "courseId": "IFQSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2": { - "feedbackSessionName": "Closed Session", - "courseId": "IFQSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession3": { - "feedbackSessionName": "Awaiting Session", - "courseId": "IFQSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "graceperiod.session.feedback": { - "feedbackSessionName": "Grace Period Session", - "courseId": "IFQSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to yourself." - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - } - }, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorFeedbackResultsPageResponseCommentUiTest.json b/src/test/resources/data/InstructorFeedbackResultsPageResponseCommentUiTest.json deleted file mode 100644 index dd73eb826c4..00000000000 --- a/src/test/resources/data/InstructorFeedbackResultsPageResponseCommentUiTest.json +++ /dev/null @@ -1,1876 +0,0 @@ -{ - "accounts": { - "IFRResponseCommentUiT.instr": { - "googleId": "IFRResponseCommentUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "IFRResponseCommentUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.instr2": { - "googleId": "IFRResponseCommentUiT.instr2", - "name": "Teammates Test2", - "isInstructor": true, - "email": "IFRResponseCommentUiT.instr2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.helper1": { - "googleId": "IFRResponseCommentUiT.helper1", - "name": "Teammates Helper", - "isInstructor": true, - "email": "IFRResponseCommentUiT.helper1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.helper2": { - "googleId": "IFRResponseCommentUiT.helper2", - "name": "Teammates Helper", - "isInstructor": true, - "email": "IFRResponseCommentUiT.helper2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.alice.b": { - "googleId": "IFRResponseCommentUiT.alice.b", - "name": "Alice B.", - "isInstructor": false, - "email": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.benny.c": { - "googleId": "IFRResponseCommentUiT.benny.c", - "name": "Benny C.", - "isInstructor": false, - "email": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.charlie.d": { - "googleId": "IFRResponseCommentUiT.charlie.d", - "name": "Charlie D.", - "isInstructor": false, - "email": "IFRResponseCommentUiT.charlie.d@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.danny.e": { - "googleId": "IFRResponseCommentUiT.danny.e", - "name": "Danny E.", - "isInstructor": false, - "email": "IFRResponseCommentUiT.danny.e@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.emily.f": { - "googleId": "IFRResponseCommentUiT.emily.f", - "name": "Emily F.", - "isInstructor": false, - "email": "IFRResponseCommentUiT.emily.f@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFRResponseCommentUiT.fred.g": { - "googleId": "IFRResponseCommentUiT.fred.g", - "name": "Fred Gabriel", - "isInstructor": false, - "email": "IFRResponseCommentUiT.fred.g@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "IFRResponseCommentUiT.CS2104": { - "id": "IFRResponseCommentUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "IFRResponseCommentUiT.SanitizedTeam": { - "id": "IFRResponseCommentUiT.SanitizedTeam", - "name": "Sanization Concepts", - "timeZone": "UTC" - }, - "IFRResponseCommentUiT.NoSections": { - "id": "IFRResponseCommentUiT.NoSections", - "name": "NoSection Course", - "timeZone": "UTC" - } - }, - "instructors": { - "IFRResponseCommentUiT.instr": { - "googleId": "IFRResponseCommentUiT.instr", - "courseId": "IFRResponseCommentUiT.CS2104", - "name": "Teammates Test", - "email": "IFRResponseCommentUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFRResponseCommentUiT.instr2": { - "googleId": "IFRResponseCommentUiT.instr2", - "courseId": "IFRResponseCommentUiT.CS2104", - "name": "Teammates Test2", - "email": "IFRResponseCommentUiT.instr2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFRResponseCommentUiT.helper1": { - "googleId": "IFRResponseCommentUiT.helper1", - "courseId": "IFRResponseCommentUiT.CS2104", - "name": "Teammates Helper1", - "email": "IFRResponseCommentUiT.helper1@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section B": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": {} - } - }, - "IFRResponseCommentUiT.helper2": { - "googleId": "IFRResponseCommentUiT.helper2", - "courseId": "IFRResponseCommentUiT.CS2104", - "name": "Teammates Helper2", - "email": "IFRResponseCommentUiT.helper2@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section A": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": {} - } - }, - "IFRResponseCommentUiT.SanitizedTeam.instr": { - "googleId": "IFRResponseCommentUiT.instr", - "courseId": "IFRResponseCommentUiT.SanitizedTeam", - "name": "Instructor", - "email": "IFRResponseCommentUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFRResponseCommentUiT.NoSections.instr": { - "googleId": "IFRResponseCommentUiT.instr", - "courseId": "IFRResponseCommentUiT.NoSections", - "name": "Teammates Test", - "email": "IFRResponseCommentUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "Alice": { - "googleId": "IFRResponseCommentUiT.alice.b", - "email": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "Section A" - }, - "Benny": { - "googleId": "IFRResponseCommentUiT.benny.c", - "email": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "Section A" - }, - "Fred": { - "googleId": "IFRResponseCommentUiT.fred.g", - "email": "IFRResponseCommentUiT.fred.g@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Fred Gabriel", - "comments": "This student's name is Fred Gabriel", - "team": "Team 1'\"", - "section": "Section A" - }, - "ExtraGuy": { - "googleId": "extra.guy", - "email": "extra.guy@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Extra guy", - "comments": "This student will move to a new team after evaluation created", - "team": "Team 2", - "section": "Section A" - }, - "DropOut": { - "googleId": "", - "email": "drop.out@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Drop out", - "comments": "This student will drop out after evaluation created", - "team": "Team 2", - "section": "Section A" - }, - "Charlie": { - "googleId": "IFRResponseCommentUiT.charlie.d", - "email": "IFRResponseCommentUiT.charlie.d@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Charlie Dávis", - "comments": "This student's name is Charlie Dávis", - "team": "Team 2", - "section": "Section A" - }, - "Danny": { - "googleId": "IFRResponseCommentUiT.danny.e", - "email": "IFRResponseCommentUiT.danny.e@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "Section A" - }, - "Emily": { - "googleId": "IFRResponseCommentUiT.emily.f", - "email": "IFRResponseCommentUiT.emily.f@gmail.tmt", - "course": "IFRResponseCommentUiT.CS2104", - "name": "Emily", - "comments": "This student's name is Emily", - "team": "Team 3", - "section": "Section B" - }, - "Sanitized.Alice": { - "googleId": "IFRResponseCommentUiT.alice.b", - "email": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "course": "IFRResponseCommentUiT.SanitizedTeam", - "name": "Alic'e Bets'y'\"", - "comments": "This student's name is Alic'e Bets'y'\"", - "team": "Team '1'\"", - "section": "Section A'\"" - }, - "Sanitized.Benny": { - "googleId": "IFRResponseCommentUiT.benny.c", - "email": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "course": "IFRResponseCommentUiT.SanitizedTeam", - "name": "Benn'y Charle's", - "comments": "This student's name is Benn'y Charle's'\"", - "team": "Team '1'\"", - "section": "Section A'\"" - }, - "NoSections.Benny": { - "googleId": "IFRResponseCommentUiT.benny.no", - "email": "IFRResponseCommentUiT.benny.no@gmail.tmt", - "course": "IFRResponseCommentUiT.NoSections", - "name": "Benn'y Charle's", - "comments": "This student's name is Benn'y Charle's'\"", - "team": "Team '1'\"", - "section": "None" - } - }, - "feedbackSessions": { - "Open Session": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "creatorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Unpublished Session": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "creatorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Empty Session": { - "feedbackSessionName": "Third Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "creatorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "instructions": "Please please fill in the last feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with errors": { - "feedbackSessionName": "Fourth Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "creatorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "instructions": "This session has errors", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with sanitized data": { - "feedbackSessionName": "Sanitized Session", - "courseId": "IFRResponseCommentUiT.SanitizedTeam", - "creatorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "instructions": "This session has errors", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with no sections": { - "feedbackSessionName": "NoSections Session", - "courseId": "IFRResponseCommentUiT.NoSections", - "creatorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "instructions": "This session has errors", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with Instructors as Givers": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "IFRResponseCommentUiT.CS2104", - "creatorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "instructions": "Session with Instructors as Givers", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InNoSectionsSession": { - "feedbackSessionName": "NoSections Session", - "courseId": "IFRResponseCommentUiT.NoSections", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Dummy question for NoSections course session" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn1InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 3 other students' products" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn2InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn3InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "My comments on the class" - }, - "questionNumber": 3, - "giverType": "SELF", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [], - "showGiverNameTo": [], - "showRecipientNameTo": [] - }, - "qn4InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 3 other teams." - }, - "questionNumber": 4, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn5InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your team mates" - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn6InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should be hidden." - }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn7InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 4, - "mcqChoices": [ - "FlexiCommand", - "PowerSearch", - "GoodUI", - "Google Integration" - ], - "questionText": "What is your extra feature?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 7, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn8InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "FlexiCommand", - "PowerSearch", - "GoodUI", - "Google Integration" - ], - "questionText": "What is your extra feature?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 8, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn9InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionText": "Who do you think is the most hardworking student?", - "questionType": "MCQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 9, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn10InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionText": "Which team do you think has the best feature?", - "questionType": "MCQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 10, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionText": "Who are your teammates?", - "questionType": "MSQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn3InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionText": "Which teams do you like?", - "questionType": "MSQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn4InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate our product.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn5InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "pointsPerOption": false, - "questionText": "How important are the following factors to you? Give points accordingly.", - "numOfConstSumOptions": 2, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Grades", - "Fun" - ] - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn6InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "pointsPerOption": true, - "questionText": "Split points among the your team members and yourself, according to how much you think each member has contributed.", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 6, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn7InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution of yourself and your team members towards the latest project.", - "questionType": "CONTRIB" - }, - "questionNumber": 7, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "RECEIVER_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn8InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate you and your team members work.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 8, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [] - }, - "qn9InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate the class", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.25 - }, - "questionNumber": 9, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn10InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution of ideas from yourself and your team members in the last meeting.", - "questionType": "CONTRIB" - }, - "questionNumber": 10, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "RECEIVER_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [] - }, - "qn11InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "As a team, what do you think could have been done differently?" - }, - "questionNumber": 11, - "giverType": "TEAMS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn12InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "minScale": 0, - "questionText": "Rate the class as a team", - "questionType": "NUMSCALE", - "maxScale": 1000, - "step": 5 - }, - "questionNumber": 12, - "giverType": "TEAMS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession4": { - "feedbackSessionName": "Fourth Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "As a team, what do you think could have been done differently?" - }, - "questionNumber": 1, - "giverType": "TEAMS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession4": { - "feedbackSessionName": "Fourth Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "pointsPerOption": true, - "questionText": "Split points among the your team members and yourself, according to how much you think each member has contributed.", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 2, - "giverType": "TEAMS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [] - }, - "qn1InSanitizedSession": { - "feedbackSessionName": "Sanitized Session", - "courseId": "IFRResponseCommentUiT.SanitizedTeam", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Some question text. Testing quotation marks '\" Testing unclosed tags Testing script injection " - }, - "questionDescription": "

    Some question description.

    a link attempted script injection ", - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "RECEIVER_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InInstructorsAsGivers": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 3 other students' products" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "STUDENTS", - "RECEIVER" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS", - "RECEIVER" - ] - }, - "qn11InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This is a dummy question to test default sort" - }, - "questionNumber": 11, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - } - }, - "feedbackResponses": { - "response1": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice self feedback." - } - }, - "response2": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "2 Response to Benny." - } - }, - "response3": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "recipient": "IFRResponseCommentUiT.danny.e@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "1 Response to Danny." - } - }, - "response3a": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "drop.out@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Dropout." - } - }, - "response3b": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "drop.out@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Alice from Dropout." - } - }, - "response3c": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "drop.out@gmail.tmt", - "recipient": "IFRResponseCommentUiT.danny.e@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Danny from Dropout." - } - }, - "response3d": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "drop.out@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Benny from Dropout." - } - }, - "response4": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.charlie.d@gmail.tmt", - "recipient": "IFRResponseCommentUiT.emily.f@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section B", - "responseDetails": { - "questionType": "TEXT", - "answer": "3 Response to Emily." - } - }, - "response5": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "recipient": "IFRResponseCommentUiT.charlie.d@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "4 Response to Charlie." - } - }, - "response5b": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.fred.g@gmail.tmt", - "recipient": "IFRResponseCommentUiT.charlie.d@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Fred's Response to Charlie." - } - }, - "response6": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "PowerSearch", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse6a": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "drop.out@gmail.tmt", - "recipient": "drop.out@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "PowerSearch", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "response7": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "PowerSearch", - "GoodUI" - ], - "questionType": "MSQ" - } - }, - "response8": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "" - ], - "questionType": "MSQ" - } - }, - "response9": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "9", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "Danny", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "response10": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "Team 1", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse10a": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "drop.out@gmail.tmt", - "recipient": "drop.out@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "Team 2", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "responseForTEAMQuestion": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "Team 1'\"", - "recipient": "Team 1'\"", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from benny to Team 1 (own team)" - } - }, - "responseForTEAMQuestion2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "12", - "giver": "Team 1'\"", - "recipient": "%GENERAL%", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "answer": 0, - "questionType": "NUMSCALE" - } - }, - "response11": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "Danny" - ], - "otherFieldContent": "", - "questionType": "MSQ" - } - }, - "response12": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "Team 1", - "Team 2" - ], - "otherFieldContent": "", - "questionType": "MSQ" - } - }, - "response13": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 3.5, - "questionType": "NUMSCALE" - } - }, - "response14": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "IFRResponseCommentUiT.instr@gmail.tmt", - "recipient": "%GENERAL%", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "This is for nobody specific." - } - }, - "response15": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "Team 2", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from team 1 (by alice) to team 2." - } - }, - "response16": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 45, - 55 - ], - "questionType": "CONSTSUM" - } - }, - "response17.1": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 110 - ], - "questionType": "CONSTSUM" - } - }, - "response17.2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 90 - ], - "questionType": "CONSTSUM" - } - }, - "response17.3": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.charlie.d@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 50 - ], - "questionType": "CONSTSUM" - } - }, - "response17.4": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.danny.e@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 150 - ], - "questionType": "CONSTSUM" - } - }, - "FS.Q1.Alice.1": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 150, - "questionType": "CONTRIB" - } - }, - "FS.Q1.Alice.2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 120, - "questionType": "CONTRIB" - } - }, - "response17": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 3, - "questionType": "NUMSCALE" - } - }, - "response18": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 4, - "questionType": "NUMSCALE" - } - }, - "response19": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "9", - "giver": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "recipient": "%GENERAL%", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "answer": -0.5, - "questionType": "NUMSCALE" - } - }, - "response20.1": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 150, - "questionType": "CONTRIB" - } - }, - "repsonse20.2": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 120, - "questionType": "CONTRIB" - } - }, - "response21": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.fred.g@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice to Danny." - } - }, - "response22": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "IFRResponseCommentUiT.danny.e@gmail.tmt", - "recipient": "IFRResponseCommentUiT.fred.g@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Benny to Danny." - } - }, - "response23": { - "feedbackSessionName": "First Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "IFRResponseCommentUiT.fred.g@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Danny to Alice." - } - }, - "response1 Of Session 4": { - "feedbackSessionName": "Fourth Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "Team 1'\"", - "recipient": "%GENERAL%", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "None" - } - }, - "response2 Of Session 4": { - "feedbackSessionName": "Fourth Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "Team 1'\"", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "answers": [ - 50 - ], - "questionType": "CONSTSUM" - } - }, - "SanitizedResponse1": { - "feedbackSessionName": "Sanitized Session", - "courseId": "IFRResponseCommentUiT.SanitizedTeam", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "giverSection": "Section A'\"", - "recipientSection": "Section A'\"", - "responseDetails": { - "questionType": "TEXT", - "answer": "

    Some response to text question.

    a link attempted script injection " - } - }, - "InstructorsAsGiversResponse1": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.instr@gmail.tmt", - "recipient": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice you did okay. You get B-" - } - }, - "InstructorsAsGiversResponse2": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.instr@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.c@gmail.tmt", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "You did better than Alice. You get C+" - } - }, - "InstructorsAsGiversResponse3": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.instr@gmail.tmt", - "recipient": "IFRResponseCommentUiT.charlie.d@gmail.tmt", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "I like you so I give you above A-" - } - }, - "NoSectionsResponse1": { - "feedbackSessionName": "NoSections Session", - "courseId": "IFRResponseCommentUiT.NoSections", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.benny.no@gmail.tmt", - "recipient": "IFRResponseCommentUiT.benny.no@gmail.tmt", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "Benny self feedback." - } - }, - "Response to Instructors": { - "feedbackSessionName": "Second Session", - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "IFRResponseCommentUiT.alice.b@gmail.tmt", - "recipient": "IFRResponseCommentUiT.instr@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "You are a great instructor." - } - } - }, - "feedbackResponseComments": { - "comment1ForSanitizedTeam": { - "courseId": "IFRResponseCommentUiT.SanitizedTeam", - "feedbackSessionName": "Sanitized Session", - "feedbackQuestionId": "1", - "commentGiver": "IFRResponseCommentUiT.instr@gmail.tmt", - "giverSection": "None", - "receiverSection": "Section A'\"", - "feedbackResponseId": "1%IFRResponseCommentUiT.alice.b@gmail.tmt%IFRResponseCommentUiT.benny.c@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-01T23:59:00Z", - "lastEditorEmail": "IFRResponseCommentUiT.instr@gmail.tmt", - "lastEditedAt": "2026-03-02T23:59:00Z", - "commentText": "

    Some comment from instructor

    a link attempted script injection " - }, - "comment2ToBeEditedByDifferentInstructor": { - "courseId": "IFRResponseCommentUiT.CS2104", - "feedbackSessionName": "First Session", - "feedbackQuestionId": "2", - "commentGiver": "IFRResponseCommentUiT.instr2@gmail.tmt", - "giverSection": "Section A", - "receiverSection": "Section A", - "feedbackResponseId": "2%IFRResponseCommentUiT.alice.b@gmail.tmt%IFRResponseCommentUiT.alice.b@gmail.tmt", - "showCommentTo": [ - "GIVER", - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "GIVER", - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2012-04-02T23:59:00Z", - "lastEditorEmail": "IFRResponseCommentUiT.instr2@gmail.tmt", - "lastEditedAt": "2012-04-02T23:59:00Z", - "commentText": "Comment to be edited by different instructor." - } - }, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorFeedbackResultsPageUiTest.json b/src/test/resources/data/InstructorFeedbackResultsPageUiTest.json deleted file mode 100644 index b12fe57ca11..00000000000 --- a/src/test/resources/data/InstructorFeedbackResultsPageUiTest.json +++ /dev/null @@ -1,1892 +0,0 @@ -{ - "accounts": { - "CFResultsUiT.instr": { - "googleId": "CFResultsUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "CFResultsUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.instr2": { - "googleId": "CFResultsUiT.instr2", - "name": "Teammates Test2", - "isInstructor": true, - "email": "CFResultsUiT.instr2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.helper1": { - "googleId": "CFResultsUiT.helper1", - "name": "Teammates Helper", - "isInstructor": true, - "email": "CFResultsUiT.helper1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.helper2": { - "googleId": "CFResultsUiT.helper2", - "name": "Teammates Helper", - "isInstructor": true, - "email": "CFResultsUiT.helper2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.alice.b": { - "googleId": "CFResultsUiT.alice.b", - "name": "Alice B.", - "isInstructor": false, - "email": "CFResultsUiT.alice.b@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.benny.c": { - "googleId": "CFResultsUiT.benny.c", - "name": "Benny C.", - "isInstructor": false, - "email": "CFResultsUiT.benny.c@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.charlie.d": { - "googleId": "CFResultsUiT.charlie.d", - "name": "Charlie D.", - "isInstructor": false, - "email": "CFResultsUiT.charlie.d@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.danny.e": { - "googleId": "CFResultsUiT.danny.e", - "name": "Danny E.", - "isInstructor": false, - "email": "CFResultsUiT.danny.e@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.emily.f": { - "googleId": "CFResultsUiT.emily.f", - "name": "Emily F.", - "isInstructor": false, - "email": "CFResultsUiT.emily.f@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "CFResultsUiT.fred.g": { - "googleId": "CFResultsUiT.fred.g", - "name": "Fred Gabriel", - "isInstructor": false, - "email": "CFResultsUiT.fred.g@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "CFResultsUiT.CS2104": { - "id": "CFResultsUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "CFResultsUiT.SanitizedTeam": { - "id": "CFResultsUiT.SanitizedTeam", - "name": "Sanization Concepts", - "timeZone": "UTC" - }, - "CFResultsUiT.NoSections": { - "id": "CFResultsUiT.NoSections", - "name": "NoSection Course", - "timeZone": "UTC" - } - }, - "instructors": { - "CFResultsUiT.instr": { - "googleId": "CFResultsUiT.instr", - "courseId": "CFResultsUiT.CS2104", - "name": "Teammates Test", - "email": "CFResultsUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CFResultsUiT.instr2": { - "googleId": "CFResultsUiT.instr2", - "courseId": "CFResultsUiT.CS2104", - "name": "Teammates Test2", - "email": "CFResultsUiT.instr2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CFResultsUiT.helper1": { - "googleId": "CFResultsUiT.helper1", - "courseId": "CFResultsUiT.CS2104", - "name": "Teammates Helper1", - "email": "CFResultsUiT.helper1@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section B": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": {} - } - }, - "CFResultsUiT.helper2": { - "googleId": "CFResultsUiT.helper2", - "courseId": "CFResultsUiT.CS2104", - "name": "Teammates Helper2", - "email": "CFResultsUiT.helper2@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": { - "Section A": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canviewsessioninsection": true - } - }, - "sessionLevel": {} - } - }, - "CFResultsUiT.SanitizedTeam.instr": { - "googleId": "CFResultsUiT.instr", - "courseId": "CFResultsUiT.SanitizedTeam", - "name": "Instructor", - "email": "CFResultsUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CFResultsUiT.NoSections.instr": { - "googleId": "CFResultsUiT.instr", - "courseId": "CFResultsUiT.NoSections", - "name": "Teammates Test", - "email": "CFResultsUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "Alice": { - "googleId": "CFResultsUiT.alice.b", - "email": "CFResultsUiT.alice.b@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "Section A" - }, - "Benny": { - "googleId": "CFResultsUiT.benny.c", - "email": "CFResultsUiT.benny.c@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "Section A" - }, - "Fred": { - "googleId": "CFResultsUiT.fred.g", - "email": "CFResultsUiT.fred.g@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Fred Gabriel", - "comments": "This student's name is Fred Gabriel", - "team": "Team 1'\"", - "section": "Section A" - }, - "ExtraGuy": { - "googleId": "extra.guy", - "email": "extra.guy@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Extra guy", - "comments": "This student will move to a new team after evaluation created", - "team": "Team 2", - "section": "Section A" - }, - "DropOut": { - "googleId": "", - "email": "drop.out@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Drop out", - "comments": "This student will drop out after evaluation created", - "team": "Team 2", - "section": "Section A" - }, - "Charlie": { - "googleId": "CFResultsUiT.charlie.d", - "email": "CFResultsUiT.charlie.d@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Charlie Dávis", - "comments": "This student's name is Charlie Dávis", - "team": "Team 2", - "section": "Section A" - }, - "Danny": { - "googleId": "CFResultsUiT.danny.e", - "email": "CFResultsUiT.danny.e@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "Section A" - }, - "Emily": { - "googleId": "CFResultsUiT.emily.f", - "email": "CFResultsUiT.emily.f@gmail.tmt", - "course": "CFResultsUiT.CS2104", - "name": "Emily", - "comments": "This student's name is Emily", - "team": "Team 3", - "section": "Section B" - }, - "Sanitized.Alice": { - "googleId": "CFResultsUiT.alice.b", - "email": "CFResultsUiT.alice.b@gmail.tmt", - "course": "CFResultsUiT.SanitizedTeam", - "name": "Alic'e Bets'y'\"", - "comments": "This student's name is Alic'e Bets'y'\"", - "team": "Team '1'\"", - "section": "Section A'\"" - }, - "Sanitized.Benny": { - "googleId": "CFResultsUiT.benny.c", - "email": "CFResultsUiT.benny.c@gmail.tmt", - "course": "CFResultsUiT.SanitizedTeam", - "name": "Benn'y Charle's", - "comments": "This student's name is Benn'y Charle's'\"", - "team": "Team '1'\"", - "section": "Section A'\"" - }, - "NoSections.Benny": { - "googleId": "CFResultsUiT.benny.no", - "email": "CFResultsUiT.benny.no@gmail.tmt", - "course": "CFResultsUiT.NoSections", - "name": "Benn'y Charle's", - "comments": "This student's name is Benn'y Charle's'\"", - "team": "Team '1'\"", - "section": "None" - } - }, - "feedbackSessions": { - "Open Session": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "creatorEmail": "CFResultsUiT.instr@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Unpublished Session": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "creatorEmail": "CFResultsUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Empty Session": { - "feedbackSessionName": "Third Session", - "courseId": "CFResultsUiT.CS2104", - "creatorEmail": "CFResultsUiT.instr@gmail.tmt", - "instructions": "Please please fill in the last feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with errors": { - "feedbackSessionName": "Fourth Session", - "courseId": "CFResultsUiT.CS2104", - "creatorEmail": "CFResultsUiT.instr@gmail.tmt", - "instructions": "This session has errors", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with sanitized data": { - "feedbackSessionName": "Sanitized Session", - "courseId": "CFResultsUiT.SanitizedTeam", - "creatorEmail": "CFResultsUiT.instr@gmail.tmt", - "instructions": "This session has errors", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with no sections": { - "feedbackSessionName": "NoSections Session", - "courseId": "CFResultsUiT.NoSections", - "creatorEmail": "CFResultsUiT.instr@gmail.tmt", - "instructions": "This session has errors", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Session with Instructors as Givers": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "CFResultsUiT.CS2104", - "creatorEmail": "CFResultsUiT.instr@gmail.tmt", - "instructions": "Session with Instructors as Givers", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InNoSectionsSession": { - "feedbackSessionName": "NoSections Session", - "courseId": "CFResultsUiT.NoSections", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Dummy question for NoSections course session" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn1InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 3 other students' products" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn2InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn3InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "My comments on the class" - }, - "questionNumber": 3, - "giverType": "SELF", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [], - "showGiverNameTo": [], - "showRecipientNameTo": [] - }, - "qn4InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 3 other teams." - }, - "questionNumber": 4, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn5InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your team mates" - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn6InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should be hidden." - }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn7InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 4, - "mcqChoices": [ - "FlexiCommand", - "PowerSearch", - "GoodUI", - "Google Integration" - ], - "questionText": "What is your extra feature?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 7, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn8InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "FlexiCommand", - "PowerSearch", - "GoodUI", - "Google Integration" - ], - "questionText": "What is your extra feature?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 8, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn9InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Who do you think is the most hardworking student?", - "questionType": "MCQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 9, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn10InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Which team do you think has the best feature?", - "questionType": "MCQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 10, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Who are your teammates?", - "questionType": "MSQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn3InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Which teams do you like?", - "questionType": "MSQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn4InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate our product.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn5InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "pointsPerOption": false, - "questionText": "How important are the following factors to you? Give points accordingly.", - "numOfConstSumOptions": 2, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Grades", - "Fun" - ] - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn6InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "pointsPerOption": true, - "questionText": "Split points among the your team members and yourself, according to how much you think each member has contributed.", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 6, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn7InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution of yourself and your team members towards the latest project.", - "questionType": "CONTRIB" - }, - "questionNumber": 7, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "RECEIVER_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "INSTRUCTORS" - ] - }, - "qn8InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate you and your team members work.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 8, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [] - }, - "qn9InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate the class", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.25 - }, - "questionNumber": 9, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn10InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution of ideas from yourself and your team members in the last meeting.", - "questionType": "CONTRIB" - }, - "questionNumber": 10, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "RECEIVER_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [] - }, - "qn11InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "As a team, what do you think could have been done differently?" - }, - "questionNumber": 11, - "giverType": "TEAMS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn12InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "minScale": 0, - "questionText": "Rate the class as a team", - "questionType": "NUMSCALE", - "maxScale": 1000, - "step": 5 - }, - "questionNumber": 12, - "giverType": "TEAMS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession4": { - "feedbackSessionName": "Fourth Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "As a team, what do you think could have been done differently?" - }, - "questionNumber": 1, - "giverType": "TEAMS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession4": { - "feedbackSessionName": "Fourth Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "pointsPerOption": true, - "questionText": "Split points among the your team members and yourself, according to how much you think each member has contributed.", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 2, - "giverType": "TEAMS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [] - }, - "qn1InSanitizedSession": { - "feedbackSessionName": "Sanitized Session", - "courseId": "CFResultsUiT.SanitizedTeam", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Some question text. Testing quotation marks '\" Testing unclosed tags Testing script injection " - }, - "questionDescription": "

    Some question description.

    a link attempted script injection ", - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "RECEIVER_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InInstructorsAsGivers": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 3 other students' products" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "STUDENTS", - "RECEIVER" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS", - "RECEIVER" - ] - }, - "qn11InSession1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This is a dummy question to test default sort" - }, - "questionNumber": 11, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - } - }, - "feedbackResponses": { - "response1": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice self feedback." - } - }, - "response2": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "2 Response to Benny." - } - }, - "response3": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.benny.c@gmail.tmt", - "recipient": "CFResultsUiT.danny.e@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "1 Response to Danny." - } - }, - "response3a": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "drop.out@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Dropout." - } - }, - "response3b": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "drop.out@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Alice from Dropout." - } - }, - "response3c": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "drop.out@gmail.tmt", - "recipient": "CFResultsUiT.danny.e@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Danny from Dropout." - } - }, - "response3d": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "drop.out@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Benny from Dropout." - } - }, - "response4": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.charlie.d@gmail.tmt", - "recipient": "CFResultsUiT.emily.f@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section B", - "responseDetails": { - "questionType": "TEXT", - "answer": "3 Response to Emily." - } - }, - "response5": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.benny.c@gmail.tmt", - "recipient": "CFResultsUiT.charlie.d@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "4 Response to Charlie." - } - }, - "response5b": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.fred.g@gmail.tmt", - "recipient": "CFResultsUiT.charlie.d@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Fred's Response to Charlie." - } - }, - "response6": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "PowerSearch", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse6a": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "drop.out@gmail.tmt", - "recipient": "drop.out@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "PowerSearch", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "response7": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "PowerSearch", - "GoodUI" - ], - "questionType": "MSQ" - } - }, - "response8": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "CFResultsUiT.benny.c@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "" - ], - "questionType": "MSQ" - } - }, - "response9": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "9", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "Danny", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "response10": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "Team 1", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse10a": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "drop.out@gmail.tmt", - "recipient": "drop.out@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": "Team 2", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "responseForTEAMQuestion": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "Team 1'\"", - "recipient": "Team 1'\"", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from benny to Team 1 (own team)" - } - }, - "responseForTEAMQuestion2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "12", - "giver": "Team 1'\"", - "recipient": "%GENERAL%", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "answer": 0, - "questionType": "NUMSCALE" - } - }, - "response11": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "Danny" - ], - "otherFieldContent": "", - "questionType": "MSQ" - } - }, - "response12": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - "Team 1", - "Team 2" - ], - "otherFieldContent": "", - "questionType": "MSQ" - } - }, - "response13": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 3.5, - "questionType": "NUMSCALE" - } - }, - "response14": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "CFResultsUiT.instr@gmail.tmt", - "recipient": "%GENERAL%", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "This is for nobody specific." - } - }, - "response15": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "Team 2", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from team 1 (by alice) to team 2." - } - }, - "response16": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 45, - 55 - ], - "questionType": "CONSTSUM" - } - }, - "response17.1": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 110 - ], - "questionType": "CONSTSUM" - } - }, - "response17.2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 90 - ], - "questionType": "CONSTSUM" - } - }, - "response17.3": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.charlie.d@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 50 - ], - "questionType": "CONSTSUM" - } - }, - "response17.4": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.danny.e@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answers": [ - 150 - ], - "questionType": "CONSTSUM" - } - }, - "FS.Q1.Alice.1": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 150, - "questionType": "CONTRIB" - } - }, - "FS.Q1.Alice.2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 120, - "questionType": "CONTRIB" - } - }, - "response17": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 3, - "questionType": "NUMSCALE" - } - }, - "response18": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 4, - "questionType": "NUMSCALE" - } - }, - "response19": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "9", - "giver": "CFResultsUiT.benny.c@gmail.tmt", - "recipient": "%GENERAL%", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "answer": -0.5, - "questionType": "NUMSCALE" - } - }, - "response20.1": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 150, - "questionType": "CONTRIB" - } - }, - "repsonse20.2": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "answer": 120, - "questionType": "CONTRIB" - } - }, - "response21": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.fred.g@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice to Danny." - } - }, - "response22": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "CFResultsUiT.danny.e@gmail.tmt", - "recipient": "CFResultsUiT.fred.g@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Benny to Danny." - } - }, - "response23": { - "feedbackSessionName": "First Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "11", - "giver": "CFResultsUiT.fred.g@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Danny to Alice." - } - }, - "response1 Of Session 4": { - "feedbackSessionName": "Fourth Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "Team 1'\"", - "recipient": "%GENERAL%", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "None" - } - }, - "response2 Of Session 4": { - "feedbackSessionName": "Fourth Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "Team 1'\"", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "answers": [ - 50 - ], - "questionType": "CONSTSUM" - } - }, - "SanitizedResponse1": { - "feedbackSessionName": "Sanitized Session", - "courseId": "CFResultsUiT.SanitizedTeam", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "giverSection": "Section A'\"", - "recipientSection": "Section A'\"", - "responseDetails": { - "questionType": "TEXT", - "answer": "

    Some response to text question.

    a link attempted script injection " - } - }, - "InstructorsAsGiversResponse1": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.instr@gmail.tmt", - "recipient": "CFResultsUiT.alice.b@gmail.tmt", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice you did okay. You get B-" - } - }, - "InstructorsAsGiversResponse2": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.instr@gmail.tmt", - "recipient": "CFResultsUiT.benny.c@gmail.tmt", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "You did better than Alice. You get C+" - } - }, - "InstructorsAsGiversResponse3": { - "feedbackSessionName": "Instructors as Givers", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.instr@gmail.tmt", - "recipient": "CFResultsUiT.charlie.d@gmail.tmt", - "recipientSection": "Section A", - "responseDetails": { - "questionType": "TEXT", - "answer": "I like you so I give you above A-" - } - }, - "NoSectionsResponse1": { - "feedbackSessionName": "NoSections Session", - "courseId": "CFResultsUiT.NoSections", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.benny.no@gmail.tmt", - "recipient": "CFResultsUiT.benny.no@gmail.tmt", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "Benny self feedback." - } - }, - "Response to Instructors": { - "feedbackSessionName": "Second Session", - "courseId": "CFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "CFResultsUiT.alice.b@gmail.tmt", - "recipient": "CFResultsUiT.instr@gmail.tmt", - "giverSection": "Section A", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "You are a great instructor." - } - } - }, - "feedbackResponseComments": { - "comment1ForSanitizedTeam": { - "courseId": "CFResultsUiT.SanitizedTeam", - "feedbackSessionName": "Sanitized Session", - "feedbackQuestionId": "1", - "commentGiver": "CFResultsUiT.instr@gmail.tmt", - "giverSection": "None", - "receiverSection": "Section A'\"", - "feedbackResponseId": "1%CFResultsUiT.alice.b@gmail.tmt%CFResultsUiT.benny.c@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-01T23:59:00Z", - "lastEditorEmail": "CFResultsUiT.instr@gmail.tmt", - "lastEditedAt": "2026-03-02T23:59:00Z", - "commentText": "

    Some comment from instructor

    a link attempted script injection " - }, - "comment2ToBeEditedByDifferentInstructor": { - "courseId": "CFResultsUiT.CS2104", - "feedbackSessionName": "First Session", - "feedbackQuestionId": "2", - "commentGiver": "CFResultsUiT.instr2@gmail.tmt", - "giverSection": "Section A", - "receiverSection": "Section A", - "feedbackResponseId": "2%CFResultsUiT.alice.b@gmail.tmt%CFResultsUiT.alice.b@gmail.tmt", - "showCommentTo": [ - "GIVER", - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "GIVER", - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2012-04-02T23:59:00Z", - "lastEditorEmail": "CFResultsUiT.instr2@gmail.tmt", - "lastEditedAt": "2012-04-02T23:59:00Z", - "commentText": "Comment to be edited by different instructor." - }, - "comment1OnResponse6": { - "courseId": "CFResultsUiT.CS2104", - "feedbackSessionName": "First Session", - "feedbackQuestionId": "7", - "commentGiver": "CFResultsUiT.alice.b@gmail.tmt", - "giverSection": "Section A", - "receiverSection": "Section A", - "feedbackResponseId": "7%CFResultsUiT.alice.b@gmail.tmt%CFResultsUiT.alice.b@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "STUDENTS", - "isVisibilityFollowingFeedbackQuestion": true, - "isCommentFromFeedbackParticipant": true, - "createdAt": "2012-04-02T23:59:00Z", - "commentText": "Comment by Alice." - } - }, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorFeedbackSessionsPageUiTest.json b/src/test/resources/data/InstructorFeedbackSessionsPageUiTest.json deleted file mode 100644 index a171bb3eef7..00000000000 --- a/src/test/resources/data/InstructorFeedbackSessionsPageUiTest.json +++ /dev/null @@ -1,539 +0,0 @@ -{ - "accounts": { - "instructorWithSessions": { - "googleId": "CFeedbackUiT.instructor", - "name": "Teammates Test", - "isInstructor": true, - "email": "teammates.test1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "helperWithSessions": { - "googleId": "CFeedbackUiT.helper", - "name": "Teammates Test", - "isInstructor": true, - "email": "teammates.helper@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructorWithSessions2": { - "googleId": "CFeedbackUiT.instructor2", - "name": "Teammates Test2", - "isInstructor": true, - "email": "teammates.test2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructorWithoutCourses": { - "googleId": "CFeedbackUiT.nocourses", - "name": "instructor Without Courses", - "isInstructor": true, - "email": "teammates.test2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructorWithoutSessions": { - "googleId": "CFeedbackUiT.nosessions", - "name": "Instructor Without Sessions", - "isInstructor": true, - "email": "teammates.test3@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructorWithCS2105": { - "googleId": "CFeedbackUiT.instructorWithCS2105", - "name": "Teammates Test", - "isInstructor": true, - "email": "teammates.test2105@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructorWithCS2106": { - "googleId": "CFeedbackUiT.instructorWithCS2106", - "name": "Teammates Test", - "isInstructor": true, - "email": "teammates.test2106@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "course": { - "id": "CFeedbackUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "courseWithoutSessions": { - "id": "CFeedbackUiT.coursewithoutsessions", - "name": "Course Without Sessions", - "timeZone": "UTC" - }, - "anotherCourse": { - "id": "CFeedbackUiT.CS1101", - "name": "Programming Methodology", - "timeZone": "Africa/Johannesburg" - }, - "CS2105": { - "id": "CFeedbackUiT.CS2105", - "name": "Computer Networks", - "timeZone": "UTC" - }, - "CS2106": { - "id": "CFeedbackUiT.CS2106", - "name": "Operating Systems", - "timeZone": "UTC" - } - }, - "instructors": { - "teammates.test.instructor": { - "googleId": "CFeedbackUiT.instructor", - "courseId": "CFeedbackUiT.CS2104", - "name": "Teammates Test", - "email": "teammates.test1@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.helper": { - "googleId": "CFeedbackUiT.helper", - "courseId": "CFeedbackUiT.CS2104", - "name": "Teammates Test", - "email": "teammates.helper@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "Ins.for.course.without.sessions": { - "googleId": "CFeedbackUiT.nosessions", - "courseId": "CFeedbackUiT.coursewithoutsessions", - "name": "Instructor Without Sessions", - "email": "teammates.test3@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor.for.different.course": { - "googleId": "CFeedbackUiT.instructor", - "courseId": "CFeedbackUiT.CS1101", - "name": "Teammates Test", - "email": "teammates.test1@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.helper.for.different.course": { - "googleId": "CFeedbackUiT.helper", - "courseId": "CFeedbackUiT.CS1101", - "name": "Teammates Test", - "email": "teammates.helper@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2": { - "googleId": "CFeedbackUiT.instructor2", - "courseId": "CFeedbackUiT.CS2104", - "name": "Teammates Test2", - "email": "teammates.test2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructor2.for.different.course": { - "googleId": "CFeedbackUiT.instructor2", - "courseId": "CFeedbackUiT.CS1101", - "name": "Teammates Test2", - "email": "teammates.test2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructorWithCS2105": { - "googleId": "CFeedbackUiT.instructorWithCS2105", - "courseId": "CFeedbackUiT.CS2105", - "name": "Teammates Test", - "email": "teammates.test2105@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.instructorWithCS2106": { - "googleId": "CFeedbackUiT.instructorWithCS2106", - "courseId": "CFeedbackUiT.CS2106", - "name": "Teammates Test", - "email": "teammates.test2106@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "alice.tmms@CFeedbackUiT.CS2104": { - "googleId": "CFeedbackUiT.alice.tmms", - "email": "CFeedbackUiT.alice.b.tmms@gmail.tmt", - "course": "CFeedbackUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "benny.tmms@CFeedbackUiT.CS2104": { - "googleId": "CFeedbackUiT.benny.tmms", - "email": "CFeedbackUiT.benny.tmms@gmail.tmt", - "course": "CFeedbackUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "charlie.tmms@CFeedbackUiT.CS1101": { - "googleId": "CFeedbackUiT.charlie.tmms", - "email": "CFeedbackUiT.charlie.tmms@gmail.tmt", - "course": "CFeedbackUiT.CS1101", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "danny.tmms@CFeedbackUiT.CS1101": { - "googleId": "CFeedbackUiT.danny.tmms", - "email": "CFeedbackUiT.danny.tmms@gmail.tmt", - "course": "CFeedbackUiT.CS1101", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - } - }, - "feedbackSessions": { - "publishedSession": { - "feedbackSessionName": "First Session #1", - "courseId": "CFeedbackUiT.CS2104", - "creatorEmail": "teammates.test2@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "manualSession": { - "feedbackSessionName": "Manual Session #1", - "courseId": "CFeedbackUiT.CS1101", - "creatorEmail": "teammates.test1@gmail.tmt", - "instructions": "Please please fill in the third feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T21:59:00Z", - "endTime": "2012-04-29T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "1970-01-01T00:00:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "openSession": { - "feedbackSessionName": "Open Session #", - "courseId": "CFeedbackUiT.CS1101", - "creatorEmail": "teammates.test2@gmail.tmt", - "instructions": "Please please fill in the fourth feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T21:59:00Z", - "endTime": "2027-04-29T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "1970-01-01T00:00:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "awaitingSession": { - "feedbackSessionName": "Awaiting Session #", - "courseId": "CFeedbackUiT.CS2104", - "creatorEmail": "teammates.test2@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2014-04-01T23:59:00Z", - "startTime": "2027-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2014-04-01T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session1OfCS2105": { - "feedbackSessionName": "First Session #1", - "courseId": "CFeedbackUiT.CS2105", - "creatorEmail": "teammates.test2105@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "deletedTime": "2012-06-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session2OfCS2105": { - "feedbackSessionName": "Second Session #2", - "courseId": "CFeedbackUiT.CS2105", - "creatorEmail": "teammates.test2105@gmail.tmt", - "instructions": "Instructions for second session", - "createdTime": "2012-04-01T23:59:00Z", - "deletedTime": "2012-06-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session3OfCS2105": { - "feedbackSessionName": "Third Session #3", - "courseId": "CFeedbackUiT.CS2105", - "creatorEmail": "teammates.test2105@gmail.tmt", - "instructions": "Instructions for third session", - "createdTime": "2012-04-01T23:59:00Z", - "deletedTime": "2012-06-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session1OfCS2106": { - "feedbackSessionName": "First Session #1", - "courseId": "CFeedbackUiT.CS2106", - "creatorEmail": "teammates.test2106@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "deletedTime": "2012-06-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session2OfCS2106": { - "feedbackSessionName": "Second Session #2", - "courseId": "CFeedbackUiT.CS2106", - "creatorEmail": "teammates.test2106@gmail.tmt", - "instructions": "Instructions for second session", - "createdTime": "2012-04-01T23:59:00Z", - "deletedTime": "2012-06-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session3OfCS2106": { - "feedbackSessionName": "Third Session #3", - "courseId": "CFeedbackUiT.CS2106", - "creatorEmail": "teammates.test2106@gmail.tmt", - "instructions": "Instructions for third session", - "createdTime": "2012-04-01T23:59:00Z", - "deletedTime": "2012-06-01T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2012-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-04-01T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorFeedbackSubmitPageUiTest.json b/src/test/resources/data/InstructorFeedbackSubmitPageUiTest.json deleted file mode 100644 index 05647ba6544..00000000000 --- a/src/test/resources/data/InstructorFeedbackSubmitPageUiTest.json +++ /dev/null @@ -1,1253 +0,0 @@ -{ - "accounts": { - "IFSubmitUiT.instr": { - "googleId": "IFSubmitUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "IFSubmitUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFSubmitUiT.instr2": { - "googleId": "IFSubmitUiT.instr2", - "name": "Teammates Test2", - "isInstructor": true, - "email": "IFSubmitUiT.instr2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFSubmitUiT.instr3": { - "googleId": "IFSubmitUiT.instr3", - "name": "Teammates Test3", - "isInstructor": true, - "email": "IFSubmitUiT.instr3@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFSubmitUiT.instr4": { - "googleId": "IFSubmitUiT.instr4", - "name": "Teammates Test4", - "isInstructor": true, - "email": "IFSubmitUiT.instr4@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFSubmitUiT.instr5": { - "googleId": "IFSubmitUiT.instr5", - "name": "Teammates Test5", - "isInstructor": true, - "email": "IFSubmitUiT.instr5@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFSubmitUiT.charlie.d": { - "googleId": "IFSubmitUiT.charlie.d", - "name": "Charlie D.", - "isInstructor": false, - "email": "IFSubmitUiT.charlie.d@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFSubmitUiT.danny.e": { - "googleId": "IFSubmitUiT.danny.e", - "name": "Danny E.", - "isInstructor": false, - "email": "IFSubmitUiT.danny.e@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "IFSubmitUiT.emily.f": { - "googleId": "IFSubmitUiT.emily.f", - "name": "Emily F.", - "isInstructor": false, - "email": "IFSubmitUiT.emily.f@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "IFSubmitUiT.CS2104": { - "id": "IFSubmitUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - } - }, - "instructors": { - "IFSubmitUiT.instr": { - "googleId": "IFSubmitUiT.instr", - "courseId": "IFSubmitUiT.CS2104", - "name": "Teammates Test", - "email": "IFSubmitUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFSubmitUiT.instr2": { - "googleId": "IFSubmitUiT.instr2", - "courseId": "IFSubmitUiT.CS2104", - "name": "Teammates Test2", - "email": "IFSubmitUiT.instr2@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifyinstructor": false, - "canmodifystudent": false - }, - "sectionLevel": { - "Section 1": { - "cansubmitsessioninsection": true - } - }, - "sessionLevel": {} - } - }, - "IFSubmitUiT.instr3": { - "googleId": "IFSubmitUiT.instr3", - "courseId": "IFSubmitUiT.CS2104", - "name": "Teammates Test3", - "email": "IFSubmitUiT.instr3@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFSubmitUiT.instr4": { - "googleId": "IFSubmitUiT.instr4", - "courseId": "IFSubmitUiT.CS2104", - "name": "Teammates Test4", - "email": "IFSubmitUiT.instr4@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "IFSubmitUiT.instr5": { - "googleId": "IFSubmitUiT.instr5", - "courseId": "IFSubmitUiT.CS2104", - "name": "Teammates Test5", - "email": "IFSubmitUiT.instr5@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "Alice": { - "googleId": "IFSubmitUiT.alice.b", - "email": "IFSubmitUiT.alice.b@gmail.tmt", - "course": "IFSubmitUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "Benny": { - "googleId": "IFSubmitUiT.benny.c", - "email": "IFSubmitUiT.benny.c@gmail.tmt", - "course": "IFSubmitUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "ExtraGuy": { - "googleId": "extra.guy", - "email": "extra.guy@gmail.tmt", - "course": "IFSubmitUiT.CS2104", - "name": "Extra guy", - "comments": "This student will move to a new team after evaluation created", - "team": "Team 2", - "section": "Section 1" - }, - "DropOut": { - "googleId": "drop.out", - "email": "drop.out@gmail.tmt", - "course": "IFSubmitUiT.CS2104", - "name": "Drop out", - "comments": "This student will drop out after evaluation created", - "team": "Team 2", - "section": "Section 1" - }, - "Charlie": { - "googleId": "IFSubmitUiT.charlie.d", - "email": "IFSubmitUiT.charlie.d@gmail.tmt", - "course": "IFSubmitUiT.CS2104", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "Section 1" - }, - "Danny": { - "googleId": "IFSubmitUiT.danny.e", - "email": "IFSubmitUiT.danny.e@gmail.tmt", - "course": "IFSubmitUiT.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "Section 1" - }, - "Emily": { - "googleId": "IFSubmitUiT.emily.f", - "email": "IFSubmitUiT.emily.f@gmail.tmt", - "course": "IFSubmitUiT.CS2104", - "name": "Emily", - "comments": "This student's name is Emily", - "team": "Team 3", - "section": "Section 2" - } - }, - "feedbackSessions": { - "Open Session": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "creatorEmail": "IFSubmitUiT.instr@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Grace Period Session": { - "feedbackSessionName": "Grace Period Session", - "courseId": "IFSubmitUiT.CS2104", - "creatorEmail": "IFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2012-04-02T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 1440000, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Closed Session": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "creatorEmail": "IFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2012-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Empty Session": { - "feedbackSessionName": "Third Session", - "courseId": "IFSubmitUiT.CS2104", - "creatorEmail": "IFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the last feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Awaiting Session": { - "feedbackSessionName": "Fourth Session", - "courseId": "IFSubmitUiT.CS2104", - "creatorEmail": "IFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2035-04-02T15:59:00Z", - "endTime": "2035-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 3 students' products" - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Comments about the class" - }, - "questionNumber": 3, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn4InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should be hidden." - }, - "questionNumber": 4, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn5InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should be hidden." - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn6InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to other instructors." - }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn7InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "UI", - "Algo" - ], - "questionText": "What is the best selling point of your product?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 7, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn8InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "UI", - "Algo" - ], - "questionText": "What do you think is the other instructors' best feature?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 8, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn9InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "UI", - "Algo", - "Design" - ], - "questionText": "What is the best selling point of your product?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 9, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn10InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "UI", - "Algo", - "Design" - ], - "questionText": "What do you think is the other instructors' best feature?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 10, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn11InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Who is the best student?", - "questionType": "MCQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 11, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn12InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who are the best students?", - "questionType": "MSQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 12, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn13InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Which is the best team?", - "questionType": "MCQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 13, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn14InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who are the best teams?", - "questionType": "MSQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 14, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn15InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate your product", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 15, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn16InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate others' product", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 16, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn17InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Who is the best instructor?", - "questionType": "MCQ", - "generateOptionsFor": "INSTRUCTORS", - "otherEnabled": false - }, - "questionNumber": 17, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn18InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who do you recommend as tutors?", - "questionType": "MSQ", - "generateOptionsFor": "INSTRUCTORS", - "otherEnabled": false - }, - "questionNumber": 18, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn19InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Which teams would you like to be an instructor of again?", - "questionType": "MSQ", - "generateOptionsFor": "TEAMS", - "numOfMsqChoices": 0, - "otherEnabled": false - }, - "questionNumber": 19, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn20InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "forceUnevenDistribution": false, - "distributePointsFor": "None", - "pointsPerOption": true, - "questionText": "Split points among the teams", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 20, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn21InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "forceUnevenDistribution": false, - "distributePointsFor": "None", - "pointsPerOption": false, - "questionText": "How important are the following factors to you? Give points accordingly.", - "numOfConstSumOptions": 2, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Grades", - "Fun" - ] - }, - "questionNumber": 21, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn22InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution of your team members and yourself.", - "questionType": "CONTRIB" - }, - "questionNumber": 22, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn23InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "forceUnevenDistribution": true, - "distributePointsFor": "All options", - "pointsPerOption": true, - "questionText": "Split points among the teams, based on how much effort you think the teams have put into the project", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 23, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn24InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "forceUnevenDistribution": true, - "distributePointsFor": "All options", - "pointsPerOption": false, - "questionText": "How much more time should the teams spend on the following, regarding their product? Give points accordingly.", - "numOfConstSumOptions": 3, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Design", - "Usability", - "Algo" - ] - }, - "questionNumber": 24, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn25InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "forceUnevenDistribution": true, - "distributePointsFor": "At least some options", - "pointsPerOption": true, - "questionText": "Split points among the teams, based on how much effort you think the teams have put into the project", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 25, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn26InSession1": { - "feedbackSessionName": "First Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "forceUnevenDistribution": true, - "distributePointsFor": "At least some options", - "pointsPerOption": false, - "questionText": "How much more time should the teams spend on the following, regarding their product? Give points accordingly.", - "numOfConstSumOptions": 3, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Design", - "Usability", - "Algo" - ] - }, - "questionNumber": 26, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn2InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "It's good", - "It's perfect" - ], - "questionText": "What do you like best about our product?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn3InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "It's good", - "It's perfect" - ], - "questionText": "What do you like best about our product?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 3, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn4InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate our product.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 4, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn5InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "forceUnevenDistribution": false, - "distributePointsFor": "None", - "pointsPerOption": false, - "questionText": "How important are the following factors to you? Give points accordingly.", - "numOfConstSumOptions": 2, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Grades", - "Fun" - ] - }, - "questionNumber": 5, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn6InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "forceUnevenDistribution": false, - "distributePointsFor": "None", - "pointsPerOption": true, - "questionText": "Split points among the teams", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn7InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution of your team members and yourself.(Closed session)", - "questionType": "CONTRIB" - }, - "questionNumber": 7, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession5": { - "feedbackSessionName": "Fourth Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "graceperiod.session.feedback": { - "feedbackSessionName": "Grace Period Session", - "courseId": "IFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to yourself." - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - } - }, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorHomePageUiTest1.json b/src/test/resources/data/InstructorHomePageUiTest1.json deleted file mode 100644 index dc37b802762..00000000000 --- a/src/test/resources/data/InstructorHomePageUiTest1.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "accounts": { - "newInstructorWithoutSampleCourse": { - "googleId": "CHomeUiT.instructor.tmms.new", - "name": "Teammates Test New Instructor Without Sample", - "isInstructor": true, - "email": "CHomeUiT.instructor.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructorWithManyCourses": { - "googleId": "CHomeUiT.instructor.tmms.unloaded", - "name": "Teammates Test Instructor With Many Courses", - "isInstructor": true, - "email": "CHomeUiT.instructor.tmms.unloaded@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "CHomeUiT.Course1": { - "createdAt": "2012-04-01T23:59:00Z", - "id": "ins.wit-demo1", - "name": "Sample Course 101", - "timeZone": "UTC" - }, - "CHomeUiT.Course2": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "ins.wit-demo2", - "name": "Sample Course 201", - "timeZone": "UTC" - }, - "CHomeUiT.Course3": { - "createdAt": "2012-04-01T23:57:00Z", - "id": "ins.wit-demo3", - "name": "Sample Course 301", - "timeZone": "UTC" - }, - "CHomeUiT.Unloaded": { - "createdAt": "2012-04-01T23:56:00Z", - "id": "ins.wit-Unloaded", - "name": "Sample Course Unloaded", - "timeZone": "UTC" - } - }, - "instructors": { - "CHomeUiT.instr.Course1": { - "googleId": "CHomeUiT.instructor.tmms.unloaded", - "courseId": "ins.wit-demo1", - "name": "Teammates Test Instructor With Many Courses", - "email": "CHomeUiT.instructor.tmms.unloaded@gmail.tmt", - "isDisplayedToStudents": false - }, - "CHomeUiT.instr.Course2": { - "googleId": "CHomeUiT.instructor.tmms.unloaded", - "courseId": "ins.wit-demo2", - "name": "Teammates Test Instructor With Many Courses", - "email": "CHomeUiT.instructor.tmms.unloaded@gmail.tmt", - "isDisplayedToStudents": false - }, - "CHomeUiT.instr.Course3": { - "googleId": "CHomeUiT.instructor.tmms.unloaded", - "courseId": "ins.wit-demo3", - "name": "Teammates Test Instructor With Many Courses", - "email": "CHomeUiT.instructor.tmms.unloaded@gmail.tmt", - "isDisplayedToStudents": false - }, - "CHomeUiT.instr.Unloaded": { - "googleId": "CHomeUiT.instructor.tmms.unloaded", - "courseId": "ins.wit-Unloaded", - "name": "Teammates Test Instructor With Many Courses", - "email": "CHomeUiT.instructor.tmms.unloaded@gmail.tmt", - "isDisplayedToStudents": false - } - }, - "students": {}, - "feedbackSessions": {}, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorHomePageUiTest2.json b/src/test/resources/data/InstructorHomePageUiTest2.json deleted file mode 100644 index e500d38aa35..00000000000 --- a/src/test/resources/data/InstructorHomePageUiTest2.json +++ /dev/null @@ -1,392 +0,0 @@ -{ - "accounts": { - "account": { - "googleId": "CHomeUiT.instructor.tmms", - "name": "Teammates Test", - "isInstructor": true, - "email": "CHomeUiT.instructor.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instrHelper": { - "googleId": "CHomeUiT.instructor.tmms.helper", - "name": "Teammates Test Helper", - "isInstructor": true, - "email": "CHomeUiT.instructor.tmms.helper@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "newInstructorWithSampleCourse": { - "googleId": "newIns.withSample", - "name": "Teammates Test New Instructor With Sample", - "isInstructor": true, - "email": "newIns.withSample@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "newInstructorWithoutSampleCourse": { - "googleId": "newIns.withoutSample", - "name": "Teammates Test New Instructor Without Sample", - "isInstructor": true, - "email": "newIns.withoutSample@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "CHomeUiT.idOfInstructor1OfTestingSanitizationCourse", - "name": "Instructor", - "isInstructor": true, - "email": "CHomeUiT.instructor1@sanitization.tmt", - "institute": "inst" - } - }, - "courses": { - "CHomeUiT.CS2104": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "CHomeUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "CHomeUiT.CS1101": { - "createdAt": "2012-04-01T23:59:00Z", - "id": "CHomeUiT.CS1101", - "name": "Programming Methodology", - "timeZone": "UTC" - }, - "CHomeUiT.Sample": { - "id": "newIns.wit-demo", - "name": "Sample Course 101", - "timeZone": "UTC" - }, - "CHomeUiT.testingSanitizationCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "CHomeUiT.idOfTestingSanitizationCourse", - "name": "Testing", - "timeZone": "UTC" - } - }, - "instructors": { - "CHomeUiT.instr.CS2104": { - "googleId": "CHomeUiT.instructor.tmms", - "courseId": "CHomeUiT.CS2104", - "name": "Teammates Test", - "email": "CHomeUiT.instructor.tmms@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CHomeUiT.helper.CS1101": { - "googleId": "CHomeUiT.instructor.tmms.helper", - "courseId": "CHomeUiT.CS1101", - "name": "Teammates Test Helper", - "email": "CHomeUiT.instructor.tmms.helper@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CHomeUiT.instr.CS1101": { - "googleId": "CHomeUiT.instructor.tmms", - "courseId": "CHomeUiT.CS1101", - "name": "Teammates Test", - "email": "CHomeUiT.instructor.tmms@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CHomeUiT.instr.Sample": { - "googleId": "newIns.withSample", - "courseId": "newIns.wit-demo", - "name": "Teammates Test New Instructor With Sample", - "email": "newIns.withSample@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "CHomeUiT.instructor1OfTestingSanitizationCourse": { - "googleId": "CHomeUiT.idOfInstructor1OfTestingSanitizationCourse", - "courseId": "CHomeUiT.idOfTestingSanitizationCourse", - "name": "Instructor", - "email": "CHomeUiT.instructor1@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cangivecommentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canviewcommentinsection": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "CHomeUiT.alice.b.tmms@CHomeUiT.CS2104": { - "googleId": "CHomeUiT.alice.b.tmms", - "email": "CHomeUiT.alice.b.tmms@gmail.tmt", - "course": "CHomeUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "CHomeUiT.benny.c.tmms@CHomeUiT.CS2104": { - "googleId": "CHomeUiT.benny.c.tmms", - "email": "CHomeUiT.benny.c.tmms@gmail.tmt", - "course": "CHomeUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "CHomeUiT.charlie.d.tmms@CHomeUiT.CS2104": { - "googleId": "CHomeUiT.charlie.d.tmms", - "email": "CHomeUiT.charlie.d.tmms@gmail.tmt", - "course": "CHomeUiT.CS2104", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "CHomeUiT.danny.e.tmms@CHomeUiT.CS2104": { - "googleId": "CHomeUiT.danny.e.tmms", - "email": "CHomeUiT.danny.e.tmms@gmail.tmt", - "course": "CHomeUiT.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - }, - "CHomeUiT.alice.b.tmms@CHomeUiT.CS1101": { - "googleId": "CHomeUiT.alice.b.tmms", - "email": "CHomeUiT.alice.b.tmms@gmail.tmt", - "course": "CHomeUiT.CS1101", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "CHomeUiT.benny.c.tmms@CHomeUiT.CS1101": { - "googleId": "CHomeUiT.benny.c.tmms", - "email": "CHomeUiT.benny.c.tmms@gmail.tmt", - "course": "CHomeUiT.CS1101", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "CHomeUiT.charlie.d.tmms@CHomeUiT.CS1101": { - "googleId": "CHomeUiT.charlie.d.tmms", - "email": "CHomeUiT.charlie.d.tmms@gmail.tmt", - "course": "CHomeUiT.CS1101", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "CHomeUiT.danny.e.tmms@CHomeUiT.CS1101": { - "googleId": "CHomeUiT.danny.e.tmms", - "email": "CHomeUiT.danny.e.tmms@gmail.tmt", - "course": "CHomeUiT.CS1101", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - } - }, - "feedbackSessions": { - "First Feedback Session": { - "feedbackSessionName": "First Feedback Session", - "courseId": "CHomeUiT.CS2104", - "creatorEmail": "CHomeUiT.instructor.tmms@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T04:00:00Z", - "endTime": "2027-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-03-28T15:59:00Z", - "resultsVisibleFromTime": "2027-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Second Feedback Session": { - "feedbackSessionName": "Second Feedback Session", - "courseId": "CHomeUiT.CS2104", - "creatorEmail": "CHomeUiT.instructor.tmms@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2027-03-29T14:59:00Z", - "endTime": "2027-04-30T04:00:00Z", - "sessionVisibleFromTime": "2012-03-28T15:59:00Z", - "resultsVisibleFromTime": "2027-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Third Feedback Session": { - "feedbackSessionName": "Third Feedback Session", - "courseId": "CHomeUiT.CS2104", - "creatorEmail": "CHomeUiT.instructor.tmms@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-10T15:59:00Z", - "endTime": "2012-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-03-28T15:59:00Z", - "resultsVisibleFromTime": "2027-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Fourth Feedback Session": { - "feedbackSessionName": "Fourth Feedback Session", - "courseId": "CHomeUiT.CS2104", - "creatorEmail": "CHomeUiT.instructor.tmms@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-05T03:59:00Z", - "endTime": "2012-04-20T04:00:00Z", - "sessionVisibleFromTime": "2012-03-28T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "CHomeUiT.CS2104:First Feedback Session:Q1": { - "feedbackSessionName": "First Feedback Session", - "courseId": "CHomeUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 5 other students' products" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 5, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "CHomeUiT.CS2104:Third Feedback Session:Q1": { - "feedbackSessionName": "Third Feedback Session", - "courseId": "CHomeUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 5 other students' products" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 5, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - } - }, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/InstructorSearchPageUiTest.json b/src/test/resources/data/InstructorSearchPageUiTest.json deleted file mode 100644 index 21eb6ff59c9..00000000000 --- a/src/test/resources/data/InstructorSearchPageUiTest.json +++ /dev/null @@ -1,658 +0,0 @@ -{ - "accounts": { - "instructor1OfCourse1": { - "googleId": "searchUI.idOfInstructor1OfCourse1", - "name": "Instructor 1 of Course 1", - "isInstructor": true, - "email": "searchUI.instr1@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor2OfCourse1": { - "googleId": "searchUI.idOfInstructor2OfCourse1", - "name": "Instructor 2 of Course 1", - "isInstructor": true, - "email": "searchUI.instr2@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "searchUI.idOfInstructor1OfTestingSanitizationCourse", - "name": "Instructor", - "isInstructor": true, - "email": "searchUI.instructor1@sanitization.tmt", - "institute": "inst" - }, - "helperOfCourse1": { - "googleId": "searchUI.idOfHelperOfCourse1", - "name": "Instructor 2 of Course 1", - "isInstructor": true, - "email": "searchUI.Helper@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor3OfCourse1": { - "googleId": "searchUI.idOfInstructor3OfCourse1", - "name": "Instructor 3 of Course 1", - "isInstructor": true, - "email": "searchUI.instr3@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student1InCourse1": { - "googleId": "searchUI.student1InCourse1", - "name": "Student 1 in course 1", - "isInstructor": false, - "email": "searchUI.student1InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student2InCourse1": { - "googleId": "searchUI.student2InCourse1", - "name": "Student in two courses", - "isInstructor": false, - "email": "searchUI.student2InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student2.2InCourse1": { - "googleId": "searchUI.student2.2InCourse1", - "name": "Student in two courses", - "isInstructor": false, - "email": "searchUI.student2InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student3InCourse1": { - "googleId": "searchUI.student3InCourse1", - "name": "Student 3 in course 1", - "isInstructor": false, - "email": "searchUI.student3InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student1InTestingSanitizationCourse": { - "googleId": "searchUI.student1InTestingSanitizationCourse", - "name": "Stud1", - "isInstructor": false, - "email": "searchUI.normal@sanitization.tmt", - "institute": "inst" - } - }, - "courses": { - "typicalCourse1": { - "id": "searchUI.idOfTypicalCourse1", - "name": "Typical Course 1 with 2 Evals", - "timeZone": "UTC" - }, - "testingSanitizationCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "searchUI.idOfTestingSanitizationCourse", - "name": "Testing", - "timeZone": "UTC" - } - }, - "instructors": { - "instructor1OfCourse1": { - "googleId": "searchUI.idOfInstructor1OfCourse1", - "courseId": "searchUI.idOfTypicalCourse1", - "name": "Instructor1 Course1", - "email": "searchUI.instructor1@course1.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor2OfCourse1": { - "googleId": "searchUI.idOfInstructor2OfCourse1", - "courseId": "searchUI.idOfTypicalCourse1", - "name": "Instructor2 Course1", - "email": "searchUI.instructor2@course1.tmt", - "role": "Manager", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": false, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor3OfCourse1": { - "googleId": "searchUI.idOfInstructor3OfCourse1", - "courseId": "searchUI.idOfTypicalCourse1", - "name": "Instructor3 Course1", - "email": "searchUI.instructor3@course1.tmt", - "role": "Manager", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": false, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "helperOfCourse1": { - "googleId": "searchUI.idOfHelperOfCourse1", - "courseId": "searchUI.idOfTypicalCourse1", - "name": "Instructor2 Course1", - "email": "searchUI.Helper@course1.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": true, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "searchUI.idOfInstructor1OfTestingSanitizationCourse", - "courseId": "searchUI.idOfTestingSanitizationCourse", - "name": "Instructor", - "email": "searchUI.instructor1@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cangivecommentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canviewcommentinsection": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "student1InCourse1": { - "googleId": "searchUI.student1InCourse1", - "email": "searchUI.student1InCourse1@gmail.tmt", - "course": "searchUI.idOfTypicalCourse1", - "name": "student1 In Course1'\"", - "comments": "comment for student1InCourse1'\"", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student2InCourse1": { - "googleId": "searchUI.student2InCourse1", - "email": "searchUI.student2InCourse1@gmail.tmt", - "course": "searchUI.idOfTypicalCourse1", - "name": "student2 In Course1", - "comments": "", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student2.2InCourse1": { - "googleId": "searchUI.student2.2InCourse1", - "email": "searchUI.student2.2InCourse1@gmail.tmt", - "course": "searchUI.idOfTypicalCourse1", - "name": "student2 2 In Course1", - "comments": "", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student3InCourse1": { - "googleId": "searchUI.student3InCourse1", - "email": "searchUI.student3InCourse1@gmail.tmt", - "course": "searchUI.idOfTypicalCourse1", - "name": "student3 In Course1", - "comments": "", - "team": "Team 1.2", - "section": "Section 1" - }, - "student1InTestingSanitizationCourse": { - "googleId": "searchUI.student1InTestingSanitizationCourse", - "email": "searchUI.normal@sanitization.tmt", - "course": "searchUI.idOfTestingSanitizationCourse", - "name": "Stud1", - "comments": "", - "team": "Team tags&\"", - "section": "Section'\"/>" - } - }, - "feedbackSessions": { - "session1InCourse1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "creatorEmail": "searchUI.instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session1InTestingSanitizationCourse": { - "feedbackSessionName": "Normal feedback session name", - "courseId": "searchUI.idOfTestingSanitizationCourse", - "creatorEmail": "searchUI.instructor1@sanitization.tmt", - "instructions": "unclosed tags Attempted script injection '\" ", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1InCourse1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession1InCourse1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 1 other student's product" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "RECEIVER_TEAM_MEMBERS", - "STUDENTS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1InCourse1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "My searchUI on the class" - }, - "questionNumber": 3, - "giverType": "SELF", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "qn4InSession1InCourse1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Instructor searchUI on the class" - }, - "questionNumber": 4, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "qn1InSession1InTestingSanitizationCourse": { - "feedbackSessionName": "Normal feedback session name", - "courseId": "searchUI.idOfTestingSanitizationCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Testing quotation marks '\" Testing unclosed tags Testing script injection " - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": { - "response1ForQ1S1C1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "searchUI.student1InCourse1@gmail.tmt", - "recipient": "searchUI.student1InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Student 1 self feedback." - } - }, - "response2ForQ1S1C1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "searchUI.student2InCourse1@gmail.tmt", - "recipient": "searchUI.student2InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "I'm cool'" - } - }, - "response1ForQ2S1C1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "searchUI.student2InCourse1@gmail.tmt", - "recipient": "searchUI.student1InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 2 to student 1." - } - }, - "response2ForQ2S1C1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "searchUI.student1InCourse1@gmail.tmt", - "recipient": "searchUI.student2InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 1 to student 2." - } - }, - "response3ForQ2S1C1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "searchUI.student3InCourse1@gmail.tmt", - "recipient": "searchUI.student2InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 3 \"to\" student 2.\r\nMultiline test." - } - }, - "response1ForQ3S1C1": { - "feedbackSessionName": "searchUI.First feedback session", - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackQuestionId": "3", - "giver": "searchUI.instructor1@course1.tmt", - "recipient": "%GENERAL%", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "Good work, keep it up!" - } - }, - "response1ForQ1S1TSC": { - "feedbackSessionName": "Normal feedback session name", - "courseId": "searchUI.idOfTestingSanitizationCourse", - "feedbackQuestionId": "1", - "giver": "searchUI.normal@sanitization.tmt", - "recipient": "searchUI.normal@sanitization.tmt", - "giverSection": "Section'\"/>", - "recipientSection": "Section'\"/>", - "responseDetails": { - "questionType": "TEXT", - "answer": "Feedback reponse. Testing quotation marks '\" Testing unclosed tags Testing script injection " - } - } - }, - "feedbackResponseComments": { - "comment1FromT1C1ToR1Q1S1C1": { - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackSessionName": "searchUI.First feedback session", - "feedbackQuestionId": "1", - "commentGiver": "searchUI.instructor1@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "1%searchUI.student1InCourse1@gmail.tmt%searchUI.student1InCourse1@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-01T23:59:00Z", - "commentText": "Instructor 1 comment to student 1 self feedback" - }, - "comment1FromT1C1ToR1Q2S1C1": { - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackSessionName": "searchUI.First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "searchUI.instructor2@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%searchUI.student3InCourse1@gmail.tmt%searchUI.student2InCourse1@gmail.tmt", - "showCommentTo": [ - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2015-02-02T23:59:00Z", - "commentText": "Anonymous comment to feedback Question 2" - }, - "comment2FromT1C1ToR1Q2S1C1": { - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackSessionName": "searchUI.First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "searchUI.instructor2@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%searchUI.student3InCourse1@gmail.tmt%searchUI.student2InCourse1@gmail.tmt", - "showCommentTo": [ - "GIVER", - "RECEIVER", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "RECEIVER_TEAM_MEMBERS" - ], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2015-02-03T23:59:00Z", - "commentText": "Instructor 2 comment to feedback Question 2 (Student 3 see this as anonymous comment)" - }, - "comment3FromT1C1ToR1Q2S1C1": { - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackSessionName": "searchUI.First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "searchUI.instructor1@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%searchUI.student3InCourse1@gmail.tmt%searchUI.student2InCourse1@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2015-02-01T23:59:00Z", - "commentText": "Instructor 1 comment to feedback Question 2" - }, - "comment4FromT1C1ToR1Q2S1C1": { - "courseId": "searchUI.idOfTypicalCourse1", - "feedbackSessionName": "searchUI.First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "searchUI.instructor2@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%searchUI.student3InCourse1@gmail.tmt%searchUI.student2InCourse1@gmail.tmt", - "showCommentTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2015-02-04T23:59:00Z", - "lastEditorEmail": "searchUI.instructor3@course1.tmt", - "lastEditedAt": "2015-02-05T23:59:00Z", - "commentText": "Instructor 3 edited comment to feedback Question 2" - }, - "comment1ForR1S1TSC": { - "courseId": "searchUI.idOfTestingSanitizationCourse", - "feedbackSessionName": "Normal feedback session name", - "feedbackQuestionId": "1", - "commentGiver": "searchUI.instructor1@sanitization.tmt", - "giverSection": "None", - "receiverSection": "Section'\"/>", - "feedbackResponseId": "1%searchUI.normal@sanitization.tmt%searchUI.normal@sanitization.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-01T23:59:00Z", - "lastEditorEmail": "searchUI.instructor1@sanitization.tmt", - "lastEditedAt": "2026-03-03T23:59:00Z", - "commentText": "Comment value. Testing quotation marks '\" Testing unclosed tags Testing script injection " - } - }, - "profiles": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "shortName": "Stud1", - "email": "i.m.stud1@gmail.tmt", - "institute": "TEAMMATES Test Institute 3", - "nationality": "", - "gender": "MALE", - "moreInfo": "I am just a student :P", - "pictureKey": "" - }, - "student1InTestingSanitizationCourse": { - "googleId": "student1InTestingSanitizationCourse", - "shortName": "Stud1", - "email": "weird&'@gmail.tmt", - "institute": "inst", - "nationality": "American", - "gender": "OTHER", - "moreInfo": "I am just a student :P", - "pictureKey": "" - } - } -} diff --git a/src/test/resources/data/InstructorStudentListPageUiTest.json b/src/test/resources/data/InstructorStudentListPageUiTest.json deleted file mode 100644 index 80d23509673..00000000000 --- a/src/test/resources/data/InstructorStudentListPageUiTest.json +++ /dev/null @@ -1,371 +0,0 @@ -{ - "accounts": { - "instructorWithoutCourses": { - "googleId": "instructorWithoutCourses", - "name": "Instructor Without Courses", - "isInstructor": true, - "email": "iwc@yahoo.tmt", - "institute": "TEAMMATES Test Institute 7" - }, - "instructorWith2Courses": { - "googleId": "instructorWith2Courses", - "name": "Instructor With Two Courses", - "isInstructor": true, - "email": "iwithtwoc@yahoo.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "instructorOfCourse1": { - "googleId": "instructorOfCourse1", - "name": "Instructor of Course 1", - "isInstructor": true, - "email": "instr@course1.tmt", - "institute": "TEAMMATES Test Institute 7" - }, - "instructorOfCourse4": { - "googleId": "instructorOfCourse4", - "name": "Instructor of Course 4", - "isInstructor": true, - "email": "instr@course4.tmt", - "institute": "TEAMMATES Test Institute 9" - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "CSListUiT.idOfInstructor1OfTestingSanitizationCourse", - "name": "Instructor", - "isInstructor": true, - "email": "CSListUiT.instructor1@sanitization.tmt", - "institute": "inst" - }, - "Student3Course3": { - "googleId": "CCSDetailsUiT.charlie.tmms", - "name": "Charlie D", - "isInstructor": false, - "email": "CCSDetailsUiT.charlie.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "student1InTestingSanitizationCourse": { - "googleId": "CSListUiT.student1InTestingSanitizationCourse", - "name": "Stud1", - "isInstructor": false, - "email": "CSListUiT.normal@sanitization.tmt", - "institute": "inst" - } - }, - "courses": { - "course1": { - "id": "course1", - "name": "Name of Course 1", - "timeZone": "UTC" - }, - "course2": { - "id": "course2", - "name": "Name of Course 2", - "timeZone": "UTC" - }, - "course3": { - "id": "course3", - "name": "Name of Course 3", - "timeZone": "UTC" - }, - "course4": { - "id": "course4", - "name": "Name of Course 4", - "timeZone": "UTC" - }, - "testingSanitizationCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "CSListUiT.idOfTestingSanitizationCourse", - "name": "Testing", - "timeZone": "UTC" - } - }, - "instructors": { - "instructorOfCourse1": { - "googleId": "instructorOfCourse1", - "courseId": "course1", - "name": "Instructor1 Course1", - "email": "instr@course1.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor2OfCourse1": { - "googleId": "instructorOfCourse4", - "courseId": "course1", - "name": "Instructor1 Course4", - "email": "instr@course4.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfCourse2": { - "googleId": "instructorWith2Courses", - "courseId": "course2", - "name": "Instructor1 Course2", - "email": "iwithtwoc@yahoo.tmt", - "isArchived": false, - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfCourse3": { - "googleId": "instructorWith2Courses", - "courseId": "course3", - "name": "Instructor1 Course3", - "email": "iwithtwoc@yahoo.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor2OfCourse3": { - "googleId": "instructorOfCourse4", - "courseId": "course3", - "name": "Instructor1 Course4", - "email": "instr@course4.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfCourse4": { - "googleId": "instructorOfCourse4", - "courseId": "course4", - "name": "Instructor1 Course4", - "email": "instr@course4.tmt", - "isArchived": true, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "CSListUiT.idOfInstructor1OfTestingSanitizationCourse", - "courseId": "CSListUiT.idOfTestingSanitizationCourse", - "name": "Instructor", - "email": "CSListUiT.instructor1@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cangivecommentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canviewcommentinsection": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "Student1Course2": { - "googleId": "CCSDetailsUiT.alice.tmms", - "email": "CCSDetailsUiT.alice.tmms@gmail.tmt", - "course": "course2", - "name": "Alicetags and char here&'\"", - "comments": "This student's name is Alicetags and char here&'\"", - "team": "Team 1tags and char here&'\"", - "section": "Section Atags and char here&'\"" - }, - "Student2Course2": { - "googleId": "", - "email": "benny.c.tmms@gmail.tmt", - "course": "course2", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 2", - "section": "Section B" - }, - "Student3Course2": { - "googleId": "", - "email": "hugh.i.tmms@gmail.tmt", - "course": "course2", - "name": "Hugh Ivanov", - "comments": "This student's name is Hugh Ivanov", - "team": "Team 2", - "section": "Section B" - }, - "Student4Course2": { - "googleId": "", - "email": "ivan.j.tmms@gmail.tmt", - "course": "course2", - "name": "Ivan James", - "comments": "This student's name is Ivan James", - "team": "Team 3", - "section": "Section B" - }, - "Student5Course2": { - "googleId": "", - "email": "jack.k.tmms@gmail.tmt", - "course": "course2", - "name": "Jack Khan", - "comments": "This student's name is Jack Kahn", - "team": "Team 3", - "section": "Section B" - }, - "Student1Course3": { - "googleId": "CCSDetailsUiT.alice.tmms", - "email": "CCSDetailsUiT.alice.tmms@gmail.tmt", - "course": "course3", - "name": "Alicetags and char here&'\"", - "comments": "This student's name is Alicetags and char here&'\"", - "team": "Team 1tags and char here&'\"", - "section": "None" - }, - "Student2Course3": { - "googleId": "", - "email": "benny.c.tmms@gmail.tmt", - "course": "course3", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1tags and char here&'\"", - "section": "None" - }, - "Student3Course3": { - "googleId": "CCSDetailsUiT.charlie.tmms", - "email": "CCSDetailsUiT.charlie.tmms@gmail.tmt", - "course": "course3", - "name": "Charlie D", - "comments": "This student's name is Alice Betsy", - "team": "Team 2", - "section": "None" - }, - "Student4Course3": { - "googleId": "", - "email": "denny.c.tmms@gmail.tmt", - "course": "course3", - "name": "Denny Charlés", - "comments": "This student's name is Denny Charlés", - "team": "Team 2", - "section": "None" - }, - "Student5Course4": { - "googleId": "", - "email": "ann.tmms@gmail.tmt", - "course": "course4", - "name": "Ann", - "comments": "This student's name is Ann", - "team": "Team 1tags and char here&'\"", - "section": "None" - }, - "student1InTestingSanitizationCourse": { - "googleId": "CSListUiT.student1InTestingSanitizationCourse", - "email": "CSListUiT.normal@sanitization.tmt", - "course": "CSListUiT.idOfTestingSanitizationCourse", - "name": "Stud1", - "comments": "", - "team": "Team tags&\"", - "section": "Section'" - } - }, - "feedbackSessions": {}, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": { - "student1InTestingSanitizationCourse": { - "googleId": "student1InTestingSanitizationCourse", - "shortName": "Stud1", - "email": "weird&'@gmail.tmt", - "institute": "inst", - "nationality": "American", - "gender": "OTHER", - "moreInfo": "I am just a student :P", - "pictureKey": "" - } - } -} diff --git a/src/test/resources/data/InstructorStudentRecordsPageUiTest.json b/src/test/resources/data/InstructorStudentRecordsPageUiTest.json deleted file mode 100644 index c1262cd81df..00000000000 --- a/src/test/resources/data/InstructorStudentRecordsPageUiTest.json +++ /dev/null @@ -1,780 +0,0 @@ -{ - "accounts": { - "teammates.test": { - "googleId": "ISR.teammates.test", - "name": "Teammates Test", - "isInstructor": true, - "email": "teammates.test@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "teammates.test2": { - "googleId": "ISR.teammates.test2", - "name": "Teammates Test2", - "isInstructor": true, - "email": "teammates.test2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "teammates.test.Helper": { - "googleId": "ISR.teammates.test.Helper", - "name": "Teammates Test", - "isInstructor": true, - "email": "teammates.test.Helper@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "teammates.instr": { - "googleId": "ISR.teammates.instr", - "name": "Teammates Coord", - "isInstructor": true, - "email": "teammates.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "teammates.test@ISR.CS1101": { - "googleId": "ISR.teammates.test", - "name": "Teammates Test", - "isInstructor": true, - "email": "teammates.test@gmail.tmt", - "institute": "TEAMMATES Test Institute 10" - }, - "teammates.empty": { - "googleId": "ISR.no.eval", - "name": "Teammates Instr No Record", - "isInstructor": true, - "email": "teammates.norecord@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "benny.c.tmms@ISR.CS2104": { - "googleId": "ISR.benny.c.tmms", - "name": "Benny Charlés", - "isInstructor": false, - "email": "benny.c.tmms@gmail.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "ISR.sanitizationInstruct", - "name": "Instructor", - "isInstructor": true, - "email": "ISR.instruct@sanitization.tmt", - "institute": "inst\"" - }, - "student1InTestingSanitizationCourse": { - "googleId": "ISR.sanitizationStudent", - "name": "Stud1", - "isInstructor": false, - "email": "ISR.stud@sanitization.tmt", - "institute": "inst" - } - }, - "courses": { - "CS2104": { - "id": "ISR.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "CS1101": { - "id": "ISR.CS1101", - "name": "Programming Methodology", - "timeZone": "UTC" - }, - "NoEvalCourse": { - "id": "ISR.NoEval", - "name": "No Eval Course", - "timeZone": "UTC" - }, - "testingSanitizationCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "ISR.sanitizationCourse", - "name": "Testing", - "timeZone": "UTC" - } - }, - "instructors": { - "teammates.test.CS2104": { - "googleId": "ISR.teammates.test", - "courseId": "ISR.CS2104", - "name": "Teammates Test", - "email": "teammates.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test2.CS2104": { - "googleId": "ISR.teammates.test2", - "courseId": "ISR.CS2104", - "name": "Teammates Test2", - "email": "teammates.test2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.CS2104.Helper": { - "googleId": "ISR.teammates.test.Helper", - "courseId": "ISR.CS2104", - "name": "Teammates Test", - "email": "teammates.test.Helper@gmail.tmt", - "role": "Custom", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.test.CS1101": { - "googleId": "ISR.teammates.test", - "courseId": "ISR.CS1101", - "name": "Teammates Test", - "email": "teammates.test@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.instr.CS1101": { - "googleId": "ISR.teammates.instr", - "courseId": "ISR.CS1101", - "name": "Teammates Coord", - "email": "teammates.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "teammates.noeval": { - "googleId": "ISR.no.eval", - "courseId": "ISR.NoEval", - "name": "No Eval Instructor", - "email": "teammates.norecord@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "ISR.teammates.instr", - "courseId": "ISR.sanitizationCourse", - "name": "Instructor", - "email": "ISR.instruct@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "teammates.test@ISR.CS2104": { - "googleId": "ISR.teammates.test", - "email": "teammates.test@gmail.tmt", - "course": "ISR.CS2104", - "name": "Teammates Test", - "comments": "This student's name is Teammates Test", - "team": "Team 1", - "section": "None" - }, - "benny.c.tmms@ISR.CS2104": { - "googleId": "ISR.benny.c.tmms", - "email": "benny.c.tmms@gmail.tmt", - "course": "ISR.CS2104", - "name": "Benny Charlés", - "comments": "This student's name is Benny Charlés", - "team": "Team 1", - "section": "None" - }, - "charlie.d.tmms@ISR.CS2104": { - "googleId": "ISR.charlie.d.tmms", - "email": "charlie.d.tmms@gmail.tmt", - "course": "ISR.CS2104", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 1", - "section": "None" - }, - "alice.b.tmms@ISR.CS2104": { - "googleId": "ISR.alice.b.tmms", - "email": "alice.b.tmms@gmail.tmt", - "course": "ISR.CS2104", - "name": "Alice Betsy", - "comments": "This student's name is Alice Betsy", - "team": "Team 2", - "section": "None" - }, - "danny.e.tmms@ISR.CS2104": { - "googleId": "ISR.danny.e.tmms", - "email": "danny.e.tmms@gmail.tmt", - "course": "ISR.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - }, - "teammates.test@ISR.CS1101": { - "googleId": "ISR.teammates.test", - "email": "teammates.test@gmail.tmt", - "course": "ISR.CS1101", - "name": "Teammates Test", - "comments": "This student's name is Teammates Test", - "team": "Team 1", - "section": "None" - }, - "benny.c.tmms@ISR.CS1101": { - "googleId": "ISR.benny.c.tmms", - "email": "benny.c.tmms@gmail.tmt", - "course": "ISR.CS1101", - "name": "Benny Charlés", - "comments": "This student's name is Benny Charlés", - "team": "Team 1", - "section": "None" - }, - "charlie.d.tmms@ISR.CS1101": { - "googleId": "ISR.charlie.d.tmms", - "email": "charlie.d.tmms@gmail.tmt", - "course": "ISR.CS1101", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "danny.e.tmms@ISR.CS1101": { - "googleId": "ISR.danny.e.tmms", - "email": "danny.e.tmms@gmail.tmt", - "course": "ISR.CS1101", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - }, - "alice.b.tmms@ISR.NoEval": { - "googleId": "", - "email": "alice.b.tmms.noeval@gmail.tmt", - "course": "ISR.NoEval", - "name": "Alice Betsy", - "comments": "This student's name is Alice Betsy", - "team": "Team 1", - "section": "None" - }, - "student1InTestingSanitizationCourse": { - "googleId": "ISR.sanitizationStudent", - "email": "ISR.stud@sanitization.tmt", - "course": "ISR.sanitizationCourse", - "name": "Stud1\"", - "comments": "", - "team": "Team tags'\"", - "section": "Section\"" - } - }, - "feedbackSessions": { - "session1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "creatorEmail": "teammates.test@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2012-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session2InCourse1": { - "feedbackSessionName": "Second feedback session", - "courseId": "ISR.CS2104", - "creatorEmail": "teammates.test@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-03-20T23:59:00Z", - "startTime": "2013-06-01T21:59:00Z", - "endTime": "2026-04-28T21:59:00Z", - "sessionVisibleFromTime": "2013-03-20T21:59:00Z", - "resultsVisibleFromTime": "2026-04-29T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 5, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session3InCourse1": { - "feedbackSessionName": "3rd feedback session", - "courseId": "ISR.CS2104", - "creatorEmail": "instructor2@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:57:00Z", - "startTime": "2013-02-01T23:57:00Z", - "endTime": "2013-04-28T23:57:00Z", - "sessionVisibleFromTime": "2013-01-20T23:57:00Z", - "resultsVisibleFromTime": "2013-04-29T23:57:00Z", - "timeZone": "UTC", - "gracePeriod": 5, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session1InCourse2": { - "feedbackSessionName": "Instructor feedback session", - "courseId": "ISR.CS1101", - "creatorEmail": "teammates.test@gmail.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2027-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-03-28T15:59:00Z", - "resultsVisibleFromTime": "2027-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 0, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 5 other students' products" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 5, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "My comments on the class" - }, - "questionNumber": 3, - "giverType": "SELF", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "qn4InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "questionDetails": { - "hasAssignedWeights": false, - "mcqWeights": [], - "mcqOtherWeight": 0.0, - "numOfMcqChoices": 2, - "mcqChoices": [ - "It's good", - "It's perfect" - ], - "otherEnabled": false, - "generateOptionsFor": "NONE", - "questionType": "MCQ", - "questionText": "What do you like best about our product?" - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2InCourse1": { - "feedbackSessionName": "Second feedback session", - "courseId": "ISR.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 2 other teams." - }, - "questionNumber": 1, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 2, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn2InSession2InCourse1": { - "feedbackSessionName": "Second feedback session", - "courseId": "ISR.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 1 of your team mates" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession1InCourse2": { - "feedbackSessionName": "Instructor feedback session", - "courseId": "ISR.CS1101", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Please rate the following teams" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [], - "showGiverNameTo": [], - "showRecipientNameTo": [] - } - }, - "feedbackResponses": { - "response1": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "feedbackQuestionId": "1", - "giver": "alice.b.tmms@gmail.tmt", - "recipient": "alice.b.tmms@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "My product is light." - } - }, - "response2": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "feedbackQuestionId": "2", - "giver": "alice.b.tmms@gmail.tmt", - "recipient": "benny.c.tmms@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Benny is a good student." - } - }, - "response3": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "feedbackQuestionId": "2", - "giver": "benny.c.tmms@gmail.tmt", - "recipient": "danny.e.tmms@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Danny starts with D." - } - }, - "response4": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "feedbackQuestionId": "2", - "giver": "charlie.d.tmms@gmail.tmt", - "recipient": "alice.b.tmms@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice is a good coder." - } - }, - "response5": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "feedbackQuestionId": "2", - "giver": "benny.c.tmms@gmail.tmt", - "recipient": "charlie.d.tmms@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Charlie did alot of work." - } - }, - "response6": { - "feedbackSessionName": "First feedback session", - "courseId": "ISR.CS2104", - "feedbackQuestionId": "4", - "giver": "benny.c.tmms@gmail.tmt", - "recipient": "alice.b.tmms@gmail.tmt", - "responseDetails": { - "answer": "It's good", - "otherFieldContent": "", - "questionType": "MCQ" - } - } - }, - "feedbackResponseComments": { - "comment1FromT1C1ToR1Q2S1C1": { - "courseId": "ISR.CS2104", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "teammates.test2@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%alice.b.tmms@gmail.tmt%benny.c.tmms@gmail.tmt", - "showCommentTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2012-04-02T23:59:00Z", - "commentText": "First comment to Alice about feedback to Benny from different instructor" - }, - "comment2FromT1C1ToR1Q2S1C1": { - "courseId": "ISR.CS2104", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "teammates.test@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%alice.b.tmms@gmail.tmt%benny.c.tmms@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-01T23:59:00Z", - "lastEditorEmail": "teammates.test@gmail.tmt", - "lastEditedAt": "2026-03-02T23:59:00Z", - "commentText": "Instructor second comment to Alice about feedback to Benny" - }, - "comment3FromT1C1ToR1Q2S1C1": { - "courseId": "ISR.CS2104", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "teammates.test@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%alice.b.tmms@gmail.tmt%benny.c.tmms@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-02T23:59:00Z", - "commentText": "Instructor third comment to Alice about feedback to Benny" - }, - "comment1OnR1Q4S1C2": { - "courseId": "ISR.CS2104", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "4", - "commentGiver": "benny.c.tmms@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "4%benny.c.tmms@gmail.tmt%alice.b.tmms@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "STUDENTS", - "isVisibilityFollowingFeedbackQuestion": true, - "isCommentFromFeedbackParticipant": true, - "createdAt": "2016-01-01T23:59:00Z", - "commentText": "Benny's comment to alice" - }, - "comment1FromT1C1ToR1Q4S1C1": { - "courseId": "ISR.CS2104", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "4", - "commentGiver": "teammates.test@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "4%benny.c.tmms@gmail.tmt%alice.b.tmms@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-02T23:59:00Z", - "commentText": "Instructor comment to Benny about feedback to Alice" - } - }, - "profiles": { - "benny.c.tmms@ISR.CS2104": { - "googleId": "ISR.benny.c.tmms", - "shortName": "Ben", - "email": "", - "institute": "TEAMMATES Test Institute 7", - "nationality": "Singaporean", - "gender": "MALE", - "moreInfo": "This is a lot of info!", - "pictureKey": "" - }, - "student1InTestingSanitizationCourse": { - "googleId": "ISR.sanitizationStudent", - "shortName": "Stud1", - "email": "weird&'@gmail.tmt", - "institute": "inst", - "nationality": "American", - "gender": "OTHER", - "moreInfo": "I am just a student :P", - "pictureKey": "" - } - } -} diff --git a/src/test/resources/data/StudentCourseJoinAuthenticatedTest.json b/src/test/resources/data/StudentCourseJoinAuthenticatedTest.json deleted file mode 100644 index 8e789f444c9..00000000000 --- a/src/test/resources/data/StudentCourseJoinAuthenticatedTest.json +++ /dev/null @@ -1,377 +0,0 @@ -{ - "accounts": { - "instructor1OfCourse1": { - "googleId": "idOfInstructor1OfCourse1", - "name": "Instructor 1 of Course 1", - "isInstructor": true, - "email": "instr1@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "idOfInstructor1OfTestingSanitizationCourse", - "name": "Instructor", - "isInstructor": true, - "email": "instructor1@sanitization.tmt", - "institute": "inst" - }, - "student1InCourse1": { - "googleId": "student1InCourse1", - "name": "Student 1 in course 1", - "isInstructor": false, - "email": "student1InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "noFSStudent": { - "googleId": "idOfNoFSStudent", - "name": "No Fs Student", - "isInstructor": false, - "email": "noFSStudent@gmail.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "noFSStudent2": { - "googleId": "idOfNoFSStudent2", - "name": "No Fs Student 2", - "isInstructor": false, - "email": "noFSStudent2@gmail.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "noFSStudent3": { - "googleId": "idOfNoFSStudent3", - "name": "No Fs Student 3", - "isInstructor": false, - "email": "noFSStudent3@gmail.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "student1InTestingSanitizationCourse": { - "googleId": "student1InTestingSanitizationCourse", - "name": "Stud1", - "isInstructor": false, - "email": "normal@sanitization.tmt", - "institute": "inst" - } - }, - "courses": { - "typicalCourse1": { - "id": "idOfTypicalCourse1", - "name": "Typical Course 1 with 2 Evals", - "timeZone": "UTC" - }, - "courseNoEvals": { - "id": "idOfCourseNoEvals", - "name": "Typical Course 3 with 0 Evals", - "timeZone": "UTC" - }, - "testingSanitizationCourse": { - "createdAt": "2012-04-01T23:58:00Z", - "id": "idOfTestingSanitizationCourse", - "name": "Testing", - "timeZone": "UTC" - } - }, - "instructors": { - "instructor1OfCourse1": { - "googleId": "idOfInstructor1OfCourse1", - "courseId": "idOfTypicalCourse1", - "name": "Instructor1 Course1", - "email": "instructor1@course1.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1OfTestingSanitizationCourse": { - "googleId": "idOfInstructor1OfTestingSanitizationCourse", - "courseId": "idOfTestingSanitizationCourse", - "name": "Instructor", - "email": "instructor1@sanitization.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "inst'\"/>", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cangivecommentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canviewcommentinsection": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "email": "student1InCourse1@gmail.tmt", - "course": "idOfTypicalCourse1", - "name": "student1 In Course1'\"", - "comments": "comment for student1InCourse1'\"", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "noFSStudentWithNoProfile": { - "googleId": "", - "email": "noFSStudent@gmail.tmt", - "course": "idOfCourseNoEvals", - "name": "No Profile Student", - "comments": "", - "team": "Team 1", - "section": "Section 1" - }, - "noFSStudentWithPartialProfile": { - "googleId": "", - "email": "noFSStudent2@gmail.tmt", - "course": "idOfCourseNoEvals", - "name": "Partial Profile Student", - "comments": "", - "team": "Team 1", - "section": "Section 1" - }, - "noFSStudentWithFullProfile": { - "googleId": "", - "email": "noFSStudent3@gmail.tmt", - "course": "idOfCourseNoEvals", - "name": "Full Profile Student", - "comments": "", - "team": "Team 1", - "section": "Section 1" - }, - "student1InTestingSanitizationCourse": { - "googleId": "", - "email": "normal@sanitization.tmt", - "course": "idOfTestingSanitizationCourse", - "name": "Stud1", - "comments": "", - "team": "Team tags&\"", - "section": "Section'" - } - }, - "feedbackSessions": { - "session1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "nonViewableSession": { - "feedbackSessionName": "Nonviewable feedback session", - "courseId": "idOfCourseNoEvals", - "creatorEmail": "instructor1@course2.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2300-04-01T15:59:00Z", - "endTime": "2317-04-30T15:59:00Z", - "sessionVisibleFromTime": "2300-03-20T15:59:00Z", - "resultsVisibleFromTime": "2317-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 0, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 1 other student's product" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "My comments on the class" - }, - "questionNumber": 3, - "giverType": "SELF", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "qn4InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Instructor comments on the class" - }, - "questionNumber": 4, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "qnInUnviewableSession": { - "feedbackSessionName": "Nonviewable feedback session", - "courseId": "idOfCourseNoEvals", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Please rate your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [], - "showGiverNameTo": [], - "showRecipientNameTo": [] - } - }, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "shortName": "Stud1", - "email": "i.m.stud1@gmail.tmt", - "institute": "TEAMMATES Test Institute 3", - "nationality": "American", - "gender": "MALE", - "moreInfo": "I am just a student :P", - "pictureKey": "asdf34&hfn3!@" - }, - "noFSStudent2": { - "googleId": "idOfNoFSStudent2", - "shortName": "Student with no picture", - "email": "noFSStudent2@gmail.tmt", - "institute": "TEAMMATES Test Institute 5", - "nationality": "Singaporean", - "gender": "MALE", - "moreInfo": "I am a student", - "pictureKey": "" - }, - "noFSStudent3": { - "googleId": "idOfNoFSStudent3", - "shortName": "Full Profile Student", - "email": "noFSStudent3@gmail.tmt", - "institute": "TEAMMATES Test Institute 5", - "nationality": "Singaporean", - "gender": "MALE", - "moreInfo": "I am a student", - "pictureKey": "asdf34&hfn3!@" - }, - "student1InTestingSanitizationCourse": { - "googleId": "student1InTestingSanitizationCourse", - "shortName": "Stud1", - "email": "weird&'@gmail.tmt", - "institute": "inst", - "nationality": "American", - "gender": "OTHER", - "moreInfo": "I am just a student :P", - "pictureKey": "" - } - } -} diff --git a/src/test/resources/data/StudentCourseJoinConfirmationPageUiTest.json b/src/test/resources/data/StudentCourseJoinConfirmationPageUiTest.json deleted file mode 100644 index 326fef7f561..00000000000 --- a/src/test/resources/data/StudentCourseJoinConfirmationPageUiTest.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "accounts": { - "SCJConfirmationUiT.instr": { - "googleId": "SCJConfirmationUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "SCJConfirmationUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "alice.tmms": { - "googleId": "${value.injected.in.testfile}", - "name": "Alice B", - "isInstructor": false, - "email": "${value.injected.in.testfile}", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "SCJConfirmationUiT.CS2104": { - "id": "SCJConfirmationUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - }, - "SCJConfirmationUiT.CS2103": { - "id": "SCJConfirmationUiT.CS2103", - "name": "Software Engineering", - "timeZone": "UTC" - }, - "SCJConfirmationUiT.CS1101": { - "id": "SCJConfirmationUiT.CS1101", - "name": "Programming Methodology", - "timeZone": "UTC" - } - }, - "instructors": { - "SCJConfirmationUiT.instr.CS2104": { - "googleId": "SCJConfirmationUiT.instr", - "courseId": "SCJConfirmationUiT.CS2104", - "name": "Teammates Test", - "email": "SCJConfirmationUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "SCJConfirmationUiT.instr.CS1101": { - "googleId": "SCJConfirmationUiT.instr", - "courseId": "SCJConfirmationUiT.CS1101", - "name": "Teammates Test", - "email": "SCJConfirmationUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "alice.tmms@SCJConfirmationUiT.CS2104": { - "googleId": "", - "email": "${value.injected.in.testfile}", - "course": "SCJConfirmationUiT.CS2104", - "name": "Amy Betsy'\"", - "comments": "This student's name is Amy Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "alice.tmms@SCJConfirmationUiT.CS2103": { - "googleId": "", - "email": "${value.injected.in.testfile}", - "course": "SCJConfirmationUiT.CS2103", - "name": "Amy Betsy'\"", - "comments": "This student's name is Amy Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "alice.tmms@SCJConfirmationUiT.CS1101": { - "googleId": "${value.injected.in.testfile}", - "email": "${value.injected.in.testfile}", - "course": "SCJConfirmationUiT.CS1101", - "name": "Amy Betsy'\"", - "comments": "This student's name is Amy Betsy'\"", - "team": "Team 1'\"", - "section": "None" - } - }, - "feedbackSessions": {}, - "feedbackQuestions": {}, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/StudentFeedbackQuestionSubmitPageUiTest.json b/src/test/resources/data/StudentFeedbackQuestionSubmitPageUiTest.json deleted file mode 100644 index 23122ee2a6c..00000000000 --- a/src/test/resources/data/StudentFeedbackQuestionSubmitPageUiTest.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "accounts": { - "SFQSubmitUiT.instr": { - "googleId": "SFQSubmitUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "SFQSubmitUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFQSubmitUiT.alice.b": { - "googleId": "SFQSubmitUiT.alice.b", - "name": "Alice Betsy", - "isInstructor": false, - "email": "SFQSubmitUiT.alice.b@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "SFQSubmitUiT.CS2104": { - "id": "SFQSubmitUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - } - }, - "instructors": { - "SFQSubmitUiT.instr": { - "googleId": "SFQSubmitUiT.instr", - "courseId": "SFQSubmitUiT.CS2104", - "name": "Teammates Test", - "email": "SFQSubmitUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "Alice": { - "googleId": "SFQSubmitUiT.alice.b", - "email": "SFQSubmitUiT.alice.b@gmail.tmt", - "course": "SFQSubmitUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "Unregistered": { - "googleId": "", - "email": "unregistered@gmail.tmt", - "course": "SFQSubmitUiT.CS2104", - "name": "Unregistered Charles", - "comments": "This student's name is Unreg Charles", - "team": "Team 1'\"", - "section": "None" - } - }, - "feedbackSessions": { - "Open Session": { - "feedbackSessionName": "Open Session", - "courseId": "SFQSubmitUiT.CS2104", - "creatorEmail": "SFQSubmitUiT.instr@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Closed Session": { - "feedbackSessionName": "Closed Session", - "courseId": "SFQSubmitUiT.CS2104", - "creatorEmail": "SFQSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2012-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Awaiting Session": { - "feedbackSessionName": "Awaiting Session", - "courseId": "SFQSubmitUiT.CS2104", - "creatorEmail": "SFQSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the last feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2035-04-02T15:59:00Z", - "endTime": "2035-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1": { - "feedbackSessionName": "Open Session", - "courseId": "SFQSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2": { - "feedbackSessionName": "Closed Session", - "courseId": "SFQSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession3": { - "feedbackSessionName": "Awaiting Session", - "courseId": "SFQSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - } - }, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/StudentFeedbackResultsPageUiTest.json b/src/test/resources/data/StudentFeedbackResultsPageUiTest.json deleted file mode 100644 index 916b67ce4b1..00000000000 --- a/src/test/resources/data/StudentFeedbackResultsPageUiTest.json +++ /dev/null @@ -1,2087 +0,0 @@ -{ - "accounts": { - "SFResultsUiT.instr": { - "googleId": "SFResultsUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "SFResultsUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFResultsUiT.alice.b": { - "googleId": "SFResultsUiT.alice.b", - "name": "Alice B.", - "isInstructor": false, - "email": "SFResultsUiT.alice.b@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFResultsUiT.benny.c": { - "googleId": "SFResultsUiT.benny.c", - "name": "Benny C.", - "isInstructor": false, - "email": "SFResultsUiT.benny.c@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFResultsUiT.charlie.d": { - "googleId": "SFResultsUiT.charlie.d", - "name": "Charlie D.", - "isInstructor": false, - "email": "SFResultsUiT.charlie.d@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFResultsUiT.danny.e": { - "googleId": "SFResultsUiT.danny.e", - "name": "Danny E.", - "isInstructor": false, - "email": "SFResultsUiT.danny.e@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFResultsUiT.emily.f": { - "googleId": "SFResultsUiT.emily.f", - "name": "Emily F.", - "isInstructor": false, - "email": "SFResultsUiT.emily.f@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "SFResultsUiT.CS2104": { - "id": "SFResultsUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - } - }, - "instructors": { - "SFResultsUiT.instr": { - "googleId": "SFResultsUiT.instr", - "courseId": "SFResultsUiT.CS2104", - "name": "Teammates Test", - "email": "SFResultsUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Co-owner", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "Alice": { - "googleId": "SFResultsUiT.alice.b", - "email": "SFResultsUiT.alice.b@gmail.tmt", - "course": "SFResultsUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team 1'\"", - "section": "None" - }, - "Benny": { - "googleId": "SFResultsUiT.benny.c", - "email": "SFResultsUiT.benny.c@gmail.tmt", - "course": "SFResultsUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team 1'\"", - "section": "None" - }, - "ExtraGuy": { - "googleId": "extra.guy", - "email": "extra.guy@gmail.tmt", - "course": "SFResultsUiT.CS2104", - "name": "Extra guy", - "comments": "This student will move to a new team after evaluation created", - "team": "Team 2", - "section": "None" - }, - "DropOut": { - "googleId": "", - "email": "drop.out@gmail.tmt", - "course": "SFResultsUiT.CS2104", - "name": "Drop out", - "comments": "This student will drop out after evaluation created", - "team": "Team 2", - "section": "None" - }, - "Charlie": { - "googleId": "SFResultsUiT.charlie.d", - "email": "SFResultsUiT.charlie.d@gmail.tmt", - "course": "SFResultsUiT.CS2104", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "Danny": { - "googleId": "SFResultsUiT.danny.e", - "email": "SFResultsUiT.danny.e@gmail.tmt", - "course": "SFResultsUiT.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - }, - "Emily": { - "googleId": "SFResultsUiT.emily.f", - "email": "SFResultsUiT.emily.f@gmail.tmt", - "course": "SFResultsUiT.CS2104", - "name": "Emily", - "comments": "This student's name is Emily", - "team": "Team 3", - "section": "None" - } - }, - "feedbackSessions": { - "Open Session": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Unpublished Session": { - "feedbackSessionName": "Second Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Empty Session": { - "feedbackSessionName": "Third Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Please please fill in the last feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "MCQ Session": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Instructions for mcq session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "MSQ Session": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Instructions for mcq session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "NUMSCALE Session": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Instructions for numscale session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "CONSTSUM Session": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Instructions for constsum session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "CONTRIB Session": { - "feedbackSessionName": "CONTRIB Session", - "courseId": "SFResultsUiT.CS2104", - "creatorEmail": "SFResultsUiT.instr@gmail.tmt", - "instructions": "Instructions for contrib session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ] - }, - "qn2InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 3 other students' products" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Feedback to class" - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [] - }, - "qn4InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 3 other teams." - }, - "questionNumber": 4, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn5InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your team mates" - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn6InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback on how well the team worked together." - }, - "questionNumber": 6, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn7InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should be hidden." - }, - "questionNumber": 7, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InMcqSession": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "UI", - "Algo" - ], - "questionText": "What is the best selling point of your product?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InMcqSession": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 3, - "mcqChoices": [ - "Good", - "OK", - "Poor" - ], - "questionText": "Rate 3 other students' products", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InMcqSession": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "Good", - "Can improve" - ], - "questionText": "Give feedback to your team mates", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn4InMcqSession": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Choose the best student in the course.", - "questionType": "MCQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn5InMcqSession": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Choose the best team in the course.", - "questionType": "MCQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InMsqSession": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "UI", - "Algo" - ], - "questionText": "What is the best selling point of your product?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InMsqSession": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "Good", - "OK", - "Poor" - ], - "questionText": "Rate 3 other students' products", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InMsqSession": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "Good", - "Can improve" - ], - "questionText": "Give feedback to your team mates", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn4InMsqSession": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Choose the students you were impressed by in the course.", - "questionType": "MSQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn5InMsqSession": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Choose the teams you were impressed by in the course.", - "questionType": "MSQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate your product?", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate others' product?", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate your team's product?", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn4InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate the class", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [] - }, - "qn5InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate other team's products", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 5, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn6InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate other team's products. Responses are visible to the entire class", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 6, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER", - "STUDENTS" - ] - }, - "qn7InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate your team member's individual products, including your own", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 7, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn8InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate every student's individual products. Responses are visible to the entire class", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 8, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER", - "STUDENTS" - ] - }, - "qn9InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate other teams' products. Responses, but not giver or recipient names, are visible to the entire class", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 9, - "giverType": "STUDENTS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn10InNumscaleSession": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "minScale": -5, - "questionText": "Rate teammates, recipient hidden. ", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 10, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "STUDENTS" - ], - "showGiverNameTo": [ - "RECEIVER", - "STUDENTS" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InConstSumSession": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "pointsPerOption": false, - "questionText": "How important are the following factors to you? Give points accordingly.", - "numOfConstSumOptions": 2, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Grades", - "Fun" - ] - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InConstSumSession": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "pointsPerOption": true, - "questionText": "Split points among 3 students.", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "STUDENTS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InConstSumSession": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "pointsPerOption": true, - "questionText": "Split points among your team members by how much they contributed.", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS" - ] - }, - "qn1InContribSession": { - "feedbackSessionName": "CONTRIB Session", - "courseId": "SFResultsUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution by yourself and your team members.", - "questionType": "CONTRIB" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": { - "response1": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Alice self feedback." - } - }, - "response2": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Benny." - } - }, - "response3": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Danny." - } - }, - "response3a": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "drop.out@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Dropout." - } - }, - "response3b": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "drop.out@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Alice from Dropout." - } - }, - "response3c": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "drop.out@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Danny from Dropout." - } - }, - "response3d": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "drop.out@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response to Benny from Dropout." - } - }, - "response4": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "%GENERAL%", - "responseDetails": { - "questionType": "TEXT", - "answer": "Secret feedback about class. (to nobody test)" - } - }, - "response5": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "%GENERAL%", - "responseDetails": { - "questionType": "TEXT", - "answer": "Secret feedback about class. (to nobody test)" - } - }, - "response6": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.danny.e@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "questionType": "TEXT", - "answer": "Team 2 (danny) to team 1" - } - }, - "response7": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.emily.f@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "questionType": "TEXT", - "answer": "Team 3 to Team 1 \r\n multiline special char test" - } - }, - "response8": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "Team 2", - "responseDetails": { - "questionType": "TEXT", - "answer": "alice to team 2" - } - }, - "response9": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Teammate feedback from benny" - } - }, - "response10": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Teammate feedback from alice" - } - }, - "response11": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "questionType": "TEXT", - "answer": "Feedback from alice to the team" - } - }, - "response12": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "questionType": "TEXT", - "answer": "Feedback from benny to the team" - } - }, - "response13": { - "feedbackSessionName": "First Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "SFResultsUiT.instr@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "questionType": "TEXT", - "answer": "Feedback from instructor to Alice" - } - }, - "mcqResponse1": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": "Algo", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse2": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": "Good", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse2a": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "drop.out@gmail.tmt", - "recipient": "SFResultsUiT.charlie.d@gmail.tmt", - "responseDetails": { - "answer": "Good", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse2b": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "drop.out@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "answer": "Good", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse3": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "answer": "OK", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse4": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": "Can improve", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse5": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "answer": "Danny", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "mcqResponse6": { - "feedbackSessionName": "MCQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": "Team 1", - "otherFieldContent": "", - "questionType": "MCQ" - } - }, - "msqResponse1": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answers": [ - "Algo" - ], - "questionType": "MSQ" - } - }, - "msqResponse2": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - "UI" - ], - "questionType": "MSQ" - } - }, - "msqResponse3": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - "Good", - "OK" - ], - "questionType": "MSQ" - } - }, - "msqResponse4": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "answers": [ - "OK", - "Poor" - ], - "questionType": "MSQ" - } - }, - "msqResponse5": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.charlie.d@gmail.tmt", - "responseDetails": { - "answers": [ - "OK" - ], - "questionType": "MSQ" - } - }, - "msqResponse6": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.danny.e@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - "Poor" - ], - "questionType": "MSQ" - } - }, - "msqResponse7": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.danny.e@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answers": [ - "Good" - ], - "questionType": "MSQ" - } - }, - "msqResponse8": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answers": [ - "Can improve" - ], - "questionType": "MSQ" - } - }, - "msqResponse9": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - "Can improve" - ], - "questionType": "MSQ" - } - }, - "msqResponse10": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "answers": [ - "Danny", - "Alice" - ], - "questionType": "MSQ" - } - }, - "msqResponse11": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - "Benny", - "Danny" - ], - "questionType": "MSQ" - } - }, - "msqResponse12": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answers": [ - "Team 1", - "Team 2" - ], - "questionType": "MSQ" - } - }, - "msqResponse13": { - "feedbackSessionName": "MSQ Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - "Team 1" - ], - "questionType": "MSQ" - } - }, - "numscaleResponse1": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": 1, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse2": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse3": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "answer": 3.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse4": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": 2.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse5": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.danny.e@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": 2, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse6": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "%GENERAL%", - "responseDetails": { - "answer": -2, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse7": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "4", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "%GENERAL%", - "responseDetails": { - "answer": 2.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse8": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "SFResultsUiT.danny.e@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "answer": 3.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse9": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "5", - "giver": "SFResultsUiT.emily.f@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "answer": 4, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse10": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "SFResultsUiT.charlie.d@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "answer": 4.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse11": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "SFResultsUiT.danny.e@gmail.tmt", - "recipient": "Team 1'\"", - "responseDetails": { - "answer": 3.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse12": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "Team 2", - "responseDetails": { - "answer": 3.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse13": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "6", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "Team 2", - "responseDetails": { - "answer": 5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse14": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": 3, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse15": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": 3.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse16": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse17": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "7", - "giver": "SFResultsUiT.charlie.d@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 1.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse18": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "SFResultsUiT.charlie.d@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 1.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse19": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.charlie.d@gmail.tmt", - "responseDetails": { - "answer": 1, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse20": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.charlie.d@gmail.tmt", - "responseDetails": { - "answer": 4.5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse21": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "8", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 4, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse22": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "9", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "Team 2", - "responseDetails": { - "answer": 5, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse23": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "9", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "Team 2", - "responseDetails": { - "answer": 2, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse24": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "9", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "Team 3", - "responseDetails": { - "answer": 3, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse25": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "SFResultsUiT.emily.f@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 1, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse26": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "SFResultsUiT.charlie.d@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 2, - "questionType": "NUMSCALE" - } - }, - "numscaleResponse27": { - "feedbackSessionName": "NUMSCALE Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "10", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 4.5, - "questionType": "NUMSCALE" - } - }, - "constsumResponse1": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answers": [ - 20, - 80 - ], - "questionType": "CONSTSUM" - } - }, - "constsumResponse2": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - 30, - 70 - ], - "questionType": "CONSTSUM" - } - }, - "constsumResponse3": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - 80 - ], - "questionType": "CONSTSUM" - } - }, - "constsumResponse4": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.charlie.d@gmail.tmt", - "responseDetails": { - "answers": [ - 100 - ], - "questionType": "CONSTSUM" - } - }, - "constsumResponse5": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.danny.e@gmail.tmt", - "responseDetails": { - "answers": [ - 20 - ], - "questionType": "CONSTSUM" - } - }, - "constsumResponse6": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "2", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answers": [ - 200 - ], - "questionType": "CONSTSUM" - } - }, - "constsumResponse7": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answers": [ - 99 - ], - "questionType": "CONSTSUM" - } - }, - "constsumResponse8": { - "feedbackSessionName": "CONSTSUM Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "3", - "giver": "SFResultsUiT.benny.c@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answers": [ - 101 - ], - "questionType": "CONSTSUM" - } - }, - "contribResponse1": { - "feedbackSessionName": "CONTRIB Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.alice.b@gmail.tmt", - "responseDetails": { - "answer": 110, - "questionType": "CONTRIB" - } - }, - "contribResponse2": { - "feedbackSessionName": "CONTRIB Session", - "courseId": "SFResultsUiT.CS2104", - "feedbackQuestionId": "1", - "giver": "SFResultsUiT.alice.b@gmail.tmt", - "recipient": "SFResultsUiT.benny.c@gmail.tmt", - "responseDetails": { - "answer": 100, - "questionType": "CONTRIB" - } - } - }, - "feedbackResponseComments": { - "comment1FromT1C1ToR1Q1S1C1": { - "courseId": "SFResultsUiT.CS2104", - "feedbackSessionName": "First Session", - "feedbackQuestionId": "1", - "commentGiver": "SFResultsUiT.instr@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "1%SFResultsUiT.alice.b@gmail.tmt%SFResultsUiT.alice.b@gmail.tmt", - "showCommentTo": [ - "STUDENTS" - ], - "showGiverNameTo": [ - "STUDENTS" - ], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-01T23:59:00Z", - "lastEditorEmail": "SFResultsUiT.instr@gmail.tmt", - "lastEditedAt": "2026-03-02T23:59:00Z", - "commentText": "Instructor first comment to Alice" - }, - "comment2FromT1C1ToR1Q1S1C1": { - "courseId": "SFResultsUiT.CS2104", - "feedbackSessionName": "First Session", - "feedbackQuestionId": "1", - "commentGiver": "SFResultsUiT.instr@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "1%SFResultsUiT.alice.b@gmail.tmt%SFResultsUiT.alice.b@gmail.tmt", - "showCommentTo": [ - "STUDENTS" - ], - "showGiverNameTo": [ - "STUDENTS" - ], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-02T23:59:00Z", - "commentText": "Instructor second comment to Alice" - }, - "comment1OnMCQQuestion1": { - "courseId": "SFResultsUiT.CS2104", - "feedbackSessionName": "MCQ Session", - "feedbackQuestionId": "1", - "commentGiver": "SFResultsUiT.alice.b@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "1%SFResultsUiT.alice.b@gmail.tmt%SFResultsUiT.alice.b@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "STUDENTS", - "isVisibilityFollowingFeedbackQuestion": true, - "isCommentFromFeedbackParticipant": true, - "createdAt": "2026-03-02T23:59:00Z", - "commentText": "Alice comment for herself" - }, - "comment1OnMCQQuestion2": { - "courseId": "SFResultsUiT.CS2104", - "feedbackSessionName": "MCQ Session", - "feedbackQuestionId": "2", - "commentGiver": "drop.out@gmail.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%drop.out@gmail.tmt%SFResultsUiT.danny.e@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "STUDENTS", - "isVisibilityFollowingFeedbackQuestion": true, - "isCommentFromFeedbackParticipant": true, - "createdAt": "2026-03-02T23:59:00Z", - "commentText": "Drop out comment to danny" - } - }, - "profiles": {} -} diff --git a/src/test/resources/data/StudentFeedbackSubmissionEditPageActionTest.json b/src/test/resources/data/StudentFeedbackSubmissionEditPageActionTest.json deleted file mode 100644 index 8defa90ed69..00000000000 --- a/src/test/resources/data/StudentFeedbackSubmissionEditPageActionTest.json +++ /dev/null @@ -1,1288 +0,0 @@ -{ - "accounts": { - "instructor1OfCourse1": { - "googleId": "idOfInstructor1OfCourse1", - "name": "Instructor 1 of Course 1", - "isInstructor": true, - "email": "instr1@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor2OfCourse1": { - "googleId": "idOfInstructor2OfCourse1", - "name": "Instructor 2 of Course 1", - "isInstructor": true, - "email": "instr2@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "helper1OfCourse1": { - "googleId": "idOfHelper1OfCourse1", - "name": "Helper1 of Course 1", - "isInstructor": true, - "email": "helper1@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "helper2OfCourse1": { - "googleId": "idOfHelper2OfCourse1", - "name": "Helper2 of Course 1", - "isInstructor": true, - "email": "helper2@course1.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor1OfCourse2": { - "googleId": "idOfInstructor1OfCourse2", - "name": "Instructor 1 of Course 2", - "isInstructor": true, - "email": "instr1@course2.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor2OfCourse2": { - "googleId": "idOfInstructor2OfCourse2", - "name": "Instructor 2 of Course 2", - "isInstructor": true, - "email": "instr2@course2.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor3": { - "googleId": "idOfInstructor3", - "name": "Instructor 3 of Course 1 and 2", - "isInstructor": true, - "email": "instr3@course1n2.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor4": { - "googleId": "idOfInstructor4", - "name": "Instructor 4 of CourseNoEvals", - "isInstructor": true, - "email": "instr4@coursenoevals.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructor5": { - "googleId": "idOfInstructor5", - "name": "Instructor 5 of CourseNoRegister", - "isInstructor": true, - "email": "instructor5@courseNoRegister.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "instructorWithoutCourses": { - "googleId": "instructorWithoutCourses", - "name": "Instructor Without Courses", - "isInstructor": true, - "email": "iwc@yahoo.tmt", - "institute": "TEAMMATES Test Institute 7" - }, - "instructorWithOnlyOneSampleCourse": { - "googleId": "idOfInstructorWithOnlyOneSampleCourse", - "name": "Instructor With Only One Sample Course", - "isInstructor": true, - "email": "iwosc@yahoo.tmt", - "institute": "TEAMMATES Test Institute 7" - }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "isInstructor": true, - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "institute": "TEAMMATES Test Institute 5" - }, - "student1InCourse1": { - "googleId": "student1InCourse1", - "name": "Student 1 in course 1", - "isInstructor": false, - "email": "student1InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student2InCourse1": { - "googleId": "student2InCourse1", - "name": "Student in two courses", - "isInstructor": false, - "email": "student2InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "name": "Student in Archived Course", - "isInstructor": false, - "email": "student1InCourse1@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "typicalCourse1": { - "id": "idOfTypicalCourse1", - "name": "Typical Course 1 with 2 Evals", - "timeZone": "UTC" - }, - "typicalCourse2": { - "id": "idOfTypicalCourse2", - "name": "Typical Course 2 with 1 Evals", - "timeZone": "UTC" - }, - "courseNoEvals": { - "id": "idOfCourseNoEvals", - "name": "Typical Course 3 with 0 Evals", - "timeZone": "UTC" - }, - "sampleCourse": { - "id": "idOfSampleCourse-demo", - "name": "Sample Course", - "timeZone": "UTC" - }, - "archivedCourse": { - "id": "idOfArchivedCourse", - "name": "Archived Course", - "timeZone": "UTC" - }, - "unregisteredCourse": { - "id": "idOfUnregisteredCourse", - "name": "Unregistered Course", - "timeZone": "UTC" - } - }, - "instructors": { - "instructor1OfCourse1": { - "googleId": "idOfInstructor1OfCourse1", - "courseId": "idOfTypicalCourse1", - "name": "Instructor1 Course1", - "email": "instructor1@course1.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor2OfCourse1": { - "googleId": "idOfInstructor2OfCourse1", - "courseId": "idOfTypicalCourse1", - "name": "Instructor2 Course1", - "email": "instructor2@course1.tmt", - "role": "Manager", - "isDisplayedToStudents": true, - "displayedName": "Manager", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": false, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "helper1OfCourse1": { - "googleId": "idOfHelper1OfCourse1", - "courseId": "idOfTypicalCourse1", - "name": "Helper1 Course1", - "email": "helper1@course1.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Helper", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "helper2OfCourse1": { - "googleId": "idOfHelper2OfCourse1", - "courseId": "idOfTypicalCourse1", - "name": "Helper2 Course1", - "email": "helper2@course1.tmt", - "role": "Custom", - "isDisplayedToStudents": false, - "displayedName": "Helper", - "privileges": { - "courseLevel": { - "canviewstudentinsection": false, - "cansubmitsessioninsection": false, - "canmodifysessioncommentinsection": false, - "canmodifycourse": false, - "canviewsessioninsection": false, - "canmodifysession": false, - "canmodifystudent": false, - "canmodifyinstructor": false - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor1OfCourse2": { - "googleId": "idOfInstructor1OfCourse2", - "courseId": "idOfTypicalCourse2", - "name": "Instructor1 Course2", - "email": "instructor1@course2.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor2OfCourse2": { - "googleId": "idOfInstructor2OfCourse2", - "courseId": "idOfTypicalCourse2", - "name": "Instructor2 Course2", - "email": "instructor2@course2.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor3OfCourse1": { - "googleId": "idOfInstructor3", - "courseId": "idOfTypicalCourse1", - "name": "Instructor3 Course1", - "email": "instructor3@course1.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor3OfCourse2": { - "googleId": "idOfInstructor3", - "courseId": "idOfTypicalCourse2", - "name": "Instructor3 Course2", - "email": "instructor3@course2.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor4": { - "googleId": "idOfInstructor4", - "courseId": "idOfCourseNoEvals", - "name": "Instructor4 name", - "email": "instructor4@courseNoEvals.tmt", - "isArchived": false, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructor5": { - "googleId": "idOfInstructor5", - "courseId": "idOfUnregisteredCourse", - "name": "Instructor 5 of CourseNoRegister", - "email": "instructor5@courseNoRegister.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorWithOnlyOneSampleCourse": { - "googleId": "idOfInstructorWithOnlyOneSampleCourse", - "courseId": "idOfSampleCourse-demo", - "name": "Instructor With Only One Sample Course", - "email": "iwosc@yahoo.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorOfArchivedCourse": { - "googleId": "idOfInstructorOfArchivedCourse", - "courseId": "idOfArchivedCourse", - "name": "InstructorOfArchiveCourse name", - "email": "instructorOfArchiveCourse@archiveCourse.tmt", - "isArchived": true, - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "instructorNotYetJoinCourse": { - "courseId": "idOfSampleCourse-demo", - "name": "Instructor Not Yet Joined Course", - "email": "instructorNotYetJoined@email.tmt", - "key": "regKeyForInstrNotYetJoinCourse", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "email": "student1InCourse1@gmail.tmt", - "course": "idOfTypicalCourse1", - "name": "student1 In Course1'\"", - "comments": "comment for student1InCourse1'\"", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student2InCourse1": { - "googleId": "student2InCourse1", - "email": "student2InCourse1@gmail.tmt", - "course": "idOfTypicalCourse1", - "name": "student2 In Course1", - "comments": "", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student3InCourse1": { - "googleId": "student3InCourse1", - "email": "student3InCourse1@gmail.tmt", - "course": "idOfTypicalCourse1", - "name": "student3 In Course1", - "comments": "", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student4InCourse1": { - "googleId": "student4InCourse1", - "email": "student4InCourse1@gmail.tmt", - "course": "idOfTypicalCourse1", - "name": "student4 In Course1", - "comments": "", - "team": "Team 1.1'\"", - "section": "Section 1" - }, - "student5InCourse1": { - "googleId": "student5InCourse1", - "email": "student5InCourse1@gmail.tmt", - "course": "idOfTypicalCourse1", - "name": "student5 In Course1", - "comments": "", - "team": "Team 1.2", - "section": "Section 2" - }, - "student1InCourse2": { - "googleId": "student1InCourse2", - "email": "student1InCourse2@gmail.tmt", - "course": "idOfTypicalCourse2", - "name": "student1 In Course2", - "comments": "", - "team": "Team 2.1", - "section": "None" - }, - "student2InCourse2": { - "googleId": "student2InCourse1", - "email": "student2InCourse1@gmail.tmt", - "course": "idOfTypicalCourse2", - "name": "student2 In Course2", - "comments": "#####This is the same student as student2InCourse1 but using different name and email #####", - "team": "Team 2.1", - "section": "None" - }, - "student1InUnregisteredCourse": { - "googleId": "", - "email": "student1InUnregisteredCourse@gmail.tmt", - "course": "idOfUnregisteredCourse", - "name": "student1 In unregisteredCourse", - "comments": "", - "team": "Team 1", - "section": "Section 1", - "key": "regKeyForStuNotYetJoinCourse" - }, - "student2InUnregisteredCourse": { - "googleId": "", - "email": "student2InUnregisteredCourse@gmail.tmt", - "course": "idOfUnregisteredCourse", - "name": "student2 In unregisteredCourse", - "comments": "", - "team": "Team 2", - "section": "Section 2", - "key": "regKey2ForStuNotYetJoinCourse" - }, - "student1InArchivedCourse": { - "googleId": "student1InArchivedCourse", - "email": "student1InArchivedCourse@gmail.tmt", - "course": "idOfArchivedCourse", - "name": "student1 In Course1", - "comments": "", - "team": "Team 2.1", - "section": "None" - } - }, - "feedbackSessions": { - "session1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T21:59:00Z", - "endTime": "2027-04-30T21:59:00Z", - "sessionVisibleFromTime": "2012-03-28T21:59:00Z", - "resultsVisibleFromTime": "2027-05-01T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session2InCourse1": { - "feedbackSessionName": "Second feedback session", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-03-20T23:59:00Z", - "startTime": "2013-06-01T21:59:00Z", - "endTime": "2026-04-28T21:59:00Z", - "sessionVisibleFromTime": "2013-03-20T21:59:00Z", - "resultsVisibleFromTime": "2026-04-29T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 5, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "gracePeriodSession": { - "feedbackSessionName": "Grace Period Session", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-03-20T23:59:00Z", - "startTime": "2013-06-01T21:59:00Z", - "endTime": "2026-04-28T21:59:00Z", - "sessionVisibleFromTime": "2013-03-20T21:59:00Z", - "resultsVisibleFromTime": "2026-04-29T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 1440, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "closedSession": { - "feedbackSessionName": "Closed Session", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-03-20T23:59:00Z", - "startTime": "2013-06-01T21:58:00Z", - "endTime": "2013-06-01T21:59:00Z", - "sessionVisibleFromTime": "2013-03-20T21:59:00Z", - "resultsVisibleFromTime": "2026-04-29T21:59:00Z", - "timeZone": "Africa/Johannesburg", - "gracePeriod": 5, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "empty.session": { - "feedbackSessionName": "Empty session", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor2@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:57:00Z", - "startTime": "2013-02-01T23:57:00Z", - "endTime": "2013-04-28T23:57:00Z", - "sessionVisibleFromTime": "2013-01-20T23:57:00Z", - "resultsVisibleFromTime": "2013-04-29T23:57:00Z", - "timeZone": "UTC", - "gracePeriod": 5, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "awaiting.session": { - "feedbackSessionName": "non visible session", - "courseId": "idOfTypicalCourse1", - "creatorEmail": "instructor2@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:00:00Z", - "startTime": "2026-02-01T23:00:00Z", - "endTime": "2026-04-28T23:00:00Z", - "sessionVisibleFromTime": "2026-02-01T23:00:00Z", - "resultsVisibleFromTime": "2026-04-29T23:00:00Z", - "timeZone": "UTC", - "gracePeriod": 5, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "archiveCourse.session1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "creatorEmail": "instructor1@course1.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2013-01-20T23:00:00Z", - "startTime": "2013-02-20T23:00:00Z", - "endTime": "2026-04-28T23:00:00Z", - "sessionVisibleFromTime": "2013-02-20T23:00:00Z", - "resultsVisibleFromTime": "2026-04-29T23:00:00Z", - "timeZone": "UTC", - "gracePeriod": 5, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "session1InCourse2": { - "feedbackSessionName": "Instructor feedback session", - "courseId": "idOfTypicalCourse2", - "creatorEmail": "instructor1@course2.tmt", - "instructions": "Please please fill in the following questions.", - "createdTime": "2012-03-20T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2027-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-03-28T15:59:00Z", - "resultsVisibleFromTime": "2027-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 0, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 1 other student's product" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "My comments on the class" - }, - "questionNumber": 3, - "giverType": "SELF", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "qn4InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Instructor comments on the class" - }, - "questionNumber": 4, - "giverType": "INSTRUCTORS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "qn5InSession1InCourse1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Students' comment on instructors" - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ] - }, - "team.feedback": { - "feedbackSessionName": "Second feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 2 other teams." - }, - "questionNumber": 1, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 2, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "team.members.feedback": { - "feedbackSessionName": "Second feedback session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 1 of your team mates" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "graceperiod.session.feedback": { - "feedbackSessionName": "Grace Period Session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 2 other teams." - }, - "questionNumber": 1, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 2, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "graceperiod.session.feedback2": { - "feedbackSessionName": "Grace Period Session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to yourself." - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "closed.session.feedback": { - "feedbackSessionName": "Closed Session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to yourself." - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession4InCourse1": { - "feedbackSessionName": "non visible session", - "courseId": "idOfTypicalCourse1", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 4 other students" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSessionInArchivedCourse": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to students" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 4, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession1InCourse2": { - "feedbackSessionName": "Instructor feedback session", - "courseId": "idOfTypicalCourse2", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Please rate the following teams" - }, - "questionNumber": 1, - "giverType": "INSTRUCTORS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [] - }, - "qn2InSession1InCourse2": { - "feedbackSessionName": "Instructor feedback session", - "courseId": "idOfTypicalCourse2", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Please rate your fellow instructors" - }, - "questionNumber": 2, - "giverType": "INSTRUCTORS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [], - "showGiverNameTo": [], - "showRecipientNameTo": [] - } - }, - "feedbackResponses": { - "response1ForQ1S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "student1InCourse1@gmail.tmt", - "recipient": "student1InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Student 1 self feedback." - } - }, - "response1ForQ5S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "5", - "giver": "student1InCourse1@gmail.tmt", - "recipient": "helper1@course1.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "All of you rocks!" - } - }, - "response2ForQ5S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "5", - "giver": "student1InCourse1@gmail.tmt", - "recipient": "helper2@course1.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "All of you rocks!" - } - }, - "response2ForQ1S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "student2InCourse1@gmail.tmt", - "recipient": "student2InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "I'm cool'" - } - }, - "response1ForQ2S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "student2InCourse1@gmail.tmt", - "recipient": "student1InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 2 to student 1." - } - }, - "response2ForQ2S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "student1InCourse1@gmail.tmt", - "recipient": "student2InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 1 to student 2." - } - }, - "response3ForQ2S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "student3InCourse1@gmail.tmt", - "recipient": "student2InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 3 \"to\" student 2.\r\nMultiline test." - } - }, - "response1ForQ3S1C1": { - "feedbackSessionName": "First feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "3", - "giver": "instructor1@course1.tmt", - "recipient": "%GENERAL%", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "Good work, keep it up!" - } - }, - "response1ForQ1S2C1": { - "feedbackSessionName": "Second feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "student4InCourse1@gmail.tmt", - "recipient": "Team 1.2", - "giverSection": "Section 1", - "recipientSection": "Section 2", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from team 1 by (student 4) to team 1.2." - } - }, - "response1GracePeriodFeedback": { - "feedbackSessionName": "Grace Period Session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "student4InCourse1@gmail.tmt", - "recipient": "Team 1.2", - "giverSection": "Section 1", - "recipientSection": "Section 2", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from team 1 by (student 4) to team 1.2." - } - }, - "response1Q2GracePeriodFeedback": { - "feedbackSessionName": "Grace Period Session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "instructor1@course1.tmt", - "recipient": "instructor1@course1.tmt", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from instructor to self." - } - }, - "response1Q1ClosedPeriodFeedback": { - "feedbackSessionName": "Closed Session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "1", - "giver": "instructor1@course1.tmt", - "recipient": "instructor1@course1.tmt", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from Inst1 to self." - } - }, - "response1ForQ2S2C1": { - "feedbackSessionName": "Second feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "student4InCourse1@gmail.tmt", - "recipient": "student2InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 4 to team member (student 2)." - } - }, - "response2ForQ2S2C1": { - "feedbackSessionName": "Second feedback session", - "courseId": "idOfTypicalCourse1", - "feedbackQuestionId": "2", - "giver": "student1InCourse1@gmail.tmt", - "recipient": "student4InCourse1@gmail.tmt", - "giverSection": "Section 1", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from student 1 to team member (student 4)." - } - }, - "response1ForQ1S1C2": { - "feedbackSessionName": "Instructor feedback session", - "courseId": "idOfTypicalCourse2", - "feedbackQuestionId": "1", - "giver": "instructor1@course2.tmt", - "recipient": "Team 2.1", - "giverSection": "None", - "recipientSection": "None", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from instr to Team 2.1" - } - }, - "response1ForNVSQ1": { - "feedbackSessionName": "session without student questions", - "courseId": "idOfArchivedCourse", - "feedbackQuestionId": "1", - "giver": "instructorOfArchiveCourse@archiveCourse.tmt", - "recipient": "student1InArchivedCourse@gmail.tmt", - "giverSection": "None", - "recipientSection": "Section 1", - "responseDetails": { - "questionType": "TEXT", - "answer": "Response from instructor to student" - } - } - }, - "feedbackResponseComments": { - "comment1FromT1C1ToR1Q1S1C1": { - "courseId": "idOfTypicalCourse1", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "1", - "commentGiver": "instructor1@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "1%student1InCourse1@gmail.tmt%student1InCourse1@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-03-01T23:59:00Z", - "commentText": "Instructor 1 comment to student 1 self feedback" - }, - "comment1FromT1C1ToR1Q2S1C1": { - "courseId": "idOfTypicalCourse1", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "2", - "commentGiver": "instructor1@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "2%student2InCourse1@gmail.tmt%student1InCourse1@gmail.tmt", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-02-01T23:59:00Z", - "commentText": "Instructor 1 comment to student 1 self feedback Question 2" - }, - "comment1FromT1C1ToR1Q3S1C1": { - "courseId": "idOfTypicalCourse1", - "feedbackSessionName": "First feedback session", - "feedbackQuestionId": "3", - "commentGiver": "instructor1@course1.tmt", - "giverSection": "None", - "receiverSection": "None", - "feedbackResponseId": "3%instructor1@course1.tmt%%GENERAL%", - "showCommentTo": [], - "showGiverNameTo": [], - "commentGiverType": "INSTRUCTORS", - "isVisibilityFollowingFeedbackQuestion": false, - "isCommentFromFeedbackParticipant": false, - "createdAt": "2026-01-01T23:59:00Z", - "commentText": "Instructor 1 comment to his own response for feedback Question 3" - } - }, - "profiles": { - "student1InCourse1": { - "googleId": "student1InCourse1", - "shortName": "Stud1", - "email": "i.m.stud1@gmail.tmt", - "institute": "TEAMMATES Test Institute 3", - "nationality": "American", - "gender": "MALE", - "moreInfo": "I am just a student :P", - "pictureKey": "asdf34&hfn3!@" - } - } -} diff --git a/src/test/resources/data/StudentFeedbackSubmitPageUiTest.json b/src/test/resources/data/StudentFeedbackSubmitPageUiTest.json deleted file mode 100644 index 37410512d9b..00000000000 --- a/src/test/resources/data/StudentFeedbackSubmitPageUiTest.json +++ /dev/null @@ -1,1267 +0,0 @@ -{ - "accounts": { - "SFSubmitUiT.instr": { - "googleId": "SFSubmitUiT.instr", - "name": "Teammates Test", - "isInstructor": true, - "email": "SFSubmitUiT.instr@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFSubmitUiT.instr2": { - "googleId": "SFSubmitUiT.instr2", - "name": "Teammates Test2", - "isInstructor": true, - "email": "SFSubmitUiT.instr2@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFSubmitUiT.instr3": { - "googleId": "SFSubmitUiT.instr3", - "name": "Teammates Test3", - "isInstructor": true, - "email": "SFSubmitUiT.instr3@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFResultsUiT.alice.b": { - "googleId": "SFSubmitUiT.alice.b", - "name": "Alice B.", - "isInstructor": false, - "email": "SFSubmitUiT.alice.b@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFSubmitUiT.charlie.d": { - "googleId": "SFSubmitUiT.charlie.d", - "name": "Charlie D.", - "isInstructor": false, - "email": "SFSubmitUiT.charlie.d@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFSubmitUiT.danny.e": { - "googleId": "SFSubmitUiT.danny.e", - "name": "Danny E.", - "isInstructor": false, - "email": "SFSubmitUiT.danny.e@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - }, - "SFSubmitUiT.emily.f": { - "googleId": "SFSubmitUiT.emily.f", - "name": "Emily F.", - "isInstructor": false, - "email": "SFSubmitUiT.emily.f@gmail.tmt", - "institute": "TEAMMATES Test Institute 1" - } - }, - "courses": { - "SFSubmitUiT.CS2104": { - "id": "SFSubmitUiT.CS2104", - "name": "Programming Language Concepts", - "timeZone": "UTC" - } - }, - "instructors": { - "SFSubmitUiT.instr": { - "googleId": "SFSubmitUiT.instr", - "courseId": "SFSubmitUiT.CS2104", - "name": "Teammates Test", - "email": "SFSubmitUiT.instr@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "SFSubmitUiT.instr2": { - "googleId": "SFSubmitUiT.instr2", - "courseId": "SFSubmitUiT.CS2104", - "name": "Teammates Test2", - "email": "SFSubmitUiT.instr2@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": true, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - }, - "SFSubmitUiT.instr3": { - "googleId": "SFSubmitUiT.instr3", - "courseId": "SFSubmitUiT.CS2104", - "name": "Teammates Test3", - "email": "SFSubmitUiT.instr3@gmail.tmt", - "role": "Co-owner", - "isDisplayedToStudents": false, - "displayedName": "Instructor", - "privileges": { - "courseLevel": { - "canviewstudentinsection": true, - "cansubmitsessioninsection": true, - "canmodifysessioncommentinsection": true, - "canmodifycourse": true, - "canviewsessioninsection": true, - "canmodifysession": true, - "canmodifystudent": true, - "canmodifyinstructor": true - }, - "sectionLevel": {}, - "sessionLevel": {} - } - } - }, - "students": { - "Alice": { - "googleId": "SFSubmitUiT.alice.b", - "email": "SFSubmitUiT.alice.b@gmail.tmt", - "course": "SFSubmitUiT.CS2104", - "name": "Alice Betsy'\"", - "comments": "This student's name is Alice Betsy'\"", - "team": "Team >'\"< 1'\"", - "section": "None" - }, - "Benny": { - "googleId": "SFSubmitUiT.benny.c", - "email": "SFSubmitUiT.benny.c@gmail.tmt", - "course": "SFSubmitUiT.CS2104", - "name": "Benny Charles", - "comments": "This student's name is Benny Charles", - "team": "Team >'\"< 1'\"", - "section": "None" - }, - "ExtraGuy": { - "googleId": "extra.guy", - "email": "extra.guy@gmail.tmt", - "course": "SFSubmitUiT.CS2104", - "name": "Extra guy", - "comments": "This student will move to a new team after evaluation created", - "team": "Team 2", - "section": "None" - }, - "DropOut": { - "googleId": "", - "email": "drop.out@gmail.tmt", - "course": "SFSubmitUiT.CS2104", - "name": "Drop out", - "comments": "This student will drop out after evaluation created", - "team": "Team 2", - "section": "None" - }, - "Charlie": { - "googleId": "SFSubmitUiT.charlie.d", - "email": "SFSubmitUiT.charlie.d@gmail.tmt", - "course": "SFSubmitUiT.CS2104", - "name": "Charlie Davis", - "comments": "This student's name is Charlie Davis", - "team": "Team 2", - "section": "None" - }, - "Danny": { - "googleId": "SFSubmitUiT.danny.e", - "email": "SFSubmitUiT.danny.e@gmail.tmt", - "course": "SFSubmitUiT.CS2104", - "name": "Danny Engrid", - "comments": "This student's name is Danny Engrid", - "team": "Team 2", - "section": "None" - }, - "Emily": { - "googleId": "SFSubmitUiT.emily.f", - "email": "SFSubmitUiT.emily.f@gmail.tmt", - "course": "SFSubmitUiT.CS2104", - "name": "Emily", - "comments": "This student's name is Emily", - "team": "Team 3", - "section": "None" - } - }, - "feedbackSessions": { - "Open Session": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "creatorEmail": "SFSubmitUiT.instr@gmail.tmt", - "instructions": "Instructions for first session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Grace Period Session": { - "feedbackSessionName": "Grace Period Session", - "courseId": "SFSubmitUiT.CS2104", - "creatorEmail": "SFSubmitUiT.instr@gmail.tmt", - "instructions": "This going to be a grace period session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-01T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 10, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Closed Session": { - "feedbackSessionName": "Second Session", - "courseId": "SFSubmitUiT.CS2104", - "creatorEmail": "SFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2012-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Empty Session": { - "feedbackSessionName": "Third Session", - "courseId": "SFSubmitUiT.CS2104", - "creatorEmail": "SFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the last feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2012-04-02T15:59:00Z", - "endTime": "2026-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2012-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": true, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": true, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Awaiting Session": { - "feedbackSessionName": "Fourth Session", - "courseId": "SFSubmitUiT.CS2104", - "creatorEmail": "SFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the second feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2035-04-02T15:59:00Z", - "endTime": "2035-04-30T15:59:00Z", - "sessionVisibleFromTime": "2012-04-01T15:59:00Z", - "resultsVisibleFromTime": "2026-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - }, - "Not Yet Visible Session": { - "feedbackSessionName": "Fifth Session", - "courseId": "SFSubmitUiT.CS2104", - "creatorEmail": "SFSubmitUiT.instr@gmail.tmt", - "instructions": "Please please fill in the fifth feedback session", - "createdTime": "2012-04-01T23:59:00Z", - "startTime": "2035-04-02T15:59:00Z", - "endTime": "2035-04-30T15:59:00Z", - "sessionVisibleFromTime": "2035-04-01T15:59:00Z", - "resultsVisibleFromTime": "2035-05-01T15:59:00Z", - "timeZone": "Asia/Singapore", - "gracePeriod": 20, - "sentOpenEmail": false, - "sentClosingEmail": false, - "sentClosedEmail": false, - "sentPublishedEmail": false, - "isOpeningEmailEnabled": true, - "isClosingEmailEnabled": true, - "isPublishedEmailEnabled": true - } - }, - "feedbackQuestions": { - "qn1InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "What is the best selling point of your product?" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Rate 3 other students' products" - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "INSTRUCTORS", - "RECEIVER", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "RECEIVER" - ] - }, - "qn3InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Comments about the class" - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "OWN_TEAM_MEMBERS" - ], - "showGiverNameTo": [], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn4InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to 3 other teams." - }, - "questionNumber": 4, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn5InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your team mates" - }, - "questionNumber": 5, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn6InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "This question should be hidden." - }, - "questionNumber": 6, - "giverType": "INSTRUCTORS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn7InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "UI", - "Algo" - ], - "questionText": "What is the best selling point of your product?", - "questionType": "MCQ", - "otherEnabled": true - }, - "questionNumber": 7, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn8InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "UI", - "Algo" - ], - "questionText": "What do you think is the other teams' best feature?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 8, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn9InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "UI", - "Algo", - "Design" - ], - "questionText": "What is the best selling point of your product?", - "questionType": "MSQ", - "otherEnabled": true - }, - "questionNumber": 9, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn10InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "UI", - "Algo", - "Design" - ], - "questionText": "What do you think is the other teams' best feature?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 10, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn11InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Who is the best class mate?", - "questionType": "MCQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 11, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn12InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who do you recommend as tutor?", - "questionType": "MSQ", - "generateOptionsFor": "STUDENTS", - "otherEnabled": false - }, - "questionNumber": 12, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn13InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Which is the best team?", - "questionType": "MCQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 13, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn14InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who do you recommend as tutor?", - "questionType": "MSQ", - "generateOptionsFor": "TEAMS", - "otherEnabled": false - }, - "questionNumber": 14, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn15InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate your product", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 15, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn16InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate others' product", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 16, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn17InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Who is the best instructor?", - "questionType": "MCQ", - "generateOptionsFor": "INSTRUCTORS", - "otherEnabled": false - }, - "questionNumber": 17, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn18InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who do you recommend as tutors?", - "questionType": "MSQ", - "generateOptionsFor": "INSTRUCTORS", - "otherEnabled": false - }, - "questionNumber": 18, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn19InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": false, - "pointsPerOption": false, - "questionText": "How important are the following factors to you? Give points accordingly.", - "numOfConstSumOptions": 2, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [ - "Grades", - "Fun" - ] - }, - "questionNumber": 19, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn20InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "distributeToRecipients": true, - "pointsPerOption": true, - "questionText": "Split points among the teams", - "numOfConstSumOptions": 0, - "questionType": "CONSTSUM", - "points": 100, - "constSumOptions": [] - }, - "questionNumber": 20, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn21InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionText": "Rate the contribution of your team members and yourself.", - "questionType": "CONTRIB", - "isNotSureAllowed": true - }, - "questionNumber": 21, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn22InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "rubricSubQuestions": [ - "This student has done a good job.", - "This student has tried his/her best." - ], - "questionText": "Please choose the best choice for the following sub-questions.", - "numOfRubricChoices": 2, - "numOfRubricSubQuestions": 2, - "questionType": "RUBRIC", - "rubricChoices": [ - "Yes", - "No" - ], - "rubricDescriptions": [ - [ - "Most of the time", - "Less than half the time" - ], - [ - "Most of the time", - "Less than half the time" - ] - ] - }, - "questionNumber": 22, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ] - }, - "qn23InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Nominate and rank at least 2 students for prizes.", - "questionType": "MSQ", - "generateOptionsFor": "STUDENTS", - "minSelectableChoices": 2, - "maxSelectableChoices": 3, - "otherEnabled": false - }, - "questionNumber": 23, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ] - }, - "qn24InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "A", - "B", - "C", - "D", - "E" - ], - "questionText": "Rank exactly 3 options.", - "questionType": "MSQ", - "minSelectableChoices": 3, - "maxSelectableChoices": 3, - "otherEnabled": false - }, - "questionNumber": 24, - "giverType": "STUDENTS", - "recipientType": "STUDENTS", - "numberOfEntitiesToGiveFeedbackTo": 7, - "showResponsesTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showGiverNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS", - "STUDENTS" - ] - }, - "qn25InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Which is the best team?", - "questionType": "MCQ", - "generateOptionsFor": "STUDENTS_EXCLUDING_SELF", - "otherEnabled": false - }, - "questionNumber": 25, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn26InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who do you like working with?", - "questionType": "MSQ", - "generateOptionsFor": "STUDENTS_EXCLUDING_SELF", - "otherEnabled": false - }, - "questionNumber": 26, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn27InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 0, - "mcqChoices": [], - "questionText": "Which is the best team?", - "questionType": "MCQ", - "generateOptionsFor": "TEAMS_EXCLUDING_SELF", - "otherEnabled": false - }, - "questionNumber": 27, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn28InSession1": { - "feedbackSessionName": "First Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [], - "questionText": "Who do you like working with?", - "questionType": "MSQ", - "generateOptionsFor": "TEAMS_EXCLUDING_SELF", - "otherEnabled": false - }, - "questionNumber": 28, - "giverType": "STUDENTS", - "recipientType": "NONE", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn1InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn2InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "numOfMcqChoices": 2, - "mcqChoices": [ - "It's good", - "It's perfect" - ], - "questionText": "What do you like best about our product?", - "questionType": "MCQ", - "otherEnabled": false - }, - "questionNumber": 2, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn3InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "msqChoices": [ - "It's good", - "It's perfect" - ], - "questionText": "What do you like best about our product?", - "questionType": "MSQ", - "otherEnabled": false - }, - "questionNumber": 3, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn4InSession2": { - "feedbackSessionName": "Second Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate our product.", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 4, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InSession4": { - "feedbackSessionName": "Fourth Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionType": "TEXT", - "questionText": "Give feedback to your instructors" - }, - "questionNumber": 1, - "giverType": "STUDENTS", - "recipientType": "INSTRUCTORS", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn1InGracePeriodSession": { - "feedbackSessionName": "Grace Period Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate your product", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 15, - "giverType": "STUDENTS", - "recipientType": "SELF", - "numberOfEntitiesToGiveFeedbackTo": 1, - "showResponsesTo": [ - "RECEIVER", - "OWN_TEAM_MEMBERS", - "STUDENTS", - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - }, - "qn2InGracePeriodSession": { - "feedbackSessionName": "Grace Period Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "minScale": 1, - "questionText": "Rate others' product", - "questionType": "NUMSCALE", - "maxScale": 5, - "step": 0.5 - }, - "questionNumber": 16, - "giverType": "TEAMS", - "recipientType": "TEAMS", - "numberOfEntitiesToGiveFeedbackTo": 3, - "showResponsesTo": [ - "RECEIVER" - ], - "showGiverNameTo": [ - "RECEIVER" - ], - "showRecipientNameTo": [ - "RECEIVER" - ] - }, - "qn3InGracePeriodSession": { - "feedbackSessionName": "Grace Period Session", - "courseId": "SFSubmitUiT.CS2104", - "questionDetails": { - "questionText": "You cannot answer 'Not Sure' here.", - "questionType": "CONTRIB", - "isNotSureAllowed": false - }, - "questionNumber": 17, - "giverType": "STUDENTS", - "recipientType": "OWN_TEAM_MEMBERS_INCLUDING_SELF", - "numberOfEntitiesToGiveFeedbackTo": -100, - "showResponsesTo": [ - "INSTRUCTORS" - ], - "showGiverNameTo": [ - "INSTRUCTORS" - ], - "showRecipientNameTo": [ - "INSTRUCTORS" - ] - } - }, - "feedbackResponses": {}, - "feedbackResponseComments": {}, - "profiles": {} -} diff --git a/src/test/resources/data/typicalDataBundle.json b/src/test/resources/data/typicalDataBundle.json index 23e8929293a..60551c48a10 100644 --- a/src/test/resources/data/typicalDataBundle.json +++ b/src/test/resources/data/typicalDataBundle.json @@ -1046,6 +1046,7 @@ "feedbackSessionName": "First feedback session", "courseId": "idOfTypicalCourse1", "questionDetails": { + "recommendedLength": 0, "questionType": "TEXT", "questionText": "Rate 1 other student's product" }, @@ -1189,6 +1190,27 @@ "RECEIVER" ] }, + "team.instructor.feedback": { + "feedbackSessionName": "Second feedback session", + "courseId": "idOfTypicalCourse1", + "questionDetails": { + "questionType": "TEXT", + "questionText": "Give feedback to student teams." + }, + "questionNumber": 3, + "giverType": "INSTRUCTORS", + "recipientType": "TEAMS", + "numberOfEntitiesToGiveFeedbackTo": 2, + "showResponsesTo": [ + "RECEIVER" + ], + "showGiverNameTo": [ + "RECEIVER" + ], + "showRecipientNameTo": [ + "RECEIVER" + ] + }, "graceperiod.session.feedback": { "feedbackSessionName": "Grace Period Session", "courseId": "idOfTypicalCourse1", diff --git a/src/test/resources/emails/instructorCourseRejoinAfterGoogleIdResetEmailWithInstitute.html b/src/test/resources/emails/instructorCourseRejoinAfterGoogleIdResetEmailWithInstitute.html index d3d84c22d76..9e27fac32f5 100644 --- a/src/test/resources/emails/instructorCourseRejoinAfterGoogleIdResetEmailWithInstitute.html +++ b/src/test/resources/emails/instructorCourseRejoinAfterGoogleIdResetEmailWithInstitute.html @@ -6,7 +6,7 @@

    To rejoin the course, please go to this Web address: - ${app.url}/web/join?key=${regkey.enc}&entitytype=instructor&instructorinstitution=Test+Institute + ${app.url}/web/join?key=${regkey.enc}&entitytype=instructor&instructorinstitution=Test%20Institute

    • If prompted to log in, use your Google account to log in. diff --git a/src/test/resources/emails/instructorNewAccountEmail.html b/src/test/resources/emails/instructorNewAccountEmail.html index a7e8b2ce76f..b5c8ac208d7 100644 --- a/src/test/resources/emails/instructorNewAccountEmail.html +++ b/src/test/resources/emails/instructorNewAccountEmail.html @@ -6,7 +6,7 @@

      You can click the link below to 'join' TEAMMATES.

      -${app.url}/web/join?key=${regkey.enc}&instructorinstitution=Test+Institute&entitytype=instructor +${app.url}/web/join?key=${regkey.enc}&instructorinstitution=Test%20Institute&entitytype=instructor

        diff --git a/src/test/resources/emails/instructorNewAccountEmailTestingSanitization.html b/src/test/resources/emails/instructorNewAccountEmailTestingSanitization.html index 8299b4a9d34..d2d8281ebed 100644 --- a/src/test/resources/emails/instructorNewAccountEmailTestingSanitization.html +++ b/src/test/resources/emails/instructorNewAccountEmailTestingSanitization.html @@ -6,7 +6,7 @@

        You can click the link below to 'join' TEAMMATES.

        -${app.url}/web/join?key=${regkey.enc}&instructorinstitution=Test+Institute&entitytype=instructor +${app.url}/web/join?key=${regkey.enc}&instructorinstitution=Test%20Institute&entitytype=instructor

          diff --git a/src/test/resources/emails/sessionClosedEmailForStudent.html b/src/test/resources/emails/sessionClosedEmailForStudent.html index 943b87c921d..3af035e167b 100644 --- a/src/test/resources/emails/sessionClosedEmailForStudent.html +++ b/src/test/resources/emails/sessionClosedEmailForStudent.html @@ -54,7 +54,7 @@
          • To view your feedback for the above session, please go to this Web address: - ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt + ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt
          • The above link is unique to you. Please do not share it with others. diff --git a/src/test/resources/emails/sessionClosedEmailTestingSanitizationForStudent.html b/src/test/resources/emails/sessionClosedEmailTestingSanitizationForStudent.html index e72c1915649..9138d58ebac 100644 --- a/src/test/resources/emails/sessionClosedEmailTestingSanitizationForStudent.html +++ b/src/test/resources/emails/sessionClosedEmailTestingSanitizationForStudent.html @@ -54,7 +54,7 @@
            • To view your feedback for the above session, please go to this Web address: - ${app.url}/web/sessions/submission?courseid=idOfTestingSanitizationCourse&fsname=Normal+feedback+session+name&key=${regkey.enc}&studentemail=normal%40sanitization.tmt + ${app.url}/web/sessions/submission?courseid=idOfTestingSanitizationCourse&fsname=Normal%20feedback%20session%20name&key=${regkey.enc}&studentemail=normal%40sanitization.tmt
            • The above link is unique to you. Please do not share it with others. diff --git a/src/test/resources/emails/sessionClosingEmailForStudent.html b/src/test/resources/emails/sessionClosingEmailForStudent.html index b5a9a0d0c35..0830cfab8f4 100644 --- a/src/test/resources/emails/sessionClosingEmailForStudent.html +++ b/src/test/resources/emails/sessionClosingEmailForStudent.html @@ -54,7 +54,7 @@
              • To submit, edit or view your feedback for the above session, please go to this Web address: - ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student5InCourse1%40gmail.tmt + ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student5InCourse1%40gmail.tmt
              • The above link is unique to you. Please do not share it with others. diff --git a/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedAndpublishedSessions.html b/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedAndpublishedSessions.html index 0bfe5cde093..5abe3ea0bac 100644 --- a/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedAndpublishedSessions.html +++ b/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedAndpublishedSessions.html @@ -17,17 +17,17 @@ First feedback session - [submission link][result link] + [submission link][result link] Second feedback session - [submission link][result link] + [submission link][result link]

                - If a session that you expected to see is missing, it may be because it is associated with a different email address. In that case, you can try again with a different email address or contact your course instructor(s) to check whether this email address is the one used to enroll you in TEAMMATES. + If a session that you expected to see is missing, it may be because it is associated with a different email address. In that case, you can try again with a different email address or contact your course instructor(s) to check whether this email address is the one used to enroll you in TEAMMATES. Also, sessions that have not been opened or closed in the past 180 days are not shown. If you want the links to those sessions, please contact the TEAMMATES support team mentioned below.


                diff --git a/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedButUnpublishedSessions.html b/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedButUnpublishedSessions.html index c02aa1b1920..2e625d24cbd 100644 --- a/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedButUnpublishedSessions.html +++ b/src/test/resources/emails/sessionLinksRecoveryOpenedOrClosedButUnpublishedSessions.html @@ -17,10 +17,10 @@ First feedback session - [submission link] + [submission link] Second feedback session - [submission link] + [submission link] diff --git a/src/test/resources/emails/sessionOpeningEmailForStudent.html b/src/test/resources/emails/sessionOpeningEmailForStudent.html index c7e1ffca4af..3e22d27323d 100644 --- a/src/test/resources/emails/sessionOpeningEmailForStudent.html +++ b/src/test/resources/emails/sessionOpeningEmailForStudent.html @@ -54,7 +54,7 @@
                • To submit, edit or view your feedback for the above session, please go to this Web address: - ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt + ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt
                • The above link is unique to you. Please do not share it with others. diff --git a/src/test/resources/emails/sessionOpeningEmailTestingSanitzationForStudent.html b/src/test/resources/emails/sessionOpeningEmailTestingSanitzationForStudent.html index 336261d4e2b..c879e1750ff 100644 --- a/src/test/resources/emails/sessionOpeningEmailTestingSanitzationForStudent.html +++ b/src/test/resources/emails/sessionOpeningEmailTestingSanitzationForStudent.html @@ -54,7 +54,7 @@
                  • To submit, edit or view your feedback for the above session, please go to this Web address: - ${app.url}/web/sessions/submission?courseid=idOfTestingSanitizationCourse&fsname=Normal+feedback+session+name&key=${regkey.enc}&studentemail=normal%40sanitization.tmt + ${app.url}/web/sessions/submission?courseid=idOfTestingSanitizationCourse&fsname=Normal%20feedback%20session%20name&key=${regkey.enc}&studentemail=normal%40sanitization.tmt
                  • The above link is unique to you. Please do not share it with others. diff --git a/src/test/resources/emails/sessionPublishedEmailForStudent.html b/src/test/resources/emails/sessionPublishedEmailForStudent.html index cf6878efd2d..dfe735e2012 100644 --- a/src/test/resources/emails/sessionPublishedEmailForStudent.html +++ b/src/test/resources/emails/sessionPublishedEmailForStudent.html @@ -32,7 +32,7 @@ diff --git a/src/test/resources/emails/sessionReminderEmailForInstructor.html b/src/test/resources/emails/sessionReminderEmailForInstructor.html index ec6b32d7ac1..605b7f09512 100644 --- a/src/test/resources/emails/sessionReminderEmailForInstructor.html +++ b/src/test/resources/emails/sessionReminderEmailForInstructor.html @@ -54,7 +54,7 @@
                    • To submit, edit or view your feedback for the above session, please go to this Web address: - ${app.url}/web/instructor/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session + ${app.url}/web/instructor/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session
                    • The above link is unique to you. Please do not share it with others. diff --git a/src/test/resources/emails/sessionReminderEmailForStudent.html b/src/test/resources/emails/sessionReminderEmailForStudent.html index 4e6f67dada1..819e313595b 100644 --- a/src/test/resources/emails/sessionReminderEmailForStudent.html +++ b/src/test/resources/emails/sessionReminderEmailForStudent.html @@ -54,7 +54,7 @@
                      • To submit, edit or view your feedback for the above session, please go to this Web address: - ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt + ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt
                      • The above link is unique to you. Please do not share it with others. diff --git a/src/test/resources/emails/sessionSubmissionConfirmationEmailNegativeTimeZone.html b/src/test/resources/emails/sessionSubmissionConfirmationEmailNegativeTimeZone.html index 17a00a58c54..10ead69cef8 100644 --- a/src/test/resources/emails/sessionSubmissionConfirmationEmailNegativeTimeZone.html +++ b/src/test/resources/emails/sessionSubmissionConfirmationEmailNegativeTimeZone.html @@ -41,7 +41,7 @@ diff --git a/src/test/resources/emails/sessionSubmissionConfirmationEmailPositiveTimeZone.html b/src/test/resources/emails/sessionSubmissionConfirmationEmailPositiveTimeZone.html index 7adfc7888ec..685ecaab899 100644 --- a/src/test/resources/emails/sessionSubmissionConfirmationEmailPositiveTimeZone.html +++ b/src/test/resources/emails/sessionSubmissionConfirmationEmailPositiveTimeZone.html @@ -41,7 +41,7 @@ diff --git a/src/test/resources/emails/sessionSubmissionConfirmationEmailTestingSanitization.html b/src/test/resources/emails/sessionSubmissionConfirmationEmailTestingSanitization.html index 8494714491a..741a7622a21 100644 --- a/src/test/resources/emails/sessionSubmissionConfirmationEmailTestingSanitization.html +++ b/src/test/resources/emails/sessionSubmissionConfirmationEmailTestingSanitization.html @@ -41,7 +41,7 @@ diff --git a/src/test/resources/emails/sessionSubmissionConfirmationEmailZeroTimeZone.html b/src/test/resources/emails/sessionSubmissionConfirmationEmailZeroTimeZone.html index e5ca9758805..8fe364ebe17 100644 --- a/src/test/resources/emails/sessionSubmissionConfirmationEmailZeroTimeZone.html +++ b/src/test/resources/emails/sessionSubmissionConfirmationEmailZeroTimeZone.html @@ -41,7 +41,7 @@ diff --git a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedStudent.html b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedStudent.html index 3d22597147a..c32e98da780 100644 --- a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedStudent.html +++ b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedStudent.html @@ -13,16 +13,16 @@
                           Feedback Session Name: Closed Session
                           Deadline: Sat, 01 Jun 2013, 11:59 PM SAST (Passed)
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        -To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt



                           Feedback Session Name: First feedback session
                           Deadline: Fri, 30 Apr 2027, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -31,7 +31,7 @@
                           Feedback Session Name: Grace Period Session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace+Period+Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace%20Period%20Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -40,7 +40,7 @@
                           Feedback Session Name: Second feedback session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second+feedback+session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second%20feedback%20session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) diff --git a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedUnregisteredStudent.html b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedUnregisteredStudent.html index 1ecfdf86861..5b60c2b9a18 100644 --- a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedUnregisteredStudent.html +++ b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForRegeneratedUnregisteredStudent.html @@ -38,16 +38,16 @@
                           Feedback Session Name: Closed Session
                           Deadline: Sat, 01 Jun 2013, 11:59 PM SAST (Passed)
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        -To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt



                           Feedback Session Name: First feedback session
                           Deadline: Fri, 30 Apr 2027, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -56,7 +56,7 @@
                           Feedback Session Name: Grace Period Session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace+Period+Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace%20Period%20Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -65,7 +65,7 @@
                           Feedback Session Name: Second feedback session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second+feedback+session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second%20feedback%20session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) diff --git a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForStudent.html b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForStudent.html index 511fc6b8e0f..d0a74441a67 100644 --- a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForStudent.html +++ b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForStudent.html @@ -13,16 +13,16 @@
                           Feedback Session Name: Closed Session
                           Deadline: Sat, 01 Jun 2013, 11:59 PM SAST (Passed)
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        -To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt



                           Feedback Session Name: First feedback session
                           Deadline: Fri, 30 Apr 2027, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -31,7 +31,7 @@
                           Feedback Session Name: Grace Period Session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace+Period+Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace%20Period%20Session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -40,7 +40,7 @@
                           Feedback Session Name: Second feedback session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second+feedback+session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second%20feedback%20session&key=${regkey.enc}&studentemail=student1InCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) diff --git a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForUnregisteredStudent.html b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForUnregisteredStudent.html index 79d72dfda0e..276cf6d4547 100644 --- a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForUnregisteredStudent.html +++ b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailForUnregisteredStudent.html @@ -38,16 +38,16 @@
                           Feedback Session Name: Closed Session
                           Deadline: Sat, 01 Jun 2013, 11:59 PM SAST (Passed)
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        -To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed+Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view the responses for this session, please go to this Web address: ${app.url}/web/sessions/result?courseid=idOfTypicalCourse1&fsname=Closed%20Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt



                           Feedback Session Name: First feedback session
                           Deadline: Fri, 30 Apr 2027, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First+feedback+session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=First%20feedback%20session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -56,7 +56,7 @@
                           Feedback Session Name: Grace Period Session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace+Period+Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Grace%20Period%20Session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) @@ -65,7 +65,7 @@
                           Feedback Session Name: Second feedback session
                           Deadline: Tue, 28 Apr 2026, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second+feedback+session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTypicalCourse1&fsname=Second%20feedback%20session&key=${regkey.enc}&studentemail=student1UnregisteredInCourse1%40gmail.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) diff --git a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailTestingSanitizationForStudent.html b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailTestingSanitizationForStudent.html index a7233a7fe2a..118a448fbf6 100644 --- a/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailTestingSanitizationForStudent.html +++ b/src/test/resources/emails/summaryOfFeedbackSessionsOfCourseEmailTestingSanitizationForStudent.html @@ -13,7 +13,7 @@
                           Feedback Session Name: Normal feedback session name
                           Deadline: Fri, 30 Apr 2027, 11:59 PM SAST
                        -To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTestingSanitizationCourse&fsname=Normal+feedback+session+name&key=${regkey.enc}&studentemail=normal%40sanitization.tmt +To view/submit feedback for the above session, please go to this Web address: ${app.url}/web/sessions/submission?courseid=idOfTestingSanitizationCourse&fsname=Normal%20feedback%20session%20name&key=${regkey.enc}&studentemail=normal%40sanitization.tmt

                        To view the responses for this session, please go to this Web address: (Feedback session is not yet published) diff --git a/src/test/resources/images/image_tall.jpg b/src/test/resources/images/image_tall.jpg deleted file mode 100644 index bf6f70d8f41..00000000000 Binary files a/src/test/resources/images/image_tall.jpg and /dev/null differ diff --git a/src/test/resources/images/profile_pic_updated.png b/src/test/resources/images/profile_pic_updated.png deleted file mode 100644 index b0b59827dbe..00000000000 Binary files a/src/test/resources/images/profile_pic_updated.png and /dev/null differ diff --git a/src/test/resources/pages/adminAccountDetails.html b/src/test/resources/pages/adminAccountDetails.html deleted file mode 100644 index c8b0a9e2b68..00000000000 --- a/src/test/resources/pages/adminAccountDetails.html +++ /dev/null @@ -1,293 +0,0 @@ - - - - Instructor Account Details [Administrator] - - - - - - - - - - -
                        -
                        -
                        -

                        - Instructor Account Details -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - AAMgtUiT.instr2 -

                        -
                        -
                        -
                        - -
                        -

                        - Teammates Instr2 -

                        -
                        -
                        -
                        - -
                        -

                        - AAMgtUiT.instr2@gmail.tmt -

                        -
                        -
                        -
                        - -
                        -

                        - TEAMMATES Test Institute 1 -

                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Course - - Options -
                        - [AAMgtUiT.CS1101] Programming Methodology - - - - - Remove From Course - -
                        - [AAMgtUiT.CS2103] Software Engineering - - - - - Remove From Course - -
                        - [AAMgtUiT.CS2104] Programming Language Concepts - - - - - Remove From Course - -
                        -
                        - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - -
                        - Course - - Options -
                        - [AAMgtUiT.CS1101] Programming Methodology - - - - - Remove From Course - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        - ${admin.institute} -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/adminAccountDetailsRemoveStudent.html b/src/test/resources/pages/adminAccountDetailsRemoveStudent.html deleted file mode 100644 index dbc9c31b55d..00000000000 --- a/src/test/resources/pages/adminAccountDetailsRemoveStudent.html +++ /dev/null @@ -1,128 +0,0 @@ -
                        -
                        -
                        -

                        - Instructor Account Details -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - AAMgtUiT.instr2 -

                        -
                        -
                        -
                        - -
                        -

                        - Teammates Instr2 -

                        -
                        -
                        -
                        - -
                        -

                        - AAMgtUiT.instr2@gmail.tmt -

                        -
                        -
                        -
                        - -
                        -

                        - TEAMMATES Test Institute 1 -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - The student has been removed from the course -
                        -
                        - - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - -
                        - Course - - Options -
                        - [AAMgtUiT.CS1101] Programming Methodology - - - - - Remove From Course - -
                        - [AAMgtUiT.CS2103] Software Engineering - - - - - Remove From Course - -
                        -
                        - -
                        - - - This Account is not a Student -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/deadlineExceededErrorPage.html b/src/test/resources/pages/deadlineExceededErrorPage.html deleted file mode 100644 index 14aa204cb3d..00000000000 --- a/src/test/resources/pages/deadlineExceededErrorPage.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - TEAMMATES - - - - - - - -
                        - -
                        -
                        - -

                        - Server failed to respond within a reasonable time. -
                        - This may be due to an unusually high load at this time. -
                        - Please try again in a few minutes. If the problem persists, -
                        - please inform TEAMMATES - - support team - - . -

                        -
                        -
                        -
                        -
                        -

                        - Uh oh! Something went wrong. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - We are sorry this happened. You can safely ignore this error page in the following cases: -

                        -
                          -
                        • - Retrying the same action a few minutes later succeeds (i.e. no more error page). -
                        • -
                        • - You loaded an outdated page unintentionally. e.g. some browsers auto-load the pages that were loaded in the previous browsing session. -
                        • -
                        -

                        - However, if you keep seeing this page on multiple failed attempts when trying to perform some action in TEAMMATES, please help us troubleshoot the problem by providing us some additional details using the form below. -

                        -
                        -
                        -
                        -
                        - -
                        - - Note: This is the TEAMMATES support email. It has been pre-filled for your convenience and is not editable. - - -
                        -
                        - -
                        - - Note: This field has also been pre-filled for convenience. Feel free to change it to suit your needs. - - -
                        -
                        - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - diff --git a/src/test/resources/pages/enableJs.html b/src/test/resources/pages/enableJs.html deleted file mode 100644 index 3412a75f7be..00000000000 --- a/src/test/resources/pages/enableJs.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - -
                        -

                        - TEAMMATES works best with JavaScript enabled. -
                        - You may enable it in your browser by following steps below. -

                        - -
                        -
                        -

                        - Internet Explorer -

                        - Please complete the following instructions to activate and enable JavaScript in Internet Explorer. -

                        - PC -

                        -
                          -
                        1. - In the Tools drop-down menu, select Internet Options. -
                        2. -
                        3. - Next, select the Security tab. -
                        4. -
                        5. - Then, select the earth (Internet) icon. -
                        6. -
                        7. - Then select the Custom Level button. -
                        8. -
                        9. - Locate Scripting near the bottom of the list. -
                        10. -
                        11. - Under Active Scripting, select Enable, then hit OK. -
                        12. -
                        13. - Answer yes to the following confirmation box. -
                        14. -
                        15. - Hit OK to close the Internet Options window. -
                        16. -
                        17. - Finally, refresh your browser. -
                        18. -
                        -
                        -
                        -

                        - Firefox -

                        - Please complete the following instructions to activate and enable JavaScript in Firefox. -

                        - PC -

                        -
                          -
                        1. - In the Tools drop-down menu, select Options. -
                        2. -
                        3. - Next, select the Content icon/tab at the top on the window. -
                        4. -
                        5. - Then, check the Enable JavaScript checkbox under the Web Content category. -
                        6. -
                        7. - Hit OK to close the Options window and save your changes. -
                        8. -
                        9. - Finally, refresh your browser. -
                        10. -
                        -

                        - MAC -

                        -
                          -
                        1. - Select the Firefox menu item from the Apple/System bar at the top of the screen. -
                        2. -
                        3. - From the drop-down menu, select Preferences... -
                        4. -
                        5. - Select the Content icon/tab at the top on the window. -
                        6. -
                        7. - Then, check the Enable JavaScript checkbox. -
                        8. -
                        9. - Close the Options window to save your changes. -
                        10. -
                        11. - Finally, refresh your browser. -
                        12. -
                        -
                        -
                        -

                        - Safari -

                        - Please complete the following instructions to activate and enable JavaScript in Safari. -

                        - PC -

                        -
                          -
                        1. - In the Edit drop-down menu at the top of the window, select Preferences... -
                        2. -
                        3. - Select the Security icon/tab at the top on the window. -
                        4. -
                        5. - Then, check the Enable JavaScript checkbox. -
                        6. -
                        7. - Close the window to save your changes. -
                        8. -
                        9. - Finally, refresh your browser. -
                        10. -
                        -

                        - MAC -

                        -
                          -
                        1. - Select the Safari menu item from the Apple/System bar at the top of the screen. -
                        2. -
                        3. - From the drop-down menu, select Preferences. -
                        4. -
                        5. - Select the Content icon/tab at the top of the window. -
                        6. -
                        7. - Then, check the Enable JavaScript checkbox. -
                        8. -
                        9. - Close the window to save your changes. -
                        10. -
                        11. - Finally, refresh your browser. -
                        12. -
                        -
                        -
                        -

                        - Opera -

                        - Please complete the following instructions to activate and enable JavaScript in Opera. -

                        - PC -

                        -
                          -
                        1. - In the Tools drop-down menu at the top of the window, select Preferences... -
                        2. -
                        3. - Select the Advanced tab at the top on the Preferences window. -
                        4. -
                        5. - Find the Content item in the list on the left-side of the window and select it. -
                        6. -
                        7. - Then, check the Enable JavaScript checkbox. -
                        8. -
                        9. - Click OK to save your changes and close the Preferences window. -
                        10. -
                        11. - Finally, refresh your browser. -
                        12. -
                        -

                        - MAC -

                        -
                          -
                        1. - Select the Safari menu item from the Apple/System bar at the top of the screen. -
                        2. -
                        3. - From the drop-down menu, select Preferences. -
                        4. -
                        5. - Select the Content icon/tab at the top of the Preferences window. -
                        6. -
                        7. - Then, check the Enable JavaScript checkbox. -
                        8. -
                        9. - Click OK to save your changes and close the Preferences window. -
                        10. -
                        11. - Finally, refresh your browser. -
                        12. -
                        -
                        -
                        -

                        - Chrome -

                        - Please complete the following instructions to activate and enable JavaScript in Chrome. -

                        - PC -

                        -
                          -
                        1. - Select Customize and control Google Chrome (wrench Icon) to the right of the address bar. -
                        2. -
                        3. - From the drop-down menu, select Options Select the Under the Hood tab at the top of the window. -
                        4. -
                        5. - Under the Privacy heading, select the Content settings button. -
                        6. -
                        7. - On the left, under the features heading, select JavaScript. -
                        8. -
                        9. - Select the Allow all sites to run JavaScript radio button. -
                        10. -
                        11. - Finally, close both preference windows, and refresh the browser. -
                        12. -
                        -

                        - MAC -

                        -
                          -
                        1. - Select the Chrome menu item from the Apple/System bar at the top of the screen. -
                        2. -
                        3. - From the drop-down menu, select Preferences... -
                        4. -
                        5. - Select the Under the Hood tab at the top of the window. -
                        6. -
                        7. - Under the Privacy heading, select the Content settings button. -
                        8. -
                        9. - On the left, under the features heading, select JavaScript. -
                        10. -
                        11. - Select the Allow all sites to run JavaScript radio button. -
                        12. -
                        13. - Finally, close both preference windows, and refresh the browser. -
                        14. -
                        -
                        -
                        -

                        - As taken from: -

                        -
                          -
                        1. - - http://activatejavascript.org/en/instructions/ - -
                        2. -
                        3. - - https://support.mozilla.org/en-US/kb/javascript-settings-for-interactive-web-page - -
                        4. -
                        -
                        - - diff --git a/src/test/resources/pages/entityNotFoundPage.html b/src/test/resources/pages/entityNotFoundPage.html deleted file mode 100644 index aeabe81a5fa..00000000000 --- a/src/test/resources/pages/entityNotFoundPage.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - TEAMMATES - - - - - - - -
                        - -
                        -
                        - -

                        -
                        -
                        - TEAMMATES could not locate what you were trying to access. -
                        -
                        -
                        -
                        - Possible reasons include: -

                        -
                          -
                        • - You clicked on a link received in email, but the link was mangled by the email software. Try copy-pasting the entire link into the Browser address bar. -
                        • -
                        • - The entity (e.g. course, session) you were trying to access was deleted by an instructor after the link was sent to you by TEAMMATES. -
                          -
                          -
                        • -
                        - If the problem persists, please inform - - TEAMMATES support team - - . -
                        -
                        - - Note: - - If the problematic link was received via email, please also forward us the original email containing the link you clicked, to help us with the troubleshooting. -
                        -
                        - If you are a registered user you can go back to the - - home page - -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Uh oh! Something went wrong. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - We are sorry this happened. You can safely ignore this error page in the following cases: -

                        -
                          -
                        • - Retrying the same action a few minutes later succeeds (i.e. no more error page). -
                        • -
                        • - You loaded an outdated page unintentionally. e.g. some browsers auto-load the pages that were loaded in the previous browsing session. -
                        • -
                        -

                        - However, if you keep seeing this page on multiple failed attempts when trying to perform some action in TEAMMATES, please help us troubleshoot the problem by providing us some additional details using the form below. -

                        -
                        -
                        -
                        -
                        - -
                        - - Note: This is the TEAMMATES support email. It has been pre-filled for your convenience and is not editable. - - -
                        -
                        - -
                        - - Note: This field has also been pre-filled for convenience. Feel free to change it to suit your needs. - - -
                        -
                        - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - diff --git a/src/test/resources/pages/errorPage.html b/src/test/resources/pages/errorPage.html deleted file mode 100644 index 8680fe997d7..00000000000 --- a/src/test/resources/pages/errorPage.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - TEAMMATES - - - - - - - -
                        - -
                        -
                        -
                        -
                        - -

                        - There was an error in our server. -
                        - Please try again in a few moments. -
                        -
                        - If the error persists, please - - let us know - -

                        -
                        -
                        -
                        -
                        -

                        - Uh oh! Something went wrong. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - We are sorry this happened. You can safely ignore this error page in the following cases: -

                        -
                          -
                        • - Retrying the same action a few minutes later succeeds (i.e. no more error page). -
                        • -
                        • - You loaded an outdated page unintentionally. e.g. some browsers auto-load the pages that were loaded in the previous browsing session. -
                        • -
                        -

                        - However, if you keep seeing this page on multiple failed attempts when trying to perform some action in TEAMMATES, please help us troubleshoot the problem by providing us some additional details using the form below. -

                        -
                        -
                        -
                        -
                        - -
                        - - Note: This is the TEAMMATES support email. It has been pre-filled for your convenience and is not editable. - - -
                        -
                        - -
                        - - Note: This field has also been pre-filled for convenience. Feel free to change it to suit your needs. - - -
                        -
                        - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - diff --git a/src/test/resources/pages/instructorArchiveStatusNotAffected.html b/src/test/resources/pages/instructorArchiveStatusNotAffected.html deleted file mode 100644 index 7de730b2519..00000000000 --- a/src/test/resources/pages/instructorArchiveStatusNotAffected.html +++ /dev/null @@ -1,157 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseDetailsAddInstructor.html b/src/test/resources/pages/instructorCourseDetailsAddInstructor.html deleted file mode 100644 index a593f4fc741..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsAddInstructor.html +++ /dev/null @@ -1,28 +0,0 @@ -
                        -
                        - Co-owner: Teammates Coord (InsCrsEdit.coord@gmail.tmt) -
                        -
                        - Custom: Teammates Instructor (InsCrsEdit.instructor@gmail.tmt) -
                        -
                        - Manager: Teammates Manager (InsCrsEdit.manager@gmail.tmt) -
                        -
                        - Custom: Teammates New Instructor (InsCrsEdit.Helper@gmail.tmt) -
                        -
                        - Custom: Teammates New Instructor (InsCrsEdit.newInstr@gmail.tmt) -
                        -
                        - Observer: Teammates Observer (InsCrsEdit.observer@gmail.tmt) -
                        -
                        - Co-owner: Teammates Test (InsCrsEdit.test@gmail.tmt) -
                        -
                        - Tutor: Teammates Tutor (InsCrsEdit.tutor@gmail.tmt) -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseDetailsEmptyCourse.html b/src/test/resources/pages/instructorCourseDetailsEmptyCourse.html deleted file mode 100644 index 98aedf4301d..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsEmptyCourse.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - Course Details [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Course Details -

                        -
                        -
                        -
                        -
                        - -
                        -

                        - CCDetailsUiT.CourseWithoutStudents -

                        -
                        -
                        -
                        - -
                        -

                        - A course with no students -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -
                        - Co-owner: Teammates Test (CCDetailsUiT.instr@gmail.tmt) -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - There are no students in this course. Click - - here - - to enroll students. -
                        -
                        - - -
                        - - - - - - -
                        - There are no students in this course -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/instructorCourseDetailsStudentDeleteAllSuccessful.html b/src/test/resources/pages/instructorCourseDetailsStudentDeleteAllSuccessful.html deleted file mode 100644 index 01d76286e6d..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsStudentDeleteAllSuccessful.html +++ /dev/null @@ -1,106 +0,0 @@ -
                        -
                        -
                        -

                        - Course Details -

                        -
                        -
                        -
                        -
                        - -
                        -

                        - CCDetailsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Programming Language Concepts -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -
                        - Co-owner: Teammates Coord (CCDetailsUiT.coord@gmail.tmt) -
                        -
                        - Co-owner: Teammates Test (CCDetailsUiT.instr@gmail.tmt) -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - All the students have been removed from the course -
                        -
                        - There are no students in this course. Click - - here - - to enroll students. -
                        -
                        - - -
                        - - - - - - -
                        - There are no students in this course -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseDetailsStudentDeleteSuccessful.html b/src/test/resources/pages/instructorCourseDetailsStudentDeleteSuccessful.html deleted file mode 100644 index 1a2cb3d7a5a..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsStudentDeleteSuccessful.html +++ /dev/null @@ -1,330 +0,0 @@ -
                        -
                        -
                        -

                        - Course Details -

                        -
                        -
                        -
                        -
                        - -
                        -

                        - CCDetailsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Programming Language Concepts -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -

                        - 2 -

                        -
                        -
                        -
                        - -
                        -

                        - 3 -

                        -
                        -
                        -
                        - -
                        -
                        - Co-owner: Teammates Coord (CCDetailsUiT.coord@gmail.tmt) -
                        -
                        - Co-owner: Teammates Test (CCDetailsUiT.instr@gmail.tmt) -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - -
                        - -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - The student has been removed from the course -
                        -
                        - - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - Joined - - ${test.student1}@gmail.com - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Charlie Davis - - Yet to join - - ${test.student2}@gmail.com - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Team 2 - - Danny Engrid - - Joined - - danny.e.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseDetailsTestingSanitization.html b/src/test/resources/pages/instructorCourseDetailsTestingSanitization.html deleted file mode 100644 index cc1d2893199..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsTestingSanitization.html +++ /dev/null @@ -1,160 +0,0 @@ -
                        -
                        -
                        -

                        - Course Details -

                        -
                        -
                        -
                        -
                        - -
                        -

                        - CCDetailsUiT.idOfTSCourse -

                        -
                        -
                        -
                        - -
                        -

                        - Testing<script> alert('hi!'); </script> -

                        -
                        -
                        -
                        - -
                        -

                        - 1 -

                        -
                        -
                        -
                        - -
                        -

                        - 1 -

                        -
                        -
                        -
                        - -
                        -

                        - 1 -

                        -
                        -
                        -
                        - -
                        -
                        - Co-owner: Instructor<script> alert('hi!'); </script> (CCDetailsUiT.instructor1@sanitization.tmt) -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section'</td> - - Team tags</option><option value="dump"></td><td>'"&"</td> - - Stud1<script> alert('hi!'); </script> - - Joined - - CCDetailsUiT.normal@sanitization.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseDetailsWithSections.html b/src/test/resources/pages/instructorCourseDetailsWithSections.html deleted file mode 100644 index 1e0584c6661..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsWithSections.html +++ /dev/null @@ -1,328 +0,0 @@ -
                        -
                        -
                        -

                        - Course Details -

                        -
                        -
                        -
                        -
                        - -
                        -

                        - CCDetailsUiT.CS2103 -

                        -
                        -
                        -
                        - -
                        -

                        - Software Engineering -

                        -
                        -
                        -
                        - -
                        -

                        - 2 -

                        -
                        -
                        -
                        - -
                        -

                        - 2 -

                        -
                        -
                        -
                        - -
                        -

                        - 3 -

                        -
                        -
                        -
                        - -
                        -
                        - Co-owner: Teammates Test 2 (CCDetailsUiT.instr2@gmail.tmt) -
                        -
                        - Custom: Teammates Test 2 (CCDetailsUiT.instr2Helper@gmail.tmt) -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - -
                        - -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        - - - -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Tut Group 1 - - Team 1 - - Alice Betsy - - Joined - - ${test.student1}@gmail.com - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Tut Group 1 - - Team 1 - - Charlie Davis - - Yet to join - - ${test.student2}@gmail.com - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Tut Group 2 - - Team 2 - - Benny Charles - - Yet to join - - benny.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseDetailsWithSectionsWithHelperView.html b/src/test/resources/pages/instructorCourseDetailsWithSectionsWithHelperView.html deleted file mode 100644 index ca4015e2e43..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsWithSectionsWithHelperView.html +++ /dev/null @@ -1,328 +0,0 @@ -
                        -
                        -
                        -

                        - Course Details -

                        -
                        -
                        -
                        -
                        - -
                        -

                        - CCDetailsUiT.CS2103 -

                        -
                        -
                        -
                        - -
                        -

                        - Software Engineering -

                        -
                        -
                        -
                        - -
                        -

                        - 2 -

                        -
                        -
                        -
                        - -
                        -

                        - 2 -

                        -
                        -
                        -
                        - -
                        -

                        - 3 -

                        -
                        -
                        -
                        - -
                        -
                        - Co-owner: Teammates Test 2 (CCDetailsUiT.instr2@gmail.tmt) -
                        -
                        - Custom: Teammates Test 2 (CCDetailsUiT.instr2Helper@gmail.tmt) -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - -
                        - -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        - - - -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Tut Group 1 - - Team 1 - - Alice Betsy - - Joined - - ${test.student1}@gmail.com - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Tut Group 1 - - Team 1 - - Charlie Davis - - Yet to join - - ${test.student2}@gmail.com - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Tut Group 2 - - Team 2 - - Benny Charles - - Yet to join - - benny.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseDetailsWithoutSections.html b/src/test/resources/pages/instructorCourseDetailsWithoutSections.html deleted file mode 100644 index d05df03f871..00000000000 --- a/src/test/resources/pages/instructorCourseDetailsWithoutSections.html +++ /dev/null @@ -1,367 +0,0 @@ -
                        -
                        -
                        -

                        - Course Details -

                        -
                        -
                        -
                        -
                        - -
                        -

                        - CCDetailsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Programming Language Concepts -

                        -
                        -
                        -
                        - -
                        -

                        - 0 -

                        -
                        -
                        -
                        - -
                        -

                        - 2 -

                        -
                        -
                        -
                        - -
                        -

                        - 4 -

                        -
                        -
                        -
                        - -
                        -
                        - Co-owner: Teammates Coord (CCDetailsUiT.coord@gmail.tmt) -
                        -
                        - Co-owner: Teammates Test (CCDetailsUiT.instr@gmail.tmt) -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - -
                        - -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        - - - -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - Joined - - ${test.student1}@gmail.com - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Charlie Davis - - Yet to join - - ${test.student2}@gmail.com - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Team 2 - - Benny Charles - - Yet to join - - benny.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Team 2 - - Danny Engrid - - Joined - - danny.e.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditAddInstructor.html b/src/test/resources/pages/instructorCourseEditAddInstructor.html deleted file mode 100644 index 6bab4faed11..00000000000 --- a/src/test/resources/pages/instructorCourseEditAddInstructor.html +++ /dev/null @@ -1,1847 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -  Co-owner: Can do everything  - - View Details - -
                        - -  Manager: Can do everything except for deleting/restoring the course  - - View Details - -
                        - -  Observer: Can only view information(students, submissions, comments etc.). Cannot edit/delete/submit anything.  - - View Details - -
                        - -  Tutor: Can view student details, give/view comments, submit/view responses for sessions  - - View Details - -
                        - -  Custom: No access by default. Any access needs to be granted explicitly. -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 8: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditCancelEditCoownerForm.html b/src/test/resources/pages/instructorCourseEditCancelEditCoownerForm.html deleted file mode 100644 index d1162c82fcf..00000000000 --- a/src/test/resources/pages/instructorCourseEditCancelEditCoownerForm.html +++ /dev/null @@ -1,480 +0,0 @@ -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditCancelEditCustomInstructorForm.html b/src/test/resources/pages/instructorCourseEditCancelEditCustomInstructorForm.html deleted file mode 100644 index f1f13c4a607..00000000000 --- a/src/test/resources/pages/instructorCourseEditCancelEditCustomInstructorForm.html +++ /dev/null @@ -1,477 +0,0 @@ -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditCancelEditCustomInstructorPermissionsForm.html b/src/test/resources/pages/instructorCourseEditCancelEditCustomInstructorPermissionsForm.html deleted file mode 100644 index f1f13c4a607..00000000000 --- a/src/test/resources/pages/instructorCourseEditCancelEditCustomInstructorPermissionsForm.html +++ /dev/null @@ -1,477 +0,0 @@ -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditCoowner.html b/src/test/resources/pages/instructorCourseEditCoowner.html deleted file mode 100644 index df0ad9df547..00000000000 --- a/src/test/resources/pages/instructorCourseEditCoowner.html +++ /dev/null @@ -1,1326 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Manager - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesBeforeSubmit.html b/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesBeforeSubmit.html deleted file mode 100644 index ea035f20946..00000000000 --- a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesBeforeSubmit.html +++ /dev/null @@ -1,1855 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - The changes to the instructor Teammates New Instructor has been updated. -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -  Co-owner: Can do everything  - - View Details - -
                        - -  Manager: Can do everything except for deleting/restoring the course  - - View Details - -
                        - -  Observer: Can only view information(students, submissions, comments etc.). Cannot edit/delete/submit anything.  - - View Details - -
                        - -  Tutor: Can view student details, give/view comments, submit/view responses for sessions  - - View Details - -
                        - -  Custom: No access by default. Any access needs to be granted explicitly. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - In general, this instructor can - -
                        -
                        -
                        - - Edit/Delete/Restore Course -
                        -
                        - - Add/Edit/Delete Instructors -
                        -
                        - - Create/Edit/Delete/Restore Sessions -
                        -
                        - - Enroll/Edit/Delete Students -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - But in section(s) - -

                        -
                        -
                        -
                        -
                        - - Section 1 -
                        -
                        - - Section 2 -
                        -
                        - - Section 3 -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -

                        - - the instructor can only, - -

                        -
                        -
                        - -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        - - Hide session-level permissions - -
                        - - - - - - - - - - - - - - - - - - -
                        - SessionName - - Submit Responses and Add Comments - - View Responses and Comments - - Edit/Delete Responses/Comments by Others -
                        - First feedback session - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - But in section(s) - -

                        -
                        -
                        -
                        -
                        - - Section 1 -
                        -
                        - - Section 2 -
                        -
                        - - Section 3 -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -

                        - - the instructor can only, - -

                        -
                        -
                        - -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        - - Give different permissions for sessions in this section - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - But in section(s) - -

                        -
                        -
                        -
                        -
                        - - Section 1 -
                        -
                        - - Section 2 -
                        -
                        - - Section 3 -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -

                        - - the instructor can only, - -

                        -
                        -
                        - -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        - - Give different permissions for sessions in this section - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 8: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesModal.html b/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesModal.html deleted file mode 100644 index 74dd173e65d..00000000000 --- a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesModal.html +++ /dev/null @@ -1,1855 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - The changes to the instructor New name has been updated. -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -  Co-owner: Can do everything  - - View Details - -
                        - -  Manager: Can do everything except for deleting/restoring the course  - - View Details - -
                        - -  Observer: Can only view information(students, submissions, comments etc.). Cannot edit/delete/submit anything.  - - View Details - -
                        - -  Tutor: Can view student details, give/view comments, submit/view responses for sessions  - - View Details - -
                        - -  Custom: No access by default. Any access needs to be granted explicitly. -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 8: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesSuccessful.html b/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesSuccessful.html deleted file mode 100644 index 7690fbcb103..00000000000 --- a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesSuccessful.html +++ /dev/null @@ -1,1437 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - The changes to the instructor New name has been updated. -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 8: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesSuccessfulAndCheckEditAgain.html b/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesSuccessfulAndCheckEditAgain.html deleted file mode 100644 index 7ad63d312fe..00000000000 --- a/src/test/resources/pages/instructorCourseEditEditInstructorPrivilegesSuccessfulAndCheckEditAgain.html +++ /dev/null @@ -1,1852 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - The changes to the instructor New name has been updated. -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -  Co-owner: Can do everything  - - View Details - -
                        - -  Manager: Can do everything except for deleting/restoring the course  - - View Details - -
                        - -  Observer: Can only view information(students, submissions, comments etc.). Cannot edit/delete/submit anything.  - - View Details - -
                        - -  Tutor: Can view student details, give/view comments, submit/view responses for sessions  - - View Details - -
                        - -  Custom: No access by default. Any access needs to be granted explicitly. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - In general, this instructor can - -
                        -
                        -
                        - - Edit/Delete/Restore Course -
                        -
                        - - Add/Edit/Delete Instructors -
                        -
                        - - Create/Edit/Delete/Restore Sessions -
                        -
                        - - Enroll/Edit/Delete Students -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - But in section(s) - -

                        -
                        -
                        -
                        -
                        - - Section 1 -
                        -
                        - - Section 2 -
                        -
                        - - Section 3 -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -

                        - - the instructor can only, - -

                        -
                        -
                        - -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        - - Hide session-level permissions - -
                        - - - - - - - - - - - - - - - - - - -
                        - SessionName - - Submit Responses and Add Comments - - View Responses and Comments - - Edit/Delete Responses/Comments by Others -
                        - First feedback session - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - But in section(s) - -

                        -
                        -
                        -
                        -
                        - - Section 1 -
                        -
                        - - Section 2 -
                        -
                        - - Section 3 -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -

                        - - the instructor can only, - -

                        -
                        -
                        - -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        - - Hide session-level permissions - -
                        - - - - - - - - - - - - - - - - - - -
                        - SessionName - - Submit Responses and Add Comments - - View Responses and Comments - - Edit/Delete Responses/Comments by Others -
                        - First feedback session - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - But in section(s) - -

                        -
                        -
                        -
                        -
                        - - Section 1 -
                        -
                        - - Section 2 -
                        -
                        - - Section 3 -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -

                        - - the instructor can only, - -

                        -
                        -
                        - -
                        -
                        -
                        -
                        - - View Students' Details -
                        -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        - - Give different permissions for sessions in this section - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 8: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditHelper.html b/src/test/resources/pages/instructorCourseEditHelper.html deleted file mode 100644 index 9be5777dbcc..00000000000 --- a/src/test/resources/pages/instructorCourseEditHelper.html +++ /dev/null @@ -1,1455 +0,0 @@ - - - - Edit Course Details [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Manager - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - - diff --git a/src/test/resources/pages/instructorCourseEditManager.html b/src/test/resources/pages/instructorCourseEditManager.html deleted file mode 100644 index f36929066b3..00000000000 --- a/src/test/resources/pages/instructorCourseEditManager.html +++ /dev/null @@ -1,1326 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Manager - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditObserver.html b/src/test/resources/pages/instructorCourseEditObserver.html deleted file mode 100644 index da281a800d1..00000000000 --- a/src/test/resources/pages/instructorCourseEditObserver.html +++ /dev/null @@ -1,1326 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Manager - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditTestingSanitization.html b/src/test/resources/pages/instructorCourseEditTestingSanitization.html deleted file mode 100644 index 6224437b7a4..00000000000 --- a/src/test/resources/pages/instructorCourseEditTestingSanitization.html +++ /dev/null @@ -1,388 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEditTutor.html b/src/test/resources/pages/instructorCourseEditTutor.html deleted file mode 100644 index 62339638447..00000000000 --- a/src/test/resources/pages/instructorCourseEditTutor.html +++ /dev/null @@ -1,1326 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Course Details -

                        -
                        - -
                        -
                        - - Course: - - -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 2: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Manager - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 4: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        -

                        - - Not available. Instructor is yet to join this course. - -

                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Custom - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 5: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Observer - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 6: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Instructor 7: - - -
                        -
                        -
                        - - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Tutor - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEnrollError.html b/src/test/resources/pages/instructorCourseEnrollError.html deleted file mode 100644 index d5404350984..00000000000 --- a/src/test/resources/pages/instructorCourseEnrollError.html +++ /dev/null @@ -1,397 +0,0 @@ -
                        -
                        -
                        -

                        - Enroll Students for CCEnrollUiT.CS2104 -

                        -
                        -
                        -
                        -
                        - - - - Scroll down - - to see more information about the spreadsheet interfaces. -
                        - - - If you want to enroll more than - - 100 - - students into one course, divide students into sections containing no more than - - 100 - - students. -
                        -
                        - - -
                        -
                        -
                        -

                        - - Problem in line : - - Section 3|Team 3|Frank Hughe|| - - -
                        - - • The field 'email' is empty. An email address contains some text followed by one '@' sign followed by some more text. It cannot be longer than 254 characters, cannot be empty and cannot contain spaces. - -

                        -
                        -

                        - - Problem in line : - - Section 1|Team 1|Black Jack|bjack.gmail.tmt|This student email is invalid - - -
                        - - • "bjack.gmail.tmt" is not acceptable to TEAMMATES as a/an email because it is not in the correct format. An email address contains some text followed by one '@' sign followed by some more text. It cannot be longer than 254 characters, cannot be empty and cannot contain spaces. - -

                        -
                        -

                        - - Problem in line : - - Section 1|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|Robert Downey|rob@email.tmt|This student team name is too long - - -
                        - - • "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is not acceptable to TEAMMATES as a/an team name because it is too long. The value of a/an team name should be no longer than 60 characters. It should not be empty. - -

                        -
                        -

                        - - Problem in line : - - Section 2|Team 2|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|longname@email.tmt|This student name is too long - - -
                        - - • "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is not acceptable to TEAMMATES as a/an person name because it is too long. The value of a/an person name should be no longer than 100 characters. It should not be empty. - -

                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - - Existing students - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        - - New students - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - More info -

                        -
                        -
                          -
                        • - - Spreadsheet Information - -
                            -
                          • - If you have student data in a spreadsheet, simply copy the relevant cell-range from your spreadsheet and paste into the - - New students - - spreadsheet interface above. -
                            -
                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            - Section - - Team - - Name - - Email - - Comments -
                            - Tutorial Group 1 - - Team 1 - - Tom Jacobs - - tom@example.com - -
                            - Tutorial Group 1 - - Team 1 - - Jean Wong - - jean@example.com - - Exchange Student -
                            - Tutorial Group 1 - - Team 1 - - Ravi Kumar - - ravi@example.com - -
                            - Tutorial Group 2 - - Team 2 - - Chun Ling - - ling@example.com - -
                            - Tutorial Group 2 - - Team 2 - - Desmond Wu - - desmond@example.com - -
                            - Tutorial Group 2 - - Team 3 - - Harsha Silva - - harsha@example.com - -
                            -
                          • -
                          • - Each existing cells can be edited by just clicking on it. -
                          • -
                          • - The entire table can be sorted by just clicking on the column name. -
                          • -
                          • - You can re-arrange column order by clicking on the column header and dragging them left or right. -
                          • -
                          • - To access more edit functions, right-click on a cell. -
                          • -
                          • - Column width can be adjusted. -
                          • -
                          • - Expand the - - Existing students - - spreadsheet interface to view existing students in the course. -
                          • -
                          -
                        • -
                        • - - Columns Information - -
                            -
                          • - - Section - - [Compulsory for courses having more than 100 students]: Section name/ID -
                          • -
                          • - - Team - - [Compulsory]: Team name/ID -
                              -
                            • - A team must be unique within a course. A team cannot be in 2 different sections. -
                            • -
                            • - If you do not have teams in your course, use “N/A” as the team name for all students. -
                            • -
                            -
                          • -
                          • - - Name - - [Compulsory]: Student name -
                          • -
                          • - - Email - - [Compulsory]: The email address used to contact the student. -
                            -
                              -
                            • - This need not be a Gmail address. -
                            • -
                            • - It should be unique for each student. If two students are given the same email, they will be considered the same student. -
                            • -
                            -
                          • -
                          • - - Comments - - [Optional]: Any other information you want to record about a student. -
                          • -
                          -
                        • -
                        • - - Mass editing enrolled students - -
                            -
                          • - To mass-edit data of enrolled students (except email address), simply use this page to re-enroll them with the updated data . -
                          • -
                          • - To DELETE students or to UPDATE EMAIL address of a student, please go to the - - courses - - page and click the - - Students -> View/Edit - - link of the course. -
                          • -
                          -
                        • -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEnrollPage.html b/src/test/resources/pages/instructorCourseEnrollPage.html deleted file mode 100644 index 1d5ed94a89a..00000000000 --- a/src/test/resources/pages/instructorCourseEnrollPage.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - Enroll Students for CCEnrollUiT.CS2104 [Instructor] - - - - - - - - - - - -
                        -
                        -
                        -

                        - Enroll Students for CCEnrollUiT.CS2104 -

                        -
                        -
                        -
                        -
                        - - - - Scroll down - - to see more information about the spreadsheet interfaces. -
                        - - - If you want to enroll more than - - 100 - - students into one course, divide students into sections containing no more than - - 100 - - students. -
                        -
                        - - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - - Existing students - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        - - New students - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - More info -

                        -
                        -
                          -
                        • - - Spreadsheet Information - -
                            -
                          • - If you have student data in a spreadsheet, simply copy the relevant cell-range from your spreadsheet and paste into the - - New students - - spreadsheet interface above. -
                            -
                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            - Section - - Team - - Name - - Email - - Comments -
                            - Tutorial Group 1 - - Team 1 - - Tom Jacobs - - tom@example.com - -
                            - Tutorial Group 1 - - Team 1 - - Jean Wong - - jean@example.com - - Exchange Student -
                            - Tutorial Group 1 - - Team 1 - - Ravi Kumar - - ravi@example.com - -
                            - Tutorial Group 2 - - Team 2 - - Chun Ling - - ling@example.com - -
                            - Tutorial Group 2 - - Team 2 - - Desmond Wu - - desmond@example.com - -
                            - Tutorial Group 2 - - Team 3 - - Harsha Silva - - harsha@example.com - -
                            -
                          • -
                          • - Each existing cells can be edited by just clicking on it. -
                          • -
                          • - The entire table can be sorted by just clicking on the column name. -
                          • -
                          • - You can re-arrange column order by clicking on the column header and dragging them left or right. -
                          • -
                          • - To access more edit functions, right-click on a cell. -
                          • -
                          • - Column width can be adjusted. -
                          • -
                          • - Expand the - - Existing students - - spreadsheet interface to view existing students in the course. -
                          • -
                          -
                        • -
                        • - - Columns Information - -
                            -
                          • - - Section - - [Compulsory for courses having more than 100 students]: Section name/ID -
                          • -
                          • - - Team - - [Compulsory]: Team name/ID -
                              -
                            • - A team must be unique within a course. A team cannot be in 2 different sections. -
                            • -
                            • - If you do not have teams in your course, use “N/A” as the team name for all students. -
                            • -
                            -
                          • -
                          • - - Name - - [Compulsory]: Student name -
                          • -
                          • - - Email - - [Compulsory]: The email address used to contact the student. -
                            -
                              -
                            • - This need not be a Gmail address. -
                            • -
                            • - It should be unique for each student. If two students are given the same email, they will be considered the same student. -
                            • -
                            -
                          • -
                          • - - Comments - - [Optional]: Any other information you want to record about a student. -
                          • -
                          -
                        • -
                        • - - Mass editing enrolled students - -
                            -
                          • - To mass-edit data of enrolled students (except email address), simply use this page to re-enroll them with the updated data . -
                          • -
                          • - To DELETE students or to UPDATE EMAIL address of a student, please go to the - - courses - - page and click the - - Students -> View/Edit - - link of the course. -
                          • -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        - - - diff --git a/src/test/resources/pages/instructorCourseEnrollPageResultAllFields.html b/src/test/resources/pages/instructorCourseEnrollPageResultAllFields.html deleted file mode 100644 index 2343c7b979a..00000000000 --- a/src/test/resources/pages/instructorCourseEnrollPageResultAllFields.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - Enrollment Results for CCEnrollUiT.CS2104 [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Enrollment Results for CCEnrollUiT.CS2104 -

                        -
                        -
                        -
                        - Enrollment Successful. Summary given below. Click - - here - - to do further changes to the student list. - - -
                        -
                        -
                        -
                        - 2 student(s) added: -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Section - - Team - - Student Name - - E-mail address - - Comments -
                        - Section 3 - - Team 3 - - Frank Galoe - - frank.g.tmms@gmail.tmt - -
                        - Section 1 - - Team 1 - - José Gómez - - jose.gomez.tmns@gmail.tmt - - This student name contains accented characters -
                        -
                        -
                        -
                        -
                        -
                        - 2 student(s) modified: -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Section - - Team - - Student Name - - E-mail address - - Comments -
                        - Section 1 - - Team 4 - - Alice Betsy - - alice.b.tmms@gmail.tmt - - This comment has been changed -
                        - Section 2 - - Team 2 - - Benny Charles - - benny.c.tmms@gmail.tmt - -
                        -
                        -
                        -
                        -
                        -
                        - 2 student(s) updated with no changes: -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Section - - Team - - Student Name - - E-mail address - - Comments -
                        - Section 2 - - Team 2 - - Charlie Davis - - charlie.d.tmms@gmail.tmt - - This student's name is Charlie Davis -
                        - Section 2 - - Team 2 - - Danny Engrid - - danny.e.tmms@gmail.tmt - - This student's name is Danny Engrid -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/instructorCourseEnrollPageResultEmptySection.html b/src/test/resources/pages/instructorCourseEnrollPageResultEmptySection.html deleted file mode 100644 index f42bab2bddc..00000000000 --- a/src/test/resources/pages/instructorCourseEnrollPageResultEmptySection.html +++ /dev/null @@ -1,162 +0,0 @@ -
                        -
                        -
                        -

                        - Enrollment Results for CCEnrollUiT.CS2104 -

                        -
                        -
                        -
                        - Enrollment Successful. Summary given below. Click - - here - - to do further changes to the student list. - - -
                        -
                        -
                        -
                        - 2 student(s) added: -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Section - - Team - - Student Name - - E-mail address - - Comments -
                        - None - - Team 10 - - No Section 1 - - no.section.one@gmail.tmt - - This student has no section -
                        - None - - Team 11 - - No Section 2 - - no.section.two@gmail.tmt - -
                        -
                        -
                        -
                        -
                        -
                        - 3 student(s) remain unmodified: -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Section - - Team - - Student Name - - E-mail address - - Comments -
                        - Section 1 - - Team 1 - - Alice Betsy - - alice.b.tmms@gmail.tmt - - This comment has been changed -
                        - Section 1 - - Team 1 - - Frank Galoe - - frank.g.tmms@gmail.tmt - -
                        - Section 3 - - Team 3 - - José Gómez - - jose.gomez.tmns@gmail.tmt - - This student name contains accented characters -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseEnrollPageResultForEmptyCourse.html b/src/test/resources/pages/instructorCourseEnrollPageResultForEmptyCourse.html deleted file mode 100644 index dae89a6c582..00000000000 --- a/src/test/resources/pages/instructorCourseEnrollPageResultForEmptyCourse.html +++ /dev/null @@ -1,102 +0,0 @@ -
                        -
                        -
                        -

                        - Enrollment Results for CCEnrollUiT.CS2104 -

                        -
                        -
                        -
                        - Enrollment Successful. Summary given below. Click - - here - - to do further changes to the student list. - - -
                        -
                        -
                        -
                        - 3 student(s) added: -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Section - - Team - - Student Name - - E-mail address - - Comments -
                        - Section 1 - - Team 1 - - Alice Betsy - - alice.b.tmms@gmail.tmt - - This comment has been changed -
                        - Section 1 - - Team 1 - - Frank Galoe - - frank.g.tmms@gmail.tmt - -
                        - Section 3 - - Team 3 - - José Gómez - - jose.gomez.tmns@gmail.tmt - - This student name contains accented characters -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseJoinConfirmationHTML.html b/src/test/resources/pages/instructorCourseJoinConfirmationHTML.html deleted file mode 100644 index f6dacd329ac..00000000000 --- a/src/test/resources/pages/instructorCourseJoinConfirmationHTML.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - Course Join Confirmation [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Course Join Confirmation -

                        -
                        -
                        - -
                        -
                        -
                        -

                        - Confirm your Google account -

                        -
                        -
                        -

                        - You are currently logged in as - - - ${test.instructor} - - - . -
                        - If this is not you please - - log out - - and re-login using your own Google account. -
                        - If this is you, please confirm below to complete your registration. -
                        -

                        - -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/instructorCourseStudentDetailsRegistered.html b/src/test/resources/pages/instructorCourseStudentDetailsRegistered.html deleted file mode 100644 index 454cf163f29..00000000000 --- a/src/test/resources/pages/instructorCourseStudentDetailsRegistered.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - José Gómez [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - José Gómez -

                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - - Profile Details - - (submitted by student) -

                        -
                        - Short Name (Gender) - - Jose ( - - - Not Specified - - - ) -
                        - Personal Email - - jose@e.tmt -
                        - Institution - - TEAMMATES Test Institute 7 -
                        - Nationality - - Laotian -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Enrollment Details -

                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - Team 1 - -
                        -
                        -
                        -
                        - -
                        -
                        - - CCSDetailsUiT.jose.tmms@gmail.tmt - -
                        -
                        -
                        -
                        - -
                        -
                        - - This student's name is José Gómez - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -

                        - More Info: -

                        -

                        - This is a lot of info... -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/instructorCourseStudentDetailsRegisteredWithAttemptedScriptInjection.html b/src/test/resources/pages/instructorCourseStudentDetailsRegisteredWithAttemptedScriptInjection.html deleted file mode 100644 index e17a4396046..00000000000 --- a/src/test/resources/pages/instructorCourseStudentDetailsRegisteredWithAttemptedScriptInjection.html +++ /dev/null @@ -1,191 +0,0 @@ -
                        -
                        -
                        -

                        - Stud1</option></td></div>'" -

                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - - Profile Details - - (submitted by student) -

                        -
                        - Short Name (Gender) - - name"/><script>alert('hi!');</script> ( - - - Not Specified - - - ) -
                        - Personal Email - - weird&'@gmail.tmt -
                        - Institution - - school'/><script>alert('hi!');</script> -
                        - Nationality - - American -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Enrollment Details -

                        -
                        -
                        - -
                        -
                        - -
                        -
                        - - Section'</td> - -
                        -
                        -
                        -
                        - -
                        -
                        - - Team tags&"</option></td> - -
                        -
                        -
                        -
                        - -
                        -
                        - - CCSDetailsUiT.stud@sanitization.tmt - -
                        -
                        -
                        -
                        - -
                        -
                        - - </p></div>'"<script> alert('hi!'); </script> - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -

                        - More Info: -

                        -

                        - I am just a student :P<script> alert('hi!'); </script> -

                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseStudentDetailsRegisteredWithHelperView.html b/src/test/resources/pages/instructorCourseStudentDetailsRegisteredWithHelperView.html deleted file mode 100644 index d6c0373cdd6..00000000000 --- a/src/test/resources/pages/instructorCourseStudentDetailsRegisteredWithHelperView.html +++ /dev/null @@ -1,179 +0,0 @@ -
                        -
                        -
                        -

                        - José Gómez -

                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - - Profile Details - - (submitted by student) -

                        -
                        - Short Name (Gender) - - Jose ( - - - Not Specified - - - ) -
                        - Personal Email - - jose@e.tmt -
                        - Institution - - TEAMMATES Test Institute 7 -
                        - Nationality - - Laotian -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Enrollment Details -

                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - Team 1 - -
                        -
                        -
                        -
                        - -
                        -
                        - - CCSDetailsUiT.jose.tmms@gmail.tmt - -
                        -
                        -
                        -
                        - -
                        -
                        - - This student's name is José Gómez - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -

                        - More Info: -

                        -

                        - This is a lot of info... -

                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseStudentDetailsUnregistered.html b/src/test/resources/pages/instructorCourseStudentDetailsUnregistered.html deleted file mode 100644 index a499df2f7c3..00000000000 --- a/src/test/resources/pages/instructorCourseStudentDetailsUnregistered.html +++ /dev/null @@ -1,78 +0,0 @@ -
                        -
                        -
                        -

                        - Benny Charles -

                        -
                        -
                        -
                        - Normally, we would show the student’s profile here. However, this student has not created a profile yet -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        - Enrollment Details -

                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - Team 1 - -
                        -
                        -
                        -
                        - -
                        -
                        - - benny.c.tmms@gmail.tmt - -
                        -
                        -
                        -
                        - -
                        -
                        - - This student's name is Benny Charles - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCourseStudentEditPage.html b/src/test/resources/pages/instructorCourseStudentEditPage.html deleted file mode 100644 index 015f5280228..00000000000 --- a/src/test/resources/pages/instructorCourseStudentEditPage.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - Edit Student Details [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Edit Student Details -

                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/instructorCourseStudentEditUnregisteredPage.html b/src/test/resources/pages/instructorCourseStudentEditUnregisteredPage.html deleted file mode 100644 index e647e1400e8..00000000000 --- a/src/test/resources/pages/instructorCourseStudentEditUnregisteredPage.html +++ /dev/null @@ -1,64 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Student Details -

                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesAddDupIdFailed.html b/src/test/resources/pages/instructorCoursesAddDupIdFailed.html deleted file mode 100644 index 96d25092259..00000000000 --- a/src/test/resources/pages/instructorCoursesAddDupIdFailed.html +++ /dev/null @@ -1,349 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - A course by the same ID already exists in the system, possibly created by another user. Please choose a different course ID -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesAddInvalidIdFailed.html b/src/test/resources/pages/instructorCoursesAddInvalidIdFailed.html deleted file mode 100644 index c0a2ab55e8a..00000000000 --- a/src/test/resources/pages/instructorCoursesAddInvalidIdFailed.html +++ /dev/null @@ -1,349 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - "Invalid ID" is not acceptable to TEAMMATES as a/an course ID because it is not in the correct format. A course ID can contain letters, numbers, fullstops, hyphens, underscores, and dollar signs. It cannot be longer than 40 characters, cannot be empty and cannot contain spaces. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesAddMissingParamsFailed.html b/src/test/resources/pages/instructorCoursesAddMissingParamsFailed.html deleted file mode 100644 index c911c16d924..00000000000 --- a/src/test/resources/pages/instructorCoursesAddMissingParamsFailed.html +++ /dev/null @@ -1,349 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - The field 'course name' is empty. The value of a/an course name should be no longer than 64 characters. It should not be empty. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesAddSuccessful.html b/src/test/resources/pages/instructorCoursesAddSuccessful.html deleted file mode 100644 index e51f633d32d..00000000000 --- a/src/test/resources/pages/instructorCoursesAddSuccessful.html +++ /dev/null @@ -1,359 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - The course has been added. Click - - here - - to add students to the course or click - - here - - to add other instructors. -
                        - If you don't see the course in the list below, please refresh the page after a few moments. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesArchiveSuccessful.html b/src/test/resources/pages/instructorCoursesArchiveSuccessful.html deleted file mode 100644 index 0250ebfd520..00000000000 --- a/src/test/resources/pages/instructorCoursesArchiveSuccessful.html +++ /dev/null @@ -1,312 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - The course CCAddUiTest.CS1101 has been archived. It will not appear in the home page any more. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Archived courses -

                        - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Action(s) -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Unarchive - - - Delete - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesDeleteAllSuccessful.html b/src/test/resources/pages/instructorCoursesDeleteAllSuccessful.html deleted file mode 100644 index f0fdf5d1ab7..00000000000 --- a/src/test/resources/pages/instructorCoursesDeleteAllSuccessful.html +++ /dev/null @@ -1,138 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - All courses have been permanently deleted. -
                        -
                        - You do not seem to have any courses. Use the form above to create a course. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - - - - - - - -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesDeleteSuccessful.html b/src/test/resources/pages/instructorCoursesDeleteSuccessful.html deleted file mode 100644 index 121ba86d689..00000000000 --- a/src/test/resources/pages/instructorCoursesDeleteSuccessful.html +++ /dev/null @@ -1,229 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - The course CCAddUiTest.CS2106 has been permanently deleted. -
                        -
                        - You do not seem to have any courses. Use the form above to create a course. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - - - - - - - -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2107 - - Introduction to Information Security - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesMoveToRecycleBinSuccessful.html b/src/test/resources/pages/instructorCoursesMoveToRecycleBinSuccessful.html deleted file mode 100644 index 0fc088aed7d..00000000000 --- a/src/test/resources/pages/instructorCoursesMoveToRecycleBinSuccessful.html +++ /dev/null @@ -1,323 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - The course CCAddUiTest.course1 has been deleted. You can restore it from the deleted courses table below. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - ${datetime.now.courses} - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesMultipleCourses.html b/src/test/resources/pages/instructorCoursesMultipleCourses.html deleted file mode 100644 index 42fb9a99204..00000000000 --- a/src/test/resources/pages/instructorCoursesMultipleCourses.html +++ /dev/null @@ -1,296 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesNoCourse.html b/src/test/resources/pages/instructorCoursesNoCourse.html deleted file mode 100644 index 00becf65642..00000000000 --- a/src/test/resources/pages/instructorCoursesNoCourse.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - Add New Course [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - You do not seem to have any courses. Use the form above to create a course. -
                        -
                        -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - - - - - - - -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute with Long Long Long Name - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - - diff --git a/src/test/resources/pages/instructorCoursesRestoreAllSuccessful.html b/src/test/resources/pages/instructorCoursesRestoreAllSuccessful.html deleted file mode 100644 index 9a68ecf7599..00000000000 --- a/src/test/resources/pages/instructorCoursesRestoreAllSuccessful.html +++ /dev/null @@ -1,306 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - All courses have been restored. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesRestoreSuccessful.html b/src/test/resources/pages/instructorCoursesRestoreSuccessful.html deleted file mode 100644 index 1b79aadf098..00000000000 --- a/src/test/resources/pages/instructorCoursesRestoreSuccessful.html +++ /dev/null @@ -1,349 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - The course CCAddUiTest.course1 has been restored. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesStatsAjaxFailure.html b/src/test/resources/pages/instructorCoursesStatsAjaxFailure.html deleted file mode 100644 index 405d02b63ea..00000000000 --- a/src/test/resources/pages/instructorCoursesStatsAjaxFailure.html +++ /dev/null @@ -1,300 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - Failed. - - Try again? - - - Failed. - - Try again? - - - Failed. - - Try again? - - - Failed. - - Try again? - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesStatsAjaxSuccessful.html b/src/test/resources/pages/instructorCoursesStatsAjaxSuccessful.html deleted file mode 100644 index 2ab5f9ae48f..00000000000 --- a/src/test/resources/pages/instructorCoursesStatsAjaxSuccessful.html +++ /dev/null @@ -1,288 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - 0 - - 0 - - 0 - - 0 - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorCoursesUnarchiveSuccessful.html b/src/test/resources/pages/instructorCoursesUnarchiveSuccessful.html deleted file mode 100644 index 8cb5d5bd6b6..00000000000 --- a/src/test/resources/pages/instructorCoursesUnarchiveSuccessful.html +++ /dev/null @@ -1,306 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - The course CCAddUiTest.CS1101 has been unarchived. -
                        -
                        - -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - CCAddUiTest.course1 - - Software Engineering $^&*() - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS1101 - - Programming Methodology - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2104 - - Programming Language Concept - - ${datetime.now.courses} - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        - CCAddUiTest.CS2105 - - Computer Networks - - 2 Apr 2012 - - - Show - - - - Show - - - - Show - - - - Show - - - - Enroll - - - View - - - Edit - - - Archive - - - Delete - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorEditStudentFeedbackHint.html b/src/test/resources/pages/instructorEditStudentFeedbackHint.html deleted file mode 100644 index bf861d243b4..00000000000 --- a/src/test/resources/pages/instructorEditStudentFeedbackHint.html +++ /dev/null @@ -1,22 +0,0 @@ - diff --git a/src/test/resources/pages/instructorEditStudentFeedbackPageModified.html b/src/test/resources/pages/instructorEditStudentFeedbackPageModified.html deleted file mode 100644 index d1f8b364b76..00000000000 --- a/src/test/resources/pages/instructorEditStudentFeedbackPageModified.html +++ /dev/null @@ -1,335 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - All responses submitted successfully! -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IESFPTCourse -

                        -
                        -
                        -
                        - -
                        -

                        - First feedback session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 30 Apr 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the following questions. -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Good design -

                        -
                        - -
                        - -
                        - Response length: - - 2 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate your product. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - What do you like best about our product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorEditStudentFeedbackPageOpen.html b/src/test/resources/pages/instructorEditStudentFeedbackPageOpen.html deleted file mode 100644 index c25695e34e2..00000000000 --- a/src/test/resources/pages/instructorEditStudentFeedbackPageOpen.html +++ /dev/null @@ -1,329 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IESFPTCourse -

                        -
                        -
                        -
                        - -
                        -

                        - First feedback session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 30 Apr 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the following questions. -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Student 1 self feedback. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate your product. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - What do you like best about our product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackAddSuccess.html b/src/test/resources/pages/instructorFeedbackAddSuccess.html deleted file mode 100644 index d5881fd7314..00000000000 --- a/src/test/resources/pages/instructorFeedbackAddSuccess.html +++ /dev/null @@ -1,2778 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackUiT.CS1101 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - New Session ## -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the new feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Awaiting -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The feedback session has been added. Click the "Add New Question" button below to begin adding questions for the feedback session. -
                        -
                        - - -
                        -
                        - You have not created any questions for this feedback session yet. Click the button below to add a feedback question. -
                        -
                        -
                        - - - - -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackAllSessionTypes.html b/src/test/resources/pages/instructorFeedbackAllSessionTypes.html deleted file mode 100644 index aaec096e474..00000000000 --- a/src/test/resources/pages/instructorFeedbackAllSessionTypes.html +++ /dev/null @@ -1,1324 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - CFeedbackUiT.CS2104 - - Awaiting Session # - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Open Session # - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2104 - - First Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Manual Session #1 - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackAllSessionTypesWithHelperView.html b/src/test/resources/pages/instructorFeedbackAllSessionTypesWithHelperView.html deleted file mode 100644 index 01efe5c3b3d..00000000000 --- a/src/test/resources/pages/instructorFeedbackAllSessionTypesWithHelperView.html +++ /dev/null @@ -1,1296 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - CFeedbackUiT.CS2104 - - Awaiting Session # - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Open Session # - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2104 - - First Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Manual Session #1 - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackConstSumOptionQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackConstSumOptionQuestionAddSuccess.html deleted file mode 100644 index ff31c4895d2..00000000000 --- a/src/test/resources/pages/instructorFeedbackConstSumOptionQuestionAddSuccess.html +++ /dev/null @@ -1,3347 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FConstSumOptionQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Distribute points (among options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackConstSumOptionQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackConstSumOptionQuestionEditSuccess.html deleted file mode 100644 index fd4c170ff3b..00000000000 --- a/src/test/resources/pages/instructorFeedbackConstSumOptionQuestionEditSuccess.html +++ /dev/null @@ -1,3347 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FConstSumOptionQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Distribute points (among options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackConstSumRecipientQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackConstSumRecipientQuestionAddSuccess.html deleted file mode 100644 index 127a61cbb43..00000000000 --- a/src/test/resources/pages/instructorFeedbackConstSumRecipientQuestionAddSuccess.html +++ /dev/null @@ -1,3302 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FConstSumRecipientQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Distribute points (among recipients) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackConstSumRecipientQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackConstSumRecipientQuestionEditSuccess.html deleted file mode 100644 index f3e3c671b1e..00000000000 --- a/src/test/resources/pages/instructorFeedbackConstSumRecipientQuestionEditSuccess.html +++ /dev/null @@ -1,3302 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FConstSumRecipientQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Distribute points (among recipients) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackContribQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackContribQuestionAddSuccess.html deleted file mode 100644 index b93426bc5ed..00000000000 --- a/src/test/resources/pages/instructorFeedbackContribQuestionAddSuccess.html +++ /dev/null @@ -1,3217 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FContribQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Team contribution question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - - Allow response giver to select 'Not Sure' as the answer - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - The recipient's team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackContribQuestionEdit.html b/src/test/resources/pages/instructorFeedbackContribQuestionEdit.html deleted file mode 100644 index 09ead80ffb7..00000000000 --- a/src/test/resources/pages/instructorFeedbackContribQuestionEdit.html +++ /dev/null @@ -1,3217 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FContribQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - - -  Team contribution question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - - Allow response giver to select 'Not Sure' as the answer - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - The recipient's team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackContribQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackContribQuestionEditSuccess.html deleted file mode 100644 index 3498ba50b25..00000000000 --- a/src/test/resources/pages/instructorFeedbackContribQuestionEditSuccess.html +++ /dev/null @@ -1,3217 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FContribQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Team contribution question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - - Allow response giver to select 'Not Sure' as the answer - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - The recipient's team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackCopyQuestionModal.html b/src/test/resources/pages/instructorFeedbackCopyQuestionModal.html deleted file mode 100644 index 79ef4a74022..00000000000 --- a/src/test/resources/pages/instructorFeedbackCopyQuestionModal.html +++ /dev/null @@ -1,88 +0,0 @@ - diff --git a/src/test/resources/pages/instructorFeedbackCopyQuestionModalTestingSanitization.html b/src/test/resources/pages/instructorFeedbackCopyQuestionModalTestingSanitization.html deleted file mode 100644 index 6a6f8a63b14..00000000000 --- a/src/test/resources/pages/instructorFeedbackCopyQuestionModalTestingSanitization.html +++ /dev/null @@ -1,88 +0,0 @@ - diff --git a/src/test/resources/pages/instructorFeedbackCopyQuestionSuccess.html b/src/test/resources/pages/instructorFeedbackCopyQuestionSuccess.html deleted file mode 100644 index cbbdb806908..00000000000 --- a/src/test/resources/pages/instructorFeedbackCopyQuestionSuccess.html +++ /dev/null @@ -1,3672 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the edited feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 2: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackCopySuccess.html b/src/test/resources/pages/instructorFeedbackCopySuccess.html deleted file mode 100644 index b0b54a4c1e4..00000000000 --- a/src/test/resources/pages/instructorFeedbackCopySuccess.html +++ /dev/null @@ -1,2778 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackUiT.CS1101 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - New Session ## (Copied) -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Awaiting -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The feedback session has been copied. Please modify settings/questions as necessary. -
                        -
                        - - -
                        -
                        - You have not created any questions for this feedback session yet. Click the button below to add a feedback question. -
                        -
                        -
                        - - - - -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackCopyTrimmedSuccess.html b/src/test/resources/pages/instructorFeedbackCopyTrimmedSuccess.html deleted file mode 100644 index d5385d529c5..00000000000 --- a/src/test/resources/pages/instructorFeedbackCopyTrimmedSuccess.html +++ /dev/null @@ -1,2778 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackUiT.CS1101 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - New Session ## Trimmed (Copied) -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Awaiting -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The feedback session has been copied. Please modify settings/questions as necessary. -
                        -
                        - - -
                        -
                        - You have not created any questions for this feedback session yet. Click the button below to add a feedback question. -
                        -
                        -
                        - - - - -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackDeleteAllSuccessful.html b/src/test/resources/pages/instructorFeedbackDeleteAllSuccessful.html deleted file mode 100644 index 719962805ab..00000000000 --- a/src/test/resources/pages/instructorFeedbackDeleteAllSuccessful.html +++ /dev/null @@ -1,894 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - Operating Systems -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - All sessions have been permanently deleted. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackDeleteSuccessful.html b/src/test/resources/pages/instructorFeedbackDeleteSuccessful.html deleted file mode 100644 index 25acb1c2016..00000000000 --- a/src/test/resources/pages/instructorFeedbackDeleteSuccessful.html +++ /dev/null @@ -1,1007 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - Operating Systems -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - The feedback session has been permanently deleted. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CFeedbackUiT.CS2106 - - Second Session #2 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        - CFeedbackUiT.CS2106 - - Third Session #3 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditCopyFail.html b/src/test/resources/pages/instructorFeedbackEditCopyFail.html deleted file mode 100644 index cb2b791c721..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditCopyFail.html +++ /dev/null @@ -1,3268 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FeedbackEditCopy.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        -

                        - Changing the visibility after collecting responses is not recommended. -

                        -

                        - Reason: The existing responses were submitted under the 'promise' of a certain visibility and changing the visibility later 'breaks' that promise. -

                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, but not the name of the recipient, or your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditCopyPage.html b/src/test/resources/pages/instructorFeedbackEditCopyPage.html deleted file mode 100644 index 50e22cb530c..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditCopyPage.html +++ /dev/null @@ -1,3267 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FeedbackEditCopy.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        -

                        - Changing the visibility after collecting responses is not recommended. -

                        -

                        - Reason: The existing responses were submitted under the 'promise' of a certain visibility and changing the visibility later 'breaks' that promise. -

                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, but not the name of the recipient, or your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditCopySuccess.html b/src/test/resources/pages/instructorFeedbackEditCopySuccess.html deleted file mode 100644 index c99f2ffeef2..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditCopySuccess.html +++ /dev/null @@ -1,1332 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        - Software Engineering -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - The feedback session has been copied. Please modify settings/questions as necessary. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - FeedbackEditCopy.CS2104 - - New name! - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - FeedbackEditCopy.CS2105 - - New name! - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - FeedbackEditCopy.CS2103 - - New name! - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - FeedbackEditCopy.CS2104 - - First Session - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditEmpty.html b/src/test/resources/pages/instructorFeedbackEditEmpty.html deleted file mode 100644 index 1008b7115bd..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditEmpty.html +++ /dev/null @@ -1,2904 +0,0 @@ - - - - Edit Feedback Session [Instructor] - - - - - - - - - - - - -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        - - -
                        -
                        - You have not created any questions for this feedback session yet. Click the button below to add a feedback question. -
                        -
                        -
                        - - - - -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - -${datepicker} - - diff --git a/src/test/resources/pages/instructorFeedbackEditManuallyPublished.html b/src/test/resources/pages/instructorFeedbackEditManuallyPublished.html deleted file mode 100644 index 14001376964..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditManuallyPublished.html +++ /dev/null @@ -1,2770 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the edited feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        - - -
                        -
                        - You have not created any questions for this feedback session yet. Click the button below to add a feedback question. -
                        -
                        -
                        - - - - -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditPageTestingSanitization.html b/src/test/resources/pages/instructorFeedbackEditPageTestingSanitization.html deleted file mode 100644 index 55165b5df8c..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditPageTestingSanitization.html +++ /dev/null @@ -1,3203 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.idOfTSCourse -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Testing<script> alert('hi!'); </script> -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Normal feedback session name -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - unclosed tags Attempted script injection '" -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditSuccess.html b/src/test/resources/pages/instructorFeedbackEditSuccess.html deleted file mode 100644 index e4a8d9a31e6..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditSuccess.html +++ /dev/null @@ -1,2770 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the edited feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        - - -
                        -
                        - You have not created any questions for this feedback session yet. Click the button below to add a feedback question. -
                        -
                        -
                        - - - - -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditUncommonSettingsSendEmails.html b/src/test/resources/pages/instructorFeedbackEditUncommonSettingsSendEmails.html deleted file mode 100644 index edad651966f..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditUncommonSettingsSendEmails.html +++ /dev/null @@ -1,277 +0,0 @@ -
                        - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackEditUncommonSettingsSessionVisibility.html b/src/test/resources/pages/instructorFeedbackEditUncommonSettingsSessionVisibility.html deleted file mode 100644 index ed2573f8537..00000000000 --- a/src/test/resources/pages/instructorFeedbackEditUncommonSettingsSessionVisibility.html +++ /dev/null @@ -1,277 +0,0 @@ -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackEmptyAll.html b/src/test/resources/pages/instructorFeedbackEmptyAll.html deleted file mode 100644 index 4e79ef297f7..00000000000 --- a/src/test/resources/pages/instructorFeedbackEmptyAll.html +++ /dev/null @@ -1,1036 +0,0 @@ - - - - Add New Feedback Session [Instructor] - - - - - - - - - - - - -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - You need to have an active(unarchived) course to create a session! - -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - You have not created any courses yet, or you have no active courses. Go - - here - - to create or unarchive a course. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - -${datepicker} - - diff --git a/src/test/resources/pages/instructorFeedbackEmptySession.html b/src/test/resources/pages/instructorFeedbackEmptySession.html deleted file mode 100644 index d7a93230452..00000000000 --- a/src/test/resources/pages/instructorFeedbackEmptySession.html +++ /dev/null @@ -1,889 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - Course Without Sessions -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackMcqQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackMcqQuestionAddSuccess.html deleted file mode 100644 index 96e56dcbeb5..00000000000 --- a/src/test/resources/pages/instructorFeedbackMcqQuestionAddSuccess.html +++ /dev/null @@ -1,3342 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMcqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (single answer) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackMcqQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackMcqQuestionEditSuccess.html deleted file mode 100644 index 93a8a11aabd..00000000000 --- a/src/test/resources/pages/instructorFeedbackMcqQuestionEditSuccess.html +++ /dev/null @@ -1,3323 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMcqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (single answer) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackMcqQuestionWeightAddSuccess.html b/src/test/resources/pages/instructorFeedbackMcqQuestionWeightAddSuccess.html deleted file mode 100644 index 3f992c112fc..00000000000 --- a/src/test/resources/pages/instructorFeedbackMcqQuestionWeightAddSuccess.html +++ /dev/null @@ -1,3325 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMcqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (single answer) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - More details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        - Weights - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackMcqQuestionWeightEditSuccess.html b/src/test/resources/pages/instructorFeedbackMcqQuestionWeightEditSuccess.html deleted file mode 100644 index cc76d216cb7..00000000000 --- a/src/test/resources/pages/instructorFeedbackMcqQuestionWeightEditSuccess.html +++ /dev/null @@ -1,3325 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMcqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (single answer) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - More details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        - Weights - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackMoveToRecycleBinSuccessful.html b/src/test/resources/pages/instructorFeedbackMoveToRecycleBinSuccessful.html deleted file mode 100644 index b8719cefb51..00000000000 --- a/src/test/resources/pages/instructorFeedbackMoveToRecycleBinSuccessful.html +++ /dev/null @@ -1,1865 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - The feedback session has been deleted. You can restore it from the deleted sessions table below. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - CFeedbackUiT.CS1101 - - responses cant be seen my students 1 # - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Allow Early Viewing Session # - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2104 - - Session of characters12345678000000000 - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - New Session ## - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2104 - - Awaiting Session # - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Open Session # - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2104 - - First Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Manual Session #1 - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CFeedbackUiT.CS1101 - - Long Instruction Test ## - - ${datetime.now.courses} - - ${datetime.now.courses} - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackMsqQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackMsqQuestionAddSuccess.html deleted file mode 100644 index b809dcf2c65..00000000000 --- a/src/test/resources/pages/instructorFeedbackMsqQuestionAddSuccess.html +++ /dev/null @@ -1,3371 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMsqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (multiple answers) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackMsqQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackMsqQuestionEditSuccess.html deleted file mode 100644 index 5b61fcf3846..00000000000 --- a/src/test/resources/pages/instructorFeedbackMsqQuestionEditSuccess.html +++ /dev/null @@ -1,3352 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMsqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (multiple answers) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackMsqQuestionWeightAddSuccess.html b/src/test/resources/pages/instructorFeedbackMsqQuestionWeightAddSuccess.html deleted file mode 100644 index 711851b95d4..00000000000 --- a/src/test/resources/pages/instructorFeedbackMsqQuestionWeightAddSuccess.html +++ /dev/null @@ -1,3354 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMsqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (multiple answers) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - More details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        - Weights -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackMsqQuestionWeightEditSuccess.html b/src/test/resources/pages/instructorFeedbackMsqQuestionWeightEditSuccess.html deleted file mode 100644 index c2c353f0e59..00000000000 --- a/src/test/resources/pages/instructorFeedbackMsqQuestionWeightEditSuccess.html +++ /dev/null @@ -1,3354 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FMsqQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Multiple-choice (multiple answers) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - More details -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        - Weights -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackNumScaleQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackNumScaleQuestionAddSuccess.html deleted file mode 100644 index fc3993fa5b2..00000000000 --- a/src/test/resources/pages/instructorFeedbackNumScaleQuestionAddSuccess.html +++ /dev/null @@ -1,3227 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FNumScaleQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Numerical-scale question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Minimum value: - -
                        -
                        - Increment: - -
                        -
                        - Maximum value: - -
                        -
                        -
                        -
                        -
                        - - [Based on the above settings, acceptable responses are: 0, 0.1, 0.2, ..., 0.8, 0.9, 1] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackNumScaleQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackNumScaleQuestionEditSuccess.html deleted file mode 100644 index 2002ac11799..00000000000 --- a/src/test/resources/pages/instructorFeedbackNumScaleQuestionEditSuccess.html +++ /dev/null @@ -1,3227 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FNumScaleQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Numerical-scale question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Minimum value: - -
                        -
                        - Increment: - -
                        -
                        - Maximum value: - -
                        -
                        -
                        -
                        -
                        - - [Based on the above settings, acceptable responses are: 3, 3.002, 3.004, ..., 3.996, 3.998, 4] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackPublishSuccessful.html b/src/test/resources/pages/instructorFeedbackPublishSuccessful.html deleted file mode 100644 index a4ca480f7e6..00000000000 --- a/src/test/resources/pages/instructorFeedbackPublishSuccessful.html +++ /dev/null @@ -1,1334 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - The feedback session has been published. Please allow up to 1 hour for all the notification emails to be sent out. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - CFeedbackUiT.CS2104 - - Awaiting Session # - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Open Session # - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2104 - - First Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Manual Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackQuestionAddSuccess.html deleted file mode 100644 index 693808b4c3d..00000000000 --- a/src/test/resources/pages/instructorFeedbackQuestionAddSuccess.html +++ /dev/null @@ -1,3218 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the edited feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackQuestionEditToTeamToTeam.html b/src/test/resources/pages/instructorFeedbackQuestionEditToTeamToTeam.html deleted file mode 100644 index 5e2b8ac56b6..00000000000 --- a/src/test/resources/pages/instructorFeedbackQuestionEditToTeamToTeam.html +++ /dev/null @@ -1,3218 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the edited feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - User/Group - - Can see answer - - Can see giver's name - - Can see recipient's name -
                        -
                        - Recipient(s) -
                        -
                        - - - - - -
                        -
                        - Giver's Team Members -
                        -
                        - - - - - -
                        -
                        - Recipient's Team Members -
                        -
                        - - - - - -
                        -
                        - Other students -
                        -
                        - - - - - -
                        -
                        - Instructors -
                        -
                        - - - - - -
                        -
                        -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving team can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackQuestionVisibilityOptions.html b/src/test/resources/pages/instructorFeedbackQuestionVisibilityOptions.html deleted file mode 100644 index 0d3c1124646..00000000000 --- a/src/test/resources/pages/instructorFeedbackQuestionVisibilityOptions.html +++ /dev/null @@ -1,3218 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the edited feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving team can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackQuestionVisibilityPreview.html b/src/test/resources/pages/instructorFeedbackQuestionVisibilityPreview.html deleted file mode 100644 index b80ca5befc0..00000000000 --- a/src/test/resources/pages/instructorFeedbackQuestionVisibilityPreview.html +++ /dev/null @@ -1,3218 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the edited feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - User/Group - - Can see answer - - Can see giver's name - - Can see recipient's name -
                        -
                        - Recipient(s) -
                        -
                        - - - - - -
                        -
                        - Giver's Team Members -
                        -
                        - - - - - -
                        -
                        - Recipient's Team Members -
                        -
                        - - - - - -
                        -
                        - Other students -
                        -
                        - - - - - -
                        -
                        - Instructors -
                        -
                        - - - - - -
                        -
                        -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving team can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRankMinMaxChoicesSuccess.html b/src/test/resources/pages/instructorFeedbackRankMinMaxChoicesSuccess.html deleted file mode 100644 index 34dc92cb70e..00000000000 --- a/src/test/resources/pages/instructorFeedbackRankMinMaxChoicesSuccess.html +++ /dev/null @@ -1,3801 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRankUiT.CS4221 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Database Applications Design and Tuning -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Edit Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please edit this session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rank (options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 2: - - - -  Rank (recipients) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRankQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackRankQuestionAddSuccess.html deleted file mode 100644 index 0c7579fac13..00000000000 --- a/src/test/resources/pages/instructorFeedbackRankQuestionAddSuccess.html +++ /dev/null @@ -1,3785 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRankUiT.CS4221 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Database Applications Design and Tuning -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Edit Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please edit this session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rank (options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 2: - - - -  Rank (recipients) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRankQuestionEdit.html b/src/test/resources/pages/instructorFeedbackRankQuestionEdit.html deleted file mode 100644 index 4531900043f..00000000000 --- a/src/test/resources/pages/instructorFeedbackRankQuestionEdit.html +++ /dev/null @@ -1,509 +0,0 @@ -
                        -
                        -
                        -
                        - - - Question - - - -  Rank (options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRankQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackRankQuestionEditSuccess.html deleted file mode 100644 index c1ac41e0c20..00000000000 --- a/src/test/resources/pages/instructorFeedbackRankQuestionEditSuccess.html +++ /dev/null @@ -1,3800 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRankUiT.CS4221 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Database Applications Design and Tuning -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Edit Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please edit this session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rank (options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - -
                        -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 2: - - - -  Rank (recipients) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRestoreAllSuccessful.html b/src/test/resources/pages/instructorFeedbackRestoreAllSuccessful.html deleted file mode 100644 index db8d555c25e..00000000000 --- a/src/test/resources/pages/instructorFeedbackRestoreAllSuccessful.html +++ /dev/null @@ -1,1222 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - Computer Networks -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - All sessions have been restored. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - CFeedbackUiT.CS2105 - - First Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2105 - - Second Session #2 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2105 - - Third Session #3 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackRestoreSuccessful.html b/src/test/resources/pages/instructorFeedbackRestoreSuccessful.html deleted file mode 100644 index 83696d890de..00000000000 --- a/src/test/resources/pages/instructorFeedbackRestoreSuccessful.html +++ /dev/null @@ -1,1105 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - Computer Networks -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - The feedback session has been restored. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - CFeedbackUiT.CS2105 - - First Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CFeedbackUiT.CS2105 - - Second Session #2 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        - CFeedbackUiT.CS2105 - - Third Session #3 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsAddComment.html b/src/test/resources/pages/instructorFeedbackResultsAddComment.html deleted file mode 100644 index ea240bf7b4d..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAddComment.html +++ /dev/null @@ -1,919 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFRResponseCommentUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - - - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - To: - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - My comments on the class - -
                        -
                        -
                        -
                        - This is for nobody specific. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 1 -

                          -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 2 -

                          -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsAjaxByGQR.html b/src/test/resources/pages/instructorFeedbackResultsAjaxByGQR.html deleted file mode 100644 index e214531c295..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAjaxByGQR.html +++ /dev/null @@ -1,5981 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Question > Recipient -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice self feedback. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - PowerSearch - - Comment by Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Team 1 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Alice to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Charlie Dávis - - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Charlie Dávis - - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny to Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - Team 2 - - Response from team 1 (by alice) to team 2. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 3 - - Emily - - 3 Response to Emily. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Benny to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - PowerSearch - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - Team 2 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsAjaxByGRQ.html b/src/test/resources/pages/instructorFeedbackResultsAjaxByGRQ.html deleted file mode 100644 index a8302c3793e..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAjaxByGRQ.html +++ /dev/null @@ -1,4352 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Comment to be edited by different instructor. -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Comment by Alice. -
                        -
                      • - - - -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        - - -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        - - - -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Team 2 - -
                        -
                        - - From: Team 1</td></div>'" -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Emily (Team 3) - - -
                        -
                        -
                        - - From: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 3 Response to Emily. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        - diff --git a/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestion.html b/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestion.html deleted file mode 100644 index 2e2350b9d16..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestion.html +++ /dev/null @@ -1,2700 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - This session seems to have a large number of responses. It is recommended to view the results one question/section at a time. To view responses for a particular question, click on the question below. To view response for a particular section, click the 'Edit View' button above and choose a section. -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Response to Dropout. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - 3 Response to Emily. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestionViewForHelperOne.html b/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestionViewForHelperOne.html deleted file mode 100644 index 0c4514e8dcc..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestionViewForHelperOne.html +++ /dev/null @@ -1,1023 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - This session seems to have a large number of responses. It is recommended to view the results one question/section at a time. To view responses for a particular question, click on the question below. To view response for a particular section, click the 'Edit View' button above and choose a section. -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestionViewForHelperTwo.html b/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestionViewForHelperTwo.html deleted file mode 100644 index aa2cfd94991..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAjaxByQuestionViewForHelperTwo.html +++ /dev/null @@ -1,2514 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - This session seems to have a large number of responses. It is recommended to view the results one question/section at a time. To view responses for a particular question, click on the question below. To view response for a particular section, click the 'Edit View' button above and choose a section. -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Response to Dropout. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsAjaxByRGQ.html b/src/test/resources/pages/instructorFeedbackResultsAjaxByRGQ.html deleted file mode 100644 index 6deb0445b7c..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAjaxByRGQ.html +++ /dev/null @@ -1,4256 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Comment to be edited by different instructor. -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Comment by Alice. -
                        -
                      • - -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Team 1</td></div>'" - -
                        -
                        - - To: Team 2 -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsAjaxByRQG.html b/src/test/resources/pages/instructorFeedbackResultsAjaxByRQG.html deleted file mode 100644 index a194130231c..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsAjaxByRQG.html +++ /dev/null @@ -1,5716 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Question > Giver -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Drop out - - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice self feedback. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - PowerSearch - - Comment by Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Team 1 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Danny to Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice to Danny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - Benny to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Response to Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - PowerSearch - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - Team 2 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - - Team 1</td></div>'" - - Response from team 1 (by alice) to team 2. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsDeleteComment.html b/src/test/resources/pages/instructorFeedbackResultsDeleteComment.html deleted file mode 100644 index c80fa9aa50b..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsDeleteComment.html +++ /dev/null @@ -1,916 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFRResponseCommentUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - - - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - To: - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - My comments on the class - -
                        -
                        -
                        -
                        - This is for nobody specific. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 1 -

                          -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 2 -

                          -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsDuplicateQuestionNumberPanel1.html b/src/test/resources/pages/instructorFeedbackResultsDuplicateQuestionNumberPanel1.html deleted file mode 100644 index fff1439da48..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsDuplicateQuestionNumberPanel1.html +++ /dev/null @@ -1,241 +0,0 @@ -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - Team 1</td></div>'" - - - - - - - - None - -
                        - - - - - -
                        - - -
                        - - Team 2 - - - - - - - - - No Response - - -
                        - - - - - -
                        -
                        - - Team 3 - - - - - - - - - No Response - - -
                        - - - - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsDuplicateQuestionNumberPanel2.html b/src/test/resources/pages/instructorFeedbackResultsDuplicateQuestionNumberPanel2.html deleted file mode 100644 index 53c1b6c7560..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsDuplicateQuestionNumberPanel2.html +++ /dev/null @@ -1,290 +0,0 @@ -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - Team 1</td></div>'" - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - 50 - -
                        - - - - - -
                        - - -
                        - - Team 1</td></div>'" - - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - - Team 1</td></div>'" - - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - - Team 1</td></div>'" - - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsEditComment.html b/src/test/resources/pages/instructorFeedbackResultsEditComment.html deleted file mode 100644 index e7fab7f9798..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsEditComment.html +++ /dev/null @@ -1,4757 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFRResponseCommentUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - - - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - To: - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - My comments on the class - -
                        -
                        -
                        -
                        - This is for nobody specific. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 1 -

                          -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 2 -

                          -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [IFRResponseCommentUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Comment to be edited by different instructor. -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [IFRResponseCommentUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] (last edited by Teammates Test at ${datetime.now} SGT) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - edited test comment -

                          -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [IFRResponseCommentUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - - - [IFRResponseCommentUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [IFRResponseCommentUiT.danny.e@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Team 1</td></div>'" - -
                        -
                        - - To: Team 2 -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsEditCommentByDifferentInstructor.html b/src/test/resources/pages/instructorFeedbackResultsEditCommentByDifferentInstructor.html deleted file mode 100644 index f5901173243..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsEditCommentByDifferentInstructor.html +++ /dev/null @@ -1,4761 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFRResponseCommentUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - - - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - To: - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - My comments on the class - -
                        -
                        -
                        -
                        - This is for nobody specific. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 1 -

                          -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - test comment 2 -

                          -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [IFRResponseCommentUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] (last edited by Teammates Test at ${datetime.now} SGT) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - Comment edited by different instructor -

                          -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [IFRResponseCommentUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [${datetime.now} SGT] (last edited by Teammates Test at ${datetime.now} SGT) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - edited test comment -

                          -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [IFRResponseCommentUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - - - [IFRResponseCommentUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [IFRResponseCommentUiT.danny.e@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Team 1</td></div>'" - -
                        -
                        - - To: Team 2 -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsFilteredByNoSection.html b/src/test/resources/pages/instructorFeedbackResultsFilteredByNoSection.html deleted file mode 100644 index 60da71fb582..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsFilteredByNoSection.html +++ /dev/null @@ -1,963 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - No specific section -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsFilteredBySectionA.html b/src/test/resources/pages/instructorFeedbackResultsFilteredBySectionA.html deleted file mode 100644 index a5c80f8bf83..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsFilteredBySectionA.html +++ /dev/null @@ -1,971 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Section A -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Show response if either the giver or evaluee is in the selected section -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsFilteredBySectionB.html b/src/test/resources/pages/instructorFeedbackResultsFilteredBySectionB.html deleted file mode 100644 index b122e7d43b2..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsFilteredBySectionB.html +++ /dev/null @@ -1,971 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Section B -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Show response if either the giver or evaluee is in the selected section -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageEmpty.html b/src/test/resources/pages/instructorFeedbackResultsPageEmpty.html deleted file mode 100644 index 40debfdced9..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageEmpty.html +++ /dev/null @@ -1,235 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Third Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        - -
                        - There are no responses for this feedback session yet or you do not have access to the responses collected so far. -
                        -
                        - -
                        -
                        - -
                        - - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        - All students have responded to some questions in this session. -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageGQRWithSanitizedData.html b/src/test/resources/pages/instructorFeedbackResultsPageGQRWithSanitizedData.html deleted file mode 100644 index 25432229c58..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageGQRWithSanitizedData.html +++ /dev/null @@ -1,887 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.SanitizedTeam -

                        -
                        -
                        -
                        - -
                        -

                        - Sanitized Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - Section A</td></div>'" - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team '1</td></div>'" - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alic'e Bets'y</td></div>'" (Team '1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benn'y Charle's (Team '1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alic'e Bets'y</td></div>'" (Team '1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Some question text. Testing quotation marks '" Testing unclosed tags </td></div> Testing script injection <script> alert('hello'); </script> - -
                        -
                        -
                        -
                        -

                        - Some response to text question. -

                        - - a link - - attempted script injection -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Instructor<script> alert('hi!'); </script> [Mon, 02 Mar 2026, 07:59 AM SGT] (last edited by Instructor<script> alert('hi!'); </script> at Tue, 03 Mar 2026, 07:59 AM SGT) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - Some comment from instructor -

                          - - a link - - attempted script injection -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benn'y Charle's (Team '1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageMcqQuestionViewWithWeightsAttached.html b/src/test/resources/pages/instructorFeedbackResultsPageMcqQuestionViewWithWeightsAttached.html deleted file mode 100644 index 5efe97d12e1..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageMcqQuestionViewWithWeightsAttached.html +++ /dev/null @@ -1,1203 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FMcqQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - MCQ Weight Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Fri, 30 Apr 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Sat, 01 May 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Question without weights attached!  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Question with weights attached!  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - It's good - - 1.5 - - 1 - - 33.33 - - 20 -
                        - It's perfect - - 3 - - 2 - - 66.67 - - 80 -
                        - Other - - 3 - - 0 - - 0 - - 0 -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team - - -

                        -
                        -

                        - Recipient Name - - -

                        -
                        -

                        - It's good [1.5] - - -

                        -
                        -

                        - It's perfect [3] - - -

                        -
                        -

                        - Other [3] - - -

                        -
                        -

                        - Total - - -

                        -
                        -

                        - Average - - -

                        -
                        - Team 1 - - student2 - - 1 - - 0 - - 0 - - 1.50 - - 1.50 -
                        - Team 1 - - student3 - - 0 - - 1 - - 0 - - 3.00 - - 3.00 -
                        - Team 1 - - student4 - - 0 - - 1 - - 0 - - 3.00 - - 3.00 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - Team 1 - -
                        - student1 - -
                        -
                        - Team 1 - -
                        - student2 - -
                        -
                        - It's good - - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - student2 - -
                        -
                        - Team 1 - -
                        - student3 - -
                        -
                        - It's perfect - - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - student3 - -
                        -
                        - Team 1 - -
                        - student4 - -
                        -
                        - It's perfect - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageMcqQuestionViewWithoutWeightsAttached.html b/src/test/resources/pages/instructorFeedbackResultsPageMcqQuestionViewWithoutWeightsAttached.html deleted file mode 100644 index 2d946ce71bc..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageMcqQuestionViewWithoutWeightsAttached.html +++ /dev/null @@ -1,1071 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FMcqQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - MCQ Weight Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Fri, 30 Apr 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Sat, 01 May 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Question without weights attached!  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Content - - - - - 2 - - 66.67 - - - -
                        - Teaching style - - - - - 0 - - 0 - - - -
                        - Other - - - - - 1 - - 33.33 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - Team 1 - -
                        - student1 - -
                        -
                        - Team 1 - -
                        - student1 - -
                        -
                        - Lecture notes - - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - student1 - -
                        -
                        - Team 1 - -
                        - student2 - -
                        -
                        - Content - - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - student2 - -
                        -
                        - Team 1 - -
                        - student3 - -
                        -
                        - Content - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Question with weights attached!  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageMsqQuestionViewWithWeightsAttached.html b/src/test/resources/pages/instructorFeedbackResultsPageMsqQuestionViewWithWeightsAttached.html deleted file mode 100644 index dced4a10eb1..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageMsqQuestionViewWithWeightsAttached.html +++ /dev/null @@ -1,1314 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FSQTT.idOfTypicalCourse1 -

                        -
                        -
                        -
                        - -
                        -

                        - MSQ Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Fri, 30 Apr 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Sat, 01 May 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What do you like best about the class' product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Choose all the food you like  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Pizza - - 1 - - 1 - - 16.67 - - 9.09 -
                        - Pasta - - 2 - - 2 - - 33.33 - - 36.36 -
                        - Chicken rice - - 0 - - 1 - - 16.67 - - 0 -
                        - Other - - 3 - - 2 - - 33.33 - - 54.55 -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - '"'"'"'" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team - - -

                        -
                        -

                        - Recipient Name - - -

                        -
                        -

                        - Pizza [1] - - -

                        -
                        -

                        - Pasta [2] - - -

                        -
                        -

                        - Chicken rice [0] - - -

                        -
                        -

                        - Other [3] - - -

                        -
                        -

                        - Total - - -

                        -
                        -

                        - Average - - -

                        -
                        - Team 1.1 - - student1 In Course1 - - 1 - - 1 - - 1 - - 1 - - 6.00 - - 1.50 -
                        - Team 1.1 - - student2 In Course1 - - 0 - - 1 - - 0 - - 0 - - 2.00 - - 2.00 -
                        - Team 1.1 - - student3 In Course1 - - 0 - - 0 - - 0 - - 1 - - 3.00 - - 3.00 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1.1</td></div>'" - -
                        - student1 In Course1</td></div>'" - -
                        -
                        - Team 1.1</td></div>'" - -
                        - student1 In Course1</td></div>'" - -
                        -
                        -
                          -
                        • - Pizza -
                        • -
                        • - Pasta -
                        • -
                        • - Chicken rice -
                        • -
                        • - Hotdog -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1.1</td></div>'" - -
                        - student2 In Course1 - -
                        -
                        - Team 1.1</td></div>'" - -
                        - student2 In Course1 - -
                        -
                        -
                          -
                        • - Pasta -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1.1</td></div>'" - -
                        - student3 In Course1 - -
                        -
                        - Team 1.1</td></div>'" - -
                        - student3 In Course1 - -
                        -
                        -
                          -
                        • - Hotdog -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageMsqQuestionViewWithoutWeightsAttached.html b/src/test/resources/pages/instructorFeedbackResultsPageMsqQuestionViewWithoutWeightsAttached.html deleted file mode 100644 index dd3c1d153d1..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageMsqQuestionViewWithoutWeightsAttached.html +++ /dev/null @@ -1,1120 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FSQTT.idOfTypicalCourse1 -

                        -
                        -
                        -
                        - -
                        -

                        - MSQ Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Fri, 30 Apr 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Sat, 01 May 2027, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - It's good - - - - - 2 - - 66.67 - - - -
                        - It's perfect - - - - - 1 - - 33.33 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1.1</td></div>'" - -
                        - student1 In Course1</td></div>'" - -
                        -
                        - Team 1.1</td></div>'" - -
                        - student1 In Course1</td></div>'" - -
                        -
                        -
                          -
                        • - It's good -
                        • -
                        • - It's perfect -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1.1</td></div>'" - -
                        - student2 In Course1 - -
                        -
                        - Team 1.1</td></div>'" - -
                        - student2 In Course1 - -
                        -
                        -
                          -
                        • - It's good -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1.1</td></div>'" - -
                        - student3 In Course1 - -
                        -
                        - Team 1.1</td></div>'" - -
                        - student3 In Course1 - -
                        -
                        - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What do you like best about the class' product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Choose all the food you like  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageOpen.html b/src/test/resources/pages/instructorFeedbackResultsPageOpen.html deleted file mode 100644 index d400b455dd2..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageOpen.html +++ /dev/null @@ -1,7032 +0,0 @@ - - - - Session Results [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Response to Dropout. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - 3 Response to Emily. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Alice self feedback. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Instructors - -
                        - Teammates Test - -
                        -
                        - - - - - - - This is for nobody specific. - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - Team 1</td></div>'" - - - Team 2 - - Response from team 1 (by alice) to team 2. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 2 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - PowerSearch - - Comment by Alice. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - PowerSearch - - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 50 - - - -
                        - GoodUI - - - - - 1 - - 50 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Danny - - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1 - - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - - No Response - - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Alice to Danny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Danny to Alice. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Benny to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Name - - - - Actions -
                        - - Instructors - - - Teammates Helper1 - -
                        - - Instructors - - - Teammates Helper2 - -
                        - - Instructors - - - Teammates Test2 - -
                        - Team 2 - - Extra guy - -
                        - - - - -
                        -
                        - Team 3 - - Emily - -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - - diff --git a/src/test/resources/pages/instructorFeedbackResultsPageOpenViewForHelperOne.html b/src/test/resources/pages/instructorFeedbackResultsPageOpenViewForHelperOne.html deleted file mode 100644 index a8e8bf2b4b9..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageOpenViewForHelperOne.html +++ /dev/null @@ -1,817 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        - -
                        - There are no responses for this feedback session yet or you do not have access to the responses collected so far. -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageOpenViewForHelperTwo.html b/src/test/resources/pages/instructorFeedbackResultsPageOpenViewForHelperTwo.html deleted file mode 100644 index 9bdc9857469..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageOpenViewForHelperTwo.html +++ /dev/null @@ -1,2507 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Response to Dropout. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRankGQRView.html b/src/test/resources/pages/instructorFeedbackResultsPageRankGQRView.html deleted file mode 100644 index fdc38fb54e4..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRankGQRView.html +++ /dev/null @@ -1,539 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Instructor Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Question > Recipient -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section 1 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - There are no responses for this section yet or you do not have access to the responses collected so far. -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section 2 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRankGRQView.html b/src/test/resources/pages/instructorFeedbackResultsPageRankGRQView.html deleted file mode 100644 index 127e33b29c6..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRankGRQView.html +++ /dev/null @@ -1,539 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Instructor Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section 1 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - There are no responses for this section yet or you do not have access to the responses collected so far. -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section 2 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRankQuestionView.html b/src/test/resources/pages/instructorFeedbackResultsPageRankQuestionView.html deleted file mode 100644 index 3a27f5109c6..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRankQuestionView.html +++ /dev/null @@ -1,1407 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Instructor Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As an instructor, rank for every team, the areas of improve that they should work on  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Instructors - -
                        - Teammates Test - -
                        -
                        - - Team 1</option><option value="dump"></td><td>'" - -
                          -
                        • - 1: Time management -
                        • -
                        • - 2: Quality Control -
                        • -
                        • - 3: Teamwork -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As an instructor, rank for the 4 students you are mentoring, their areas of their reports that were good.   - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As instructor, among the 2 reports you have reviewed, rank them  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As an instructor, rank the teams. You are allowed to give the same rank multiple times.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a student, rank every instructors on their feedback provided. Give the quality that the instructor should improve on most rank 1. You can give the same rank multiple times  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a student, rank the instructors  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank you and your team members  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank your team members  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank up to 7 students in the course  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank the other teams, you can give the same rank multiple times.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a student, rank the areas of improvement you think you should make progress on.   - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRankRGQView.html b/src/test/resources/pages/instructorFeedbackResultsPageRankRGQView.html deleted file mode 100644 index 7ee6d5a4a0e..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRankRGQView.html +++ /dev/null @@ -1,1302 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Instructor Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - Section 1 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - - - - [alice.b.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - As an instructor, rank for the 4 students you are mentoring, their areas of their reports that were good.   - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - 1: ; -
                        • -
                        • - 2: Organisation -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 3: - - As instructor, among the 2 reports you have reviewed, rank them  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 1</option><option value="dump"></td><td>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - To: Team 1</option><option value="dump"></td><td>'" -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - As an instructor, rank for every team, the areas of improve that they should work on  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - 1: Time management -
                        • -
                        • - 2: Quality Control -
                        • -
                        • - 3: Teamwork -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [danny.e.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - As instructor, among the 2 reports you have reviewed, rank them  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</option><option value="dump"></td><td>'") - - - - [benny.c.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Davis (Team 2) - - - - [charlie.d.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section 2 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRankRQGView.html b/src/test/resources/pages/instructorFeedbackResultsPageRankRQGView.html deleted file mode 100644 index 765aaddabab..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRankRQGView.html +++ /dev/null @@ -1,1794 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Instructor Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Question > Giver -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - Section 1 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</option></td></div>'" - - - - [alice.b.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - As an instructor, rank for the 4 students you are mentoring, their areas of their reports that were good.   - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Instructors - - Teammates Test - -
                          -
                        • - 1: ; -
                        • -
                        • - 2: Organisation -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - As instructor, among the 2 reports you have reviewed, rank them  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Instructors - - Teammates Test - - 1 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 1</option><option value="dump"></td><td>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - As an instructor, rank for every team, the areas of improve that they should work on  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Instructors - - Teammates Test - -
                          -
                        • - 1: Time management -
                        • -
                        • - 2: Quality Control -
                        • -
                        • - 3: Teamwork -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid - - - - [danny.e.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - As instructor, among the 2 reports you have reviewed, rank them  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Instructors - - Teammates Test - - 2 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles - - - - [benny.c.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Davis - - - - [charlie.d.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section 2 - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRankRecipient.html b/src/test/resources/pages/instructorFeedbackResultsPageRankRecipient.html deleted file mode 100644 index aeb29605edf..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRankRecipient.html +++ /dev/null @@ -1,2828 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Student Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a student, rank every instructors on their feedback provided. Give the quality that the instructor should improve on most rank 1. You can give the same rank multiple times  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a student, rank the instructors  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank you and your team members, own team members can see the responses but not recipient name  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Ranks Received - - - - Self Rank - - - - Overall Rank - - - - Overall Rank Excluding Self - - -
                        - Team 2 - - Danny Engrid - - 1 - - - - - 1 - - 1 -
                        - Team 1</option><option value="dump"></td><td>'" - - Benny Charles - - 1 , 1 - - 1 - - 1 - - 1 -
                        - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - 2 , 2 - - 2 - - 4 - - 1 -
                        - Team 2 - - Charlie Davis - - 1 , 2 - - 2 - - 3 - - 1 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - 1 - -
                        - - - - - -
                        - - -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - 2 - -
                        - - - - - -
                        - - -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - 1 - -
                        - - - - - -
                        - - -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - 2 - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Charlie Davis - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - 2 - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Charlie Davis - -
                        -
                        - Team 2 - -
                        - Charlie Davis - -
                        -
                        - 3 - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Charlie Davis - -
                        -
                        - 2 - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 3 - -
                        - Emily F. - -
                        -
                        - Team 3 - -
                        - Emily F. - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank your team members  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank up to 7 students in the course. All students can see the responses, but not the giver's name.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank the other teams, you can give the same rank multiple times.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a student, rank the areas of improvement you think you should make progress on.   - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As an instructor, rank for the 4 students you are mentoring, their areas of their reports that were good.   - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank atleast 2 options based on impact they cause on your activities.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank at most 2 options based on impact they cause on your activities.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank exactly 3 options based on popularity.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank atleast 2 recipients based on popularity.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank atmost 2 recipients based on popularity.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank exactly 3 recipients based on popularity.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rank other teams  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRankSubmission.html b/src/test/resources/pages/instructorFeedbackResultsPageRankSubmission.html deleted file mode 100644 index 54c73444841..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRankSubmission.html +++ /dev/null @@ -1,4275 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Instructor Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - For instructors to submit and view results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - As an instructor, rank for every team, the areas of improve that they should work on - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - As an instructor, rank for the 4 students you are mentoring, their areas of their reports that were good. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - As instructor, among the 2 reports you have reviewed, rank them - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - As an instructor, rank the teams. You are allowed to give the same rank multiple times. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRubricGQRView.html b/src/test/resources/pages/instructorFeedbackResultsPageRubricGQRView.html deleted file mode 100644 index 7f237f769f8..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRubricGQRView.html +++ /dev/null @@ -1,2332 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Question > Recipient -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</option></td></div>'" - - - - [alice.b.tmms@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - a) No - - - (Choice 2) - - -
                        - b) - - - No Response - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Benny Charles - - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles - - - - [benny.c.tmms@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - a) Yes - - - (Choice 1) - - -
                        - b) No - - - (Choice 2) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Benny Charles - - a) Yes - - - (Choice 1) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Colin Daniels - - - - [colin.d.tmms@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 2</option><option value="dump"></td><td>'" - - Colin Daniels - - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRubricGRQView.html b/src/test/resources/pages/instructorFeedbackResultsPageRubricGRQView.html deleted file mode 100644 index e6620231b3f..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRubricGRQView.html +++ /dev/null @@ -1,1346 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - - - - [alice.b.tmms@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) - - - No Response - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</option><option value="dump"></td><td>'") - - - - [benny.c.tmms@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) No - - - (Choice 2) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Colin Daniels (Team 2</option><option value="dump"></td><td>'") - - - - [colin.d.tmms@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Colin Daniels (Team 2</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - From: -
                        - Colin Daniels (Team 2</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRubricQuestionView.html b/src/test/resources/pages/instructorFeedbackResultsPageRubricQuestionView.html deleted file mode 100644 index 2bdad5ae894..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRubricQuestionView.html +++ /dev/null @@ -1,1660 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) - - - No Response - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) No - - - (Choice 2) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 2</option><option value="dump"></td><td>'" - -
                        - Colin Daniels - -
                        -
                        - Team 2</option><option value="dump"></td><td>'" - -
                        - Colin Daniels - -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRubricQuestionViewWithoutWeightsAttached.html b/src/test/resources/pages/instructorFeedbackResultsPageRubricQuestionViewWithoutWeightsAttached.html deleted file mode 100644 index ad85e06457f..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRubricQuestionViewWithoutWeightsAttached.html +++ /dev/null @@ -1,874 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Third Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - a) You have done a good job. -

                        -
                        - 50% (1) - - 50% (1) -
                        -

                        - b) You have tried your best. -

                        -
                        - 100% (2) - - 0% (0) -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Alice Betsy</option></td></div>'" - -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</option><option value="dump"></td><td>'" - -
                        - Benny Charles - -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRubricRGQView.html b/src/test/resources/pages/instructorFeedbackResultsPageRubricRGQView.html deleted file mode 100644 index 9ba0ec6e156..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRubricRGQView.html +++ /dev/null @@ -1,1368 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - - - - [alice.b.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) - - - No Response - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) No - - - (Choice 2) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</option><option value="dump"></td><td>'") - - - - [benny.c.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</option></td></div>'" (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Colin Daniels (Team 2</option><option value="dump"></td><td>'") - - - - [colin.d.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Colin Daniels (Team 2</option><option value="dump"></td><td>'") - - -
                        -
                        -
                        - - To: -
                        - Colin Daniels (Team 2</option><option value="dump"></td><td>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageRubricRQGView.html b/src/test/resources/pages/instructorFeedbackResultsPageRubricRQGView.html deleted file mode 100644 index bc15f1587a8..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageRubricRQGView.html +++ /dev/null @@ -1,2201 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST    - - to - -    Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Question > Giver -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</option></td></div>'" - - - - [alice.b.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - a) No - - - (Choice 2) - - -
                        - b) - - - No Response - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Benny Charles - - a) Yes - - - (Choice 1) - - -
                        - b) No - - - (Choice 2) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles - - - - [benny.c.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        - - - Team 1</option><option value="dump"></td><td>'" - - Benny Charles - - a) Yes - - - (Choice 1) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Colin Daniels - - - - [colin.d.tmms@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 2</option><option value="dump"></td><td>'" - - Colin Daniels - - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsPageWithSanitizedData.html b/src/test/resources/pages/instructorFeedbackResultsPageWithSanitizedData.html deleted file mode 100644 index bc46e90c612..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsPageWithSanitizedData.html +++ /dev/null @@ -1,962 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.SanitizedTeam -

                        -
                        -
                        -
                        - -
                        -

                        - Sanitized Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Some question text. Testing quotation marks '" Testing unclosed tags </td></div> Testing script injection <script> alert('hello'); </script> - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team '1</td></div>'" - -
                        - Alic'e Bets'y</td></div>'" - -
                        -
                        - Team '1</td></div>'" - -
                        - Benn'y Charle's - -
                        -
                        -

                        - Some response to text question. -

                        - - a link - - attempted script injection -
                        -
                        - - - - - -
                        - - -
                        - Team '1</td></div>'" - -
                        - Alic'e Bets'y</td></div>'" - -
                        -
                        - Team '1</td></div>'" - -
                        - Alic'e Bets'y</td></div>'" - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team '1</td></div>'" - -
                        - Benn'y Charle's - -
                        -
                        - Team '1</td></div>'" - -
                        - Alic'e Bets'y</td></div>'" - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team '1</td></div>'" - -
                        - Benn'y Charle's - -
                        -
                        - Team '1</td></div>'" - -
                        - Benn'y Charle's - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortGiverQuestionRecipient.html b/src/test/resources/pages/instructorFeedbackResultsSortGiverQuestionRecipient.html deleted file mode 100644 index 293a72db885..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortGiverQuestionRecipient.html +++ /dev/null @@ -1,5981 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Question > Recipient -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice self feedback. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - PowerSearch - - Comment by Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 50 - - - -
                        - GoodUI - - - - - 1 - - 50 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Team 1 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Alice to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Charlie Dávis - - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Charlie Dávis - - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny to Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - Team 2 - - Response from team 1 (by alice) to team 2. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 3 - - Emily - - 3 Response to Emily. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Benny to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - PowerSearch - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 2 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - Team 2 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortGiverQuestionRecipientTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortGiverQuestionRecipientTeam.html deleted file mode 100644 index 3506c8c208c..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortGiverQuestionRecipientTeam.html +++ /dev/null @@ -1,6860 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Question > Recipient -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Statistics for Given Responses -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 50 - - - -
                        - GoodUI - - - - - 1 - - 50 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Detailed Responses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice self feedback. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - PowerSearch - - Comment by Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 50 - - - -
                        - GoodUI - - - - - 1 - - 50 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Team 1 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Alice to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Charlie Dávis - - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Charlie Dávis - - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny to Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - Team 2 - - Response from team 1 (by alice) to team 2. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -

                        - Team 2 Statistics for Given Responses -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 2 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team 2 Detailed Responses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 3 - - Emily - - 3 Response to Emily. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Benny to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - PowerSearch - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 2 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - Team 2 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortGiverRecipientQuestion.html b/src/test/resources/pages/instructorFeedbackResultsSortGiverRecipientQuestion.html deleted file mode 100644 index a7245385f48..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortGiverRecipientQuestion.html +++ /dev/null @@ -1,4352 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Comment to be edited by different instructor. -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Comment by Alice. -
                        -
                      • - -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Team 2 - -
                        -
                        - - From: Team 1</td></div>'" -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Emily (Team 3) - - -
                        -
                        -
                        - - From: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 3 Response to Emily. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortGiverRecipientQuestionTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortGiverRecipientQuestionTeam.html deleted file mode 100644 index fa6a9940e96..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortGiverRecipientQuestionTeam.html +++ /dev/null @@ -1,4394 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Comment to be edited by different instructor. -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Comment by Alice. -
                        -
                      • - -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Team 2 - -
                        -
                        - - From: Team 1</td></div>'" -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Emily (Team 3) - - -
                        -
                        -
                        - - From: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 3 Response to Emily. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortQuestionTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortQuestionTeam.html deleted file mode 100644 index cd7dac6b3f3..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortQuestionTeam.html +++ /dev/null @@ -1,2693 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Response to Dropout. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - 3 Response to Emily. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - My comments on the class - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your team mates - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This question should be hidden. - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortRecipientGiverQuestion.html b/src/test/resources/pages/instructorFeedbackResultsSortRecipientGiverQuestion.html deleted file mode 100644 index b2adacc5d73..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortRecipientGiverQuestion.html +++ /dev/null @@ -1,4256 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Comment to be edited by different instructor. -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Comment by Alice. -
                        -
                      • - -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Team 1</td></div>'" - -
                        -
                        - - To: Team 2 -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortRecipientGiverQuestionTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortRecipientGiverQuestionTeam.html deleted file mode 100644 index d6515bb6c0f..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortRecipientGiverQuestionTeam.html +++ /dev/null @@ -1,4298 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        - Alice self feedback. -
                        - -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 07:59 AM SGT] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Comment to be edited by different instructor. -
                          - -
                        • - -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Comment by Alice. -
                        -
                      • - -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Danny -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 1 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Alice from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Danny to Alice. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 2 Response to Benny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Benny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Alice to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Fred Gabriel (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        - Benny to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 4 Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Fred's Response to Charlie. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - 1 Response to Danny. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Danny from Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        - Response to Dropout. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - -
                        -
                        -
                        - - To: -
                        - Drop out (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - PowerSearch -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Team 2 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Team 1</td></div>'" - -
                        -
                        - - To: Team 2 -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        - Response from team 1 (by alice) to team 2. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortRecipientQuestionGiver.html b/src/test/resources/pages/instructorFeedbackResultsSortRecipientQuestionGiver.html deleted file mode 100644 index 0a0657e20f6..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortRecipientQuestionGiver.html +++ /dev/null @@ -1,5716 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Question > Giver -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Drop out - - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice self feedback. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - PowerSearch - - Comment by Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 50 - - - -
                        - GoodUI - - - - - 1 - - 50 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Team 1 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Danny to Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice to Danny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - Benny to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Response to Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - PowerSearch - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 2 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - Team 2 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - - Team 1</td></div>'" - - Response from team 1 (by alice) to team 2. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortRecipientQuestionGiverTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortRecipientQuestionGiverTeam.html deleted file mode 100644 index b4d19552fe0..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortRecipientQuestionGiverTeam.html +++ /dev/null @@ -1,6595 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Tue, 01 May 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Question > Giver -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Statistics for Received Responses -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 50 - - - -
                        - GoodUI - - - - - 1 - - 50 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Detailed Responses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 2 - - Drop out - - Response to Alice from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - What is the best selling point of your product? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice self feedback. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - PowerSearch - - Comment by Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 50 - - - -
                        - GoodUI - - - - - 1 - - 50 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - PowerSearch -
                        • -
                        • - GoodUI -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Who do you think is the most hardworking student?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Danny - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Team 1 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Danny to Alice. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 2 Response to Benny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Benny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - This is a dummy question to test default sort - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Alice to Danny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - Benny to Danny. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -

                        - Team 2 Statistics for Received Responses -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 2 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team 2 Detailed Responses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 4 Response to Charlie. - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - Fred's Response to Charlie. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Benny Charles - - 1 Response to Danny. - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Drop out - - Response to Danny from Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Rate 3 other students' products - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - Response to Dropout. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - What is your extra feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - FlexiCommand - - - - - 0 - - 0 - - - -
                        - PowerSearch - - - - - 1 - - 100 - - - -
                        - GoodUI - - - - - 0 - - 0 - - - -
                        - Google Integration - - - - - 0 - - 0 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - PowerSearch - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Which team do you think has the best feature?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 2 - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Comments - - Actions -
                        - - - Team 2 - - Drop out - - Team 2 - - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 2 - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Give feedback to 3 other teams. - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - - Team 1</td></div>'" - - Response from team 1 (by alice) to team 2. - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionFilteredBySectionATeam.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionFilteredBySectionATeam.html deleted file mode 100644 index f29b9fd2106..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionFilteredBySectionATeam.html +++ /dev/null @@ -1,7229 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Section A -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Show response if either the giver or evaluee is in the selected section -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your instructors - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - Instructors - -
                        - Teammates Test - -
                        -
                        - You are a great instructor. - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        -
                          -
                        • - Danny -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - - 3.5 - - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - 3.5 - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Option - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Fun - - 55 - - 55 - - 55 -
                        - Grades - - 45 - - 45 - - 45 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - - 110 - - 110 -
                        - Team 1</td></div>'" - - Benny Charles - - 90 - - 90 - - 90 -
                        - Team 2 - - Charlie Dávis - - 50 - - 50 - - 50 -
                        - Team 2 - - Danny Engrid - - 150 - - 150 - - 150 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - 110 - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - 90 - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - 50 - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - 150 - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Student - - - - CC - - - - PC - - - - Diff - - - - Ratings Received -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - - E +11% - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - -
                        - Team 1</td></div>'" - - Benny Charles - - - N/A - - - - E - - - - N/A - - - - E - - , - - N/A - -
                        - Team 1</td></div>'" - - Fred Gabriel - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - -
                        - Team 2 - - Charlie Dávis - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        - Team 2 - - Danny Engrid - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        - Team 2 - - Drop out - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        - Team 2 - - Extra guy - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - Equal Share - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -   [Perceived Contribution: - - Equal Share - - ] - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -   [Perceived Contribution: - - N/A - - ] - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - 3 - -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - 4 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the class  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - -0.5 - - -0.5 - - -0.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - - - - - - -0.5 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Student - - - - CC - - - - PC - - - - Diff - - - - Ratings Received -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - E +11% - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - - - E - - - - N/A - - - - E - - , - - N/A - -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - - - N/A - - - - N/A - - - - N/A - - , - - N/A - - , - - N/A - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - Equal Share - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - Team 1</td></div>'" - - - Team 1</td></div>'" - - Response from benny to Team 1 (own team) - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the class as a team  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - 0 - - 0 - - 0 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - Team 1</td></div>'" - - - - - - - - 0 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipient.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipient.html deleted file mode 100644 index fb0a41df351..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipient.html +++ /dev/null @@ -1,4226 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Question > Recipient -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Danny -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - - 3.5 - - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Option - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Fun - - 55 - - 55 - - 55 -
                        - Grades - - 45 - - 45 - - 45 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - - 110 - - 110 -
                        - Team 1</td></div>'" - - Benny Charles - - 90 - - 90 - - 90 -
                        - Team 2 - - Charlie Dávis - - 50 - - 50 - - 50 -
                        - Team 2 - - Danny Engrid - - 150 - - 150 - - 150 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - 90 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Charlie Dávis - - 50 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - 150 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Benny Charles - - - Equal Share - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - 3 - -
                        - - - - - -
                        - - -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - 4 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - Equal Share - - -
                        - - - - - -
                        -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - Team 1</td></div>'" - - Response from benny to Team 1 (own team) - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 12: - - Rate the class as a team  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - 0 - - 0 - - 0 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - - - - - - 0 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Give feedback to your instructors - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Instructors - - Teammates Test - - You are a great instructor. - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Rate the class  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - -0.5 - - -0.5 - - -0.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - - - - - - -0.5 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: - -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipientTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipientTeam.html deleted file mode 100644 index 7c8a7770273..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverQuestionRecipientTeam.html +++ /dev/null @@ -1,5032 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Question > Recipient -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Statistics for Given Responses -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - - 3.5 - - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Option - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Fun - - 55 - - 55 - - 55 -
                        - Grades - - 45 - - 45 - - 45 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - - 110 - - 110 -
                        - Team 1</td></div>'" - - Benny Charles - - 90 - - 90 - - 90 -
                        - Team 2 - - Charlie Dávis - - 50 - - 50 - - 50 -
                        - Team 2 - - Danny Engrid - - 150 - - 150 - - 150 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the class as a team  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - 0 - - 0 - - 0 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Detailed Responses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Danny -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - - 3.5 - - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Option - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Fun - - 55 - - 55 - - 55 -
                        - Grades - - 45 - - 45 - - 45 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - - 110 - - 110 -
                        - Team 1</td></div>'" - - Benny Charles - - 90 - - 90 - - 90 -
                        - Team 2 - - Charlie Dávis - - 50 - - 50 - - 50 -
                        - Team 2 - - Danny Engrid - - 150 - - 150 - - 150 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - 90 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Charlie Dávis - - 50 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Danny Engrid - - 150 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Benny Charles - - - Equal Share - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - 3 - -
                        - - - - - -
                        - - -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - 4 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - Equal Share - - -
                        - - - - - -
                        -
                        - - - Anonymous student ${participant.hash}'s Team - - Anonymous student ${participant.hash} - - - N/A - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - Team 1</td></div>'" - - Response from benny to Team 1 (own team) - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 12: - - Rate the class as a team  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - 0 - - 0 - - 0 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - - - - - - 0 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: - - Give feedback to your instructors - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - Instructors - - Teammates Test - - You are a great instructor. - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 9: - - Rate the class  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - -0.5 - - -0.5 - - -0.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - - - - - - - - - -0.5 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: - -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestion.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestion.html deleted file mode 100644 index fcd64a8606d..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestion.html +++ /dev/null @@ -1,2872 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Danny -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3.5 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 110 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 90 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 50 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 150 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Anonymous student ${participant.hash} - -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - N/A - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Anonymous student ${participant.hash} - -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 4 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - - - -
                        -
                        - - From: Team 1</td></div>'" -
                        -
                        -
                        -
                        -
                        - Question 12: - - Rate the class as a team  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 0 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Team 1</td></div>'" - -
                        -
                        - - From: Team 1</td></div>'" -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        - Response from benny to Team 1 (own team) -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - - - -
                        -
                        - - From: Anonymous student ${participant.hash} -
                        -
                        -
                        -
                        -
                        - Question 9: - - Rate the class  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -0.5 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - From: Anonymous student ${participant.hash} -
                        -
                        -
                        -
                        -
                        - Question 1: - - Give feedback to your instructors - -
                        -
                        -
                        -
                        - You are a great instructor. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestionTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestionTeam.html deleted file mode 100644 index 182c3cc1b02..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionGiverRecipientQuestionTeam.html +++ /dev/null @@ -1,2956 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Giver > Recipient > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Danny -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3.5 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 110 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 90 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 50 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 150 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Anonymous student ${participant.hash} - -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - N/A - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Anonymous student ${participant.hash} - -
                        -
                        - - From: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 4 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Team 1</td></div>'" - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - - - -
                        -
                        - - From: Team 1</td></div>'" -
                        -
                        -
                        -
                        -
                        - Question 12: - - Rate the class as a team  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 0 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Team 1</td></div>'" - -
                        -
                        - - From: Team 1</td></div>'" -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        - Response from benny to Team 1 (own team) -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - - - -
                        -
                        - - From: Anonymous student ${participant.hash} -
                        -
                        -
                        -
                        -
                        - Question 9: - - Rate the class  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -0.5 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Teammates Test (Instructors) - - -
                        -
                        -
                        - - From: Anonymous student ${participant.hash} -
                        -
                        -
                        -
                        -
                        - Question 1: - - Give feedback to your instructors - -
                        -
                        -
                        -
                        - You are a great instructor. -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -
                        - - - - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses given by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionQuestionTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionQuestionTeam.html deleted file mode 100644 index 0ef353e978b..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionQuestionTeam.html +++ /dev/null @@ -1,1622 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Give feedback to your instructors - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        - Team 1</td></div>'" - -
                        - Alice Betsy</td>'" - -
                        -
                        -
                          -
                        • - Danny -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - Team 1</td></div>'" - -
                        - Benny Charles - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - Team 1</td></div>'" - -
                        - Fred Gabriel - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - Team 2 - -
                        - Charlie Dávis - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - Team 2 - -
                        - Danny Engrid - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - Team 2 - -
                        - Drop out - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - Team 2 - -
                        - Extra guy - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - Team 3 - -
                        - Emily - -
                        -
                        - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the class  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate the class as a team  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - There are no responses for this question or you may not have the permission to see the response - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestion.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestion.html deleted file mode 100644 index 582964fb30e..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestion.html +++ /dev/null @@ -1,2503 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Danny -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3.5 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 110 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 90 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Team 1</td></div>'" - -
                        -
                        - - To: Team 1</td></div>'" -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        - Response from benny to Team 1 (own team) -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 50 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 150 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: Anonymous student ${participant.hash} -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - N/A - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: Anonymous student ${participant.hash} -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 4 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestionTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestionTeam.html deleted file mode 100644 index b55db98703f..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientGiverQuestionTeam.html +++ /dev/null @@ -1,2587 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Giver > Question -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Alice Betsy</td>'" (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Danny -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3.5 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 110 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles (Team 1</td></div>'") - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Benny Charles (Team 1</td></div>'") - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 90 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Team 1</td></div>'" - -
                        -
                        - - To: Team 1</td></div>'" -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        - Response from benny to Team 1 (own team) -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel (Team 1</td></div>'") - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis (Team 2) - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Charlie Dávis (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 50 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Danny Engrid (Team 2) - - - - [CFResultsUiT.danny.e@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: -
                        - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 150 -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out (Team 2) - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy (Team 2) - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: Anonymous student ${participant.hash} -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - N/A - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: -
                        - - Alice Betsy</td>'" (Team 1</td></div>'") - - -
                        -
                        -
                        - - To: Anonymous student ${participant.hash} -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 4 -
                        - -
                        - -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiver.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiver.html deleted file mode 100644 index ade8f434c42..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiver.html +++ /dev/null @@ -1,4399 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Question > Giver -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Danny -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - - 3.5 - - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Option - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Fun - - 55 - - 55 - - 55 -
                        - Grades - - 45 - - 45 - - 45 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - - 110 - - 110 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Benny Charles - - 90 - - 90 - - 90 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 90 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -   [Perceived Contribution: - - Equal Share - - ] - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - - Team 1</td></div>'" - - Response from benny to Team 1 (own team) - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 2 - - Charlie Dávis - - 50 - - 50 - - 50 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 50 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Charlie Dávis - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Danny Engrid - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Drop out - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Extra guy - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 2 - - Danny Engrid - - 150 - - 150 - - 150 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 150 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Charlie Dávis - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Danny Engrid - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Drop out - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Extra guy - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - N/A - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 4 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Students - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiverTeam.html b/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiverTeam.html deleted file mode 100644 index d9467407a96..00000000000 --- a/src/test/resources/pages/instructorFeedbackResultsSortSecondSessionRecipientQuestionGiverTeam.html +++ /dev/null @@ -1,5195 +0,0 @@ -
                        -
                        -
                        -

                        - Session Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session - - - - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT    - - to - -    Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Non-English characters not displayed properly in the downloaded file? - - Click here. - - -
                        -
                        -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - Group by - Recipient > Question > Giver -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - All -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                          -
                        • -
                          -
                          - Group by Teams -
                          -
                          -
                        • -
                        • -
                          -
                          - Show Statistics -
                          -
                          -
                        • -
                        • -
                          -
                          - Indicate Missing Responses -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - No specific section - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section A - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Team 1</td></div>'" - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Statistics for Received Responses -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - - 3.5 - - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Option - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Fun - - 55 - - 55 - - 55 -
                        - Grades - - 45 - - 45 - - 45 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - - 110 - - 110 -
                        - Team 1</td></div>'" - - Benny Charles - - 90 - - 90 - - 90 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team 1</td></div>'" Detailed Responses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Alice Betsy</td>'" - - - - [CFResultsUiT.alice.b@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Who are your teammates?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Danny - - - - - 1 - - 100 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Danny -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - Which teams do you like?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Team 1 - - - - - 1 - - 50 - - - -
                        - Team 2 - - - - - 1 - - 50 - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - - 3.5 - - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3.5 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 5: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Option - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Fun - - 55 - - 55 - - 55 -
                        - Grades - - 45 - - 45 - - 45 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - - 110 - - 110 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 110 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share +11% - - -   [Perceived Contribution: - - N/A - - ] - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Benny Charles - - - - [CFResultsUiT.benny.c@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 1</td></div>'" - - Benny Charles - - 90 - - 90 - - 90 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 90 - -
                        - - - - - -
                        - - -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 7: - - Rate the contribution of yourself and your team members towards the latest project.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Benny Charles - - - No Response - - -   [Perceived Contribution: - - Equal Share - - ] - - -
                        - - - - - -
                        -
                        - - - Team 1</td></div>'" - - Fred Gabriel - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Team 1</td></div>'" - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 11: - - As a team, what do you think could have been done differently? - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - - Team 1</td></div>'" - - Response from benny to Team 1 (own team) - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Fred Gabriel - - - - [CFResultsUiT.fred.g@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Team 2 - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -

                        - Team 2 Statistics for Received Responses -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 2 - - Charlie Dávis - - 50 - - 50 - - 50 -
                        - Team 2 - - Danny Engrid - - 150 - - 150 - - 150 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team 2 Detailed Responses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Charlie Dávis - - - - [CFResultsUiT.charlie.d@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 2 - - Charlie Dávis - - 50 - - 50 - - 50 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 50 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Charlie Dávis - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Danny Engrid - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Drop out - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Extra guy - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: - - Split points among the your team members and yourself, according to how much you think each member has contributed.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Points Received - - Total Points - - - - Average Points - - -
                        - Team 2 - - Danny Engrid - - 150 - - 150 - - 150 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 150 - -
                        - - - - - -
                        - - -
                        - - - Team 2 - - Charlie Dávis - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Danny Engrid - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Drop out - - - No Response - - -
                        - - - - - -
                        -
                        - - - Team 2 - - Extra guy - - - No Response - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Drop out - - - - [drop.out@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Extra guy - - - - [extra.guy@gmail.tmt] - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        - - There are no responses received by this user or you may not have the permission to see the response - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 3 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - N/A - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Anonymous student ${participant.hash}'s Team - -
                        - -
                        -
                        -
                        -
                        -
                        - To: -
                        - - Anonymous student ${participant.hash} - -
                        -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 8: - - Rate you and your team members work.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - 4 - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 10: - - Rate the contribution of ideas from yourself and your team members in the last meeting.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Giver - - - - Feedback - - - - Actions -
                        - - - Team 1</td></div>'" - - Alice Betsy</td>'" - - - Equal Share - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Section B - -
                        -
                        -
                        - - Collapse Teams - -   -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionAddSuccess.html deleted file mode 100644 index 605e2da58c3..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionAddSuccess.html +++ /dev/null @@ -1,3419 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionEdit.html b/src/test/resources/pages/instructorFeedbackRubricQuestionEdit.html deleted file mode 100644 index ea5ac091a51..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionEdit.html +++ /dev/null @@ -1,3419 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - - - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - - - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionEditChoiceSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionEditChoiceSuccess.html deleted file mode 100644 index 41861d755db..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionEditChoiceSuccess.html +++ /dev/null @@ -1,3370 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionEditDescriptionSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionEditDescriptionSuccess.html deleted file mode 100644 index 559e333d667..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionEditDescriptionSuccess.html +++ /dev/null @@ -1,3413 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionEditSubQuestionSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionEditSubQuestionSuccess.html deleted file mode 100644 index aa6470137b8..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionEditSubQuestionSuccess.html +++ /dev/null @@ -1,3370 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionEditSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionEditSuccess.html deleted file mode 100644 index 97afc1284db..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionEditSuccess.html +++ /dev/null @@ -1,3419 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - -
                        -
                        - - - - - - - - - - - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionEditWeightSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionEditWeightSuccess.html deleted file mode 100644 index dfbe89dc755..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionEditWeightSuccess.html +++ /dev/null @@ -1,3370 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionMoveColumnNewQuestionSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionMoveColumnNewQuestionSuccess.html deleted file mode 100644 index f17042cada1..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionMoveColumnNewQuestionSuccess.html +++ /dev/null @@ -1,4247 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - - - -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 2: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details about this new question -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - - - -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionMoveColumnSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionMoveColumnSuccess.html deleted file mode 100644 index df66ca5e733..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionMoveColumnSuccess.html +++ /dev/null @@ -1,3507 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The changes to the question have been updated. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - more details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - - - -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackRubricQuestionWeightAddSuccess.html b/src/test/resources/pages/instructorFeedbackRubricQuestionWeightAddSuccess.html deleted file mode 100644 index d2fde1a4621..00000000000 --- a/src/test/resources/pages/instructorFeedbackRubricQuestionWeightAddSuccess.html +++ /dev/null @@ -1,3419 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - FRubricQnUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - More details -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageAwaiting.html b/src/test/resources/pages/instructorFeedbackSubmitPageAwaiting.html deleted file mode 100644 index 2c7b3fe1b33..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageAwaiting.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - Submit Feedback [Instructor] - - - - - - - - - - - - -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - - The feedback session is currently not open for submissions. - - You can view the questions and any submitted responses for this feedback session but cannot submit new responses. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Fourth Session -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2035, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 30 Apr 2035, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the second feedback session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - Give feedback to your instructors - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - - - diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageClosed.html b/src/test/resources/pages/instructorFeedbackSubmitPageClosed.html deleted file mode 100644 index c4419976ccf..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageClosed.html +++ /dev/null @@ -1,1467 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - - The feedback session is currently not open for submissions. - - You can view the questions and any submitted responses for this feedback session but cannot submit new responses. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 30 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the second feedback session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - Give feedback to your instructors - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - What do you like best about our product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - What do you like best about our product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Rate our product. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageEmpty.html b/src/test/resources/pages/instructorFeedbackSubmitPageEmpty.html deleted file mode 100644 index 7428a8276e6..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageEmpty.html +++ /dev/null @@ -1,85 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Third Session -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the last feedback session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - There are no questions for you to answer here! -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageFullyFilled.html b/src/test/resources/pages/instructorFeedbackSubmitPageFullyFilled.html deleted file mode 100644 index 08969842b38..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageFullyFilled.html +++ /dev/null @@ -1,3736 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Test Self Feedback -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Edited response to Alice. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to student who is going to drop out. -

                        -
                        - -
                        - -
                        - Response length: - - 9 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to extra guy. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Feedback to instructors -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to other instructors. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to instructor 2. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to Instructor 3 -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to instructor 4. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to instructor 5. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - Who is the best student? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who are the best students? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Who are the best teams? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Which teams would you like to be an instructor of again? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        - - - Every recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - Every option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        - - - At least one recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - At least one option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageGracePeriod.html b/src/test/resources/pages/instructorFeedbackSubmitPageGracePeriod.html deleted file mode 100644 index a8da3485db9..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageGracePeriod.html +++ /dev/null @@ -1,163 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - - The feedback session is currently not open for submissions. - - You can view the questions and any submitted responses for this feedback session but cannot submit new responses. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Grace Period Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the following questions. -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - Give feedback to yourself. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageModified.html b/src/test/resources/pages/instructorFeedbackSubmitPageModified.html deleted file mode 100644 index 163a2ce0456..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageModified.html +++ /dev/null @@ -1,4050 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Test Self Feedback -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Edited response to Alice. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to extra guy. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Feedback to instructors -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to other instructors. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to instructor 2. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to Instructor 3 -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to instructor 4. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to instructor 5. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - Who is the best student? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who are the best students? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Who are the best teams? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Which teams would you like to be an instructor of again? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 400. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        - - - - Actual total is 300! Distribute the remaining 100 points. - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 400. -
                        - - - Every recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - Every option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 400. -
                        - - - At least one recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - At least one option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageOpen.html b/src/test/resources/pages/instructorFeedbackSubmitPageOpen.html deleted file mode 100644 index d30826a6537..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageOpen.html +++ /dev/null @@ -1,3692 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to other instructors. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - Who is the best student? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who are the best students? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Who are the best teams? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Which teams would you like to be an instructor of again? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        - - - Every recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - Every option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        - - - At least one recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - At least one option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageOpenWithHelperView.html b/src/test/resources/pages/instructorFeedbackSubmitPageOpenWithHelperView.html deleted file mode 100644 index 7d470718ed7..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageOpenWithHelperView.html +++ /dev/null @@ -1,3127 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to other instructors. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - Who is the best student? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who are the best students? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Who are the best teams? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Which teams would you like to be an instructor of again? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving team can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving team can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - Every recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving team can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - Every option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving team can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - At least one recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving team can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - At least one option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPagePartiallyFilled.html b/src/test/resources/pages/instructorFeedbackSubmitPagePartiallyFilled.html deleted file mode 100644 index 26331c9b451..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPagePartiallyFilled.html +++ /dev/null @@ -1,3716 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - IFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Test Self Feedback -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to Alice. -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to student who is going to drop out. -

                        -
                        - -
                        - -
                        - Response length: - - 9 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to extra guy. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to other instructors. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        - Feedback to Instructor 3 -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What do you think is the other instructors' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - Who is the best student? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who are the best students? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Who are the best teams? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Which teams would you like to be an instructor of again? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        - - - Every recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - Every option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Split points among the teams, based on how much effort you think the teams have put into the project - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        - - - At least one recipient should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - How much more time should the teams spend on the following, regarding their product? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        - - - At least one option should be allocated different number of points. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPagePreview.html b/src/test/resources/pages/instructorFeedbackSubmitPagePreview.html deleted file mode 100644 index 9f9646a2323..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPagePreview.html +++ /dev/null @@ -1,228 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFeedbackEditUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 10:00 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        -

                        -

                        - Please fill in the edited feedback session. -

                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - question for instructors - -
                        -
                        -
                        -
                        - - More details: - -

                        - more details -

                        -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackSubmitPageRankHelper.html b/src/test/resources/pages/instructorFeedbackSubmitPageRankHelper.html deleted file mode 100644 index 27b3b3ee7b8..00000000000 --- a/src/test/resources/pages/instructorFeedbackSubmitPageRankHelper.html +++ /dev/null @@ -1,3993 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Instructor Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - For instructors to submit and view results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - As an instructor, rank for every team, the areas of improve that they should work on - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - As an instructor, rank for the 4 students you are mentoring, their areas of their reports that were good. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - As instructor, among the 2 reports you have reviewed, rank them - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - As an instructor, rank the teams. You are allowed to give the same rank multiple times. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackTeamPeerEvalTemplateAddSuccess.html b/src/test/resources/pages/instructorFeedbackTeamPeerEvalTemplateAddSuccess.html deleted file mode 100644 index 1abbe648e72..00000000000 --- a/src/test/resources/pages/instructorFeedbackTeamPeerEvalTemplateAddSuccess.html +++ /dev/null @@ -1,5083 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackUiT.CS1101 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Team Peer Evaluation Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please fill in the new feedback session. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Awaiting -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The feedback session has been added. Click the "Add New Question" button below to begin adding questions for the feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Team contribution question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - - Allow response giver to select 'Not Sure' as the answer - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - The recipient's team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 2: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, the name of the recipient, and your name. -
                        • -
                        • - The recipient's team members can see your response, the name of the recipient, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 3: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 4: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 5: - - - -  Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackTemplateQuestionAddSuccess.html b/src/test/resources/pages/instructorFeedbackTemplateQuestionAddSuccess.html deleted file mode 100644 index bd8776c0904..00000000000 --- a/src/test/resources/pages/instructorFeedbackTemplateQuestionAddSuccess.html +++ /dev/null @@ -1,3223 +0,0 @@ -
                        -
                        -
                        -

                        - Edit Feedback Session -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - CFeedbackEditUiT.CS2104 -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Programming Language Concepts -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - First Session -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Instructions for first session -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Open -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Not Published -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - The question has been added to this feedback session. -
                        -
                        - - -
                        - - - - -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Team contribution question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - - Allow response giver to select 'Not Sure' as the answer - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - The recipient's team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -
                        -
                        - - - - - - - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackTemplateQuestionExpandedModal.html b/src/test/resources/pages/instructorFeedbackTemplateQuestionExpandedModal.html deleted file mode 100644 index e7aa25ed5a7..00000000000 --- a/src/test/resources/pages/instructorFeedbackTemplateQuestionExpandedModal.html +++ /dev/null @@ -1,686 +0,0 @@ - diff --git a/src/test/resources/pages/instructorFeedbackUncommonSettings.html b/src/test/resources/pages/instructorFeedbackUncommonSettings.html deleted file mode 100644 index b974ed344cc..00000000000 --- a/src/test/resources/pages/instructorFeedbackUncommonSettings.html +++ /dev/null @@ -1,277 +0,0 @@ -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackUncommonSettingsSendEmails.html b/src/test/resources/pages/instructorFeedbackUncommonSettingsSendEmails.html deleted file mode 100644 index 3b09f7b8602..00000000000 --- a/src/test/resources/pages/instructorFeedbackUncommonSettingsSendEmails.html +++ /dev/null @@ -1,277 +0,0 @@ -
                        - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackUncommonSettingsSessionResponsesVisibility.html b/src/test/resources/pages/instructorFeedbackUncommonSettingsSessionResponsesVisibility.html deleted file mode 100644 index 7300f0a0eef..00000000000 --- a/src/test/resources/pages/instructorFeedbackUncommonSettingsSessionResponsesVisibility.html +++ /dev/null @@ -1,277 +0,0 @@ -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        diff --git a/src/test/resources/pages/instructorFeedbackUnpublishSuccessful.html b/src/test/resources/pages/instructorFeedbackUnpublishSuccessful.html deleted file mode 100644 index 1fee4c400f7..00000000000 --- a/src/test/resources/pages/instructorFeedbackUnpublishSuccessful.html +++ /dev/null @@ -1,1329 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - Africa/Johannesburg -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - - -
                        - Programming Methodology -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        - The feedback session has been unpublished. -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - CFeedbackUiT.CS2104 - - Awaiting Session # - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Open Session # - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS2104 - - First Session #1 - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - CFeedbackUiT.CS1101 - - Manual Session #1 - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorHelpPageDefault.html b/src/test/resources/pages/instructorHelpPageDefault.html deleted file mode 100644 index 9af7ba24fca..00000000000 --- a/src/test/resources/pages/instructorHelpPageDefault.html +++ /dev/null @@ -1,14813 +0,0 @@ -
                        -

                        - Help for Instructors -

                        - - -
                        -

                        - Have questions about how to use TEAMMATES? This page answers some frequently asked questions. -
                        - If you are new to TEAMMATES, our - - Getting Started - - guide will introduce you to the basic functions of TEAMMATES. -
                        - If you have any remaining questions, don't hesitate to - - email us - - . We respond within 24 hours. -

                        -
                        -

                        - Browse questions by topic: -

                        - -
                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -

                        -

                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Students -

                        -
                        -

                        - Student Records -

                        -
                        -
                        -
                        -

                        - How do I view a student's profile? -

                        -
                        -
                        -
                        -

                        - To view the profile of Student A from Course B: -

                        -
                          -
                        1. - Go to the - - Students - - page and click the panel heading for Course B. You will see a list of students enrolled in the course. -
                        2. -
                        3. - Click the - - button in the last column of the row corresponding to Student A. A new page will open displaying the student's profile, similar to the sample profile below. -
                        4. -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Profile -
                        - Short Name (Gender) - - Alice ( - - female - - ) -
                        - Personal Email - - alice@email.com -
                        - Institution - - National University of Singapore -
                        - Nationality - - American -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -

                        - Alice Betsy -

                        -
                        -
                        -
                        - -
                        -

                        - Section A -

                        -
                        -
                        -
                        - -
                        -

                        - Team A -

                        -
                        -
                        -
                        - -
                        -

                        - alice@email.com -

                        -
                        -
                        -
                        - -
                        -

                        - Alice is a transfer student. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - The student's profile page displays the student's details and course-related information, such as: -

                        -
                          -
                        • - - Section name - - : the name of the section you enrolled the student in. This only appears if sections are created for the course. -
                        • -
                        • - - Team name - - : the name of the team you enrolled the student in, or - - NA - - if the student does not belong to a team. -
                        • -
                        • - - Official email address - - : the email address that will be used to contact the student, taken from enrollment information -
                        • -
                        • - - Comments - - : additional student information you entered in the Comments column during enrollment -
                        • -
                        -

                        - Below this is the - - More Info - - section containing a personal description given by the student, if any. -
                        - You can press the - - - button in the top-right corner to display the information in a lightbox for better readability. -

                        -
                        - -
                        -
                        -
                        -
                        - - -
                        - More Info -
                        -

                        - Hi I am Alice Betsy! I am from Colorado, America. I am a programming and gaming enthusiast. Aspiring to become a Software Architect in a well reputed organization. -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I edit a student's details after enrolling the student? -

                        -
                        -
                        -
                        -

                        - To edit the name, section, team, contact email, or instructor comments of Student A from Course B: -

                        -
                          -
                        1. - Go to the - - Students - - page and click the panel heading for Course B. You will see a list of students enrolled in Course B. -
                        2. -
                        3. - Click the - - button in the last column of the row corresponding to Student A. -
                          -
                        4. -
                        5. - In the new page that opens, edit the relevant fields of Student A's details. The page will look similar to the example below. -
                        6. -
                        7. - Click - - to save your changes to Student A's details. -
                        8. -
                        -

                        - Note that moving a student to a different team (i.e. changing the student's Team ID) will change the student's team in all existing sessions in the course. -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view all the responses a student has given and received? -

                        -
                        -
                        -
                        -

                        - To view the responses that Student A from Course B has given and received: -

                        -
                          -
                        1. - Go to the - - Students - - page and click the panel heading for Course B. You will see a list of students enrolled in the course. -
                        2. -
                        3. - Click - - button corresponding to Student A to access all the responses Student A has given and received. -
                        4. -
                        -
                        -
                        -
                        -
                        -

                        - Finding Students -

                        -
                        - -
                        -
                        -

                        - How do I email a student or students in my course? -

                        -
                        -
                        -
                        -
                          -
                        1. - On the - - Students - - page, filter out the selected student/students. -
                        2. -
                        3. - Click - - to copy their email addresses to your clipboard -
                        4. -
                        5. - Use your preferred email provider to email the students -
                        6. -
                        -
                        -
                        -
                        -
                        -

                        - Student Accounts -

                        -
                        -
                        -
                        -

                        - Is it compulsory for students to use Google accounts? -

                        -
                        -
                        -
                        -

                        - Students can submit feedback and view results without having to login to TEAMMATES, unless they choose to link their Google account (optional). TEAMMATES will send students a unique URL to access their feedback sessions and results. However, students who link their TEAMMATES account with their Google account will be able to access a dashboard of all their sessions and results through the TEAMMATES website. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I change the Google ID associated with a student? -

                        -
                        -
                        -
                        -

                        - At the moment, there is no way for students to update their own Google IDs. -
                        - Please ask the student to - - contact us - - for assistance changing his/her Google ID. -

                        -
                        -
                        -
                        -
                        -

                        - - Back to Top - -

                        -
                        -
                        -
                        -
                        -

                        - Courses -

                        -
                        -

                        - Enrolling Students in Courses -

                        -
                        -
                        -
                        -

                        - How do I add students to a course? -

                        -
                        -
                        -
                        -

                        - There are two ways to enroll students in a course: -

                        -
                          -
                        • - From the - - Home - - page, click on the - - button of the corresponding course, and choose - - Enroll - - . -
                        • -
                        • - From the - - Courses - - page, click on the - - button of the corresponding course. -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Is there a size limit for a course? -

                        -
                        -
                        -
                        -

                        - No. However, if courses with an enrollment of more than 100 students need to be - - divided into sections - - . -
                        - TEAMMATES uses section information to organize the results of your sessions into a downloadable report. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - What should I do if my course doesn’t have teams? -

                        -
                        -
                        -
                        -

                        - When you enroll students in a course, TEAMMATES requires you to specify a - - Team - - for each student. -
                        - If your class does not use groups or teams, simply provide a dummy value in the Team column. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - What are sections meant for? -

                        -
                        -
                        -
                        -

                        - Sections are used to organize students in courses with significantly large numbers of students. It is mandatory for courses with more than 100 students to organize students into sections. Courses with less than 100 students do not need to be split into sections. -

                        -

                        - Section information is used to paginate the downloadable report of a session's results. When you download the results of a session as an Excel spreadsheet, each section will be given its own page in the file. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I enroll students into sections? -

                        -
                        -
                        -
                        -

                        - To specify a section for each student at the time of enrollment, include a - - Section - - column in the spreadsheet and ensure it is copied over to the student data text box, together with the rest of the data. To view more information, go to the - - Courses - - page, click on the - - button for any course and scroll down to the - - More Info - - section. -

                        -
                        -
                        -
                        -
                        -

                        - Adding Instructors to Courses -

                        -
                        -
                        -
                        -

                        - How do I add instructors to my course? -

                        -
                        -
                        -
                        -

                        - From your - - Home - - or - - Courses - - page, click the - - button of the course you would like to edit. You will be directed to the - - Edit Course - - page, which will look similar to the example below. -
                        - Here, you can add new instructors to the course, edit existing instructors' details, and delete instructors from the course, depending on your access privileges. -

                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - To add an instructor: -

                        -
                          -
                        1. - Click the - - button at the bottom of the page. A form will appear for you to specify the necessary information about the new instructor. -
                        2. -
                        3. - Fill in the name, email, role, and access level of the instructor you want to add. If you are not clear about certain input field, hover your cursor over the input field to view the tooltip for explanation of the field. -
                          -
                        4. -
                        5. - Click - - to add the instructor. -
                        6. -
                        -
                        -
                        -
                        - - Instructor 2: - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -  Co-owner: Can do everything - - View Details - -
                        - -  Manager: Can do everything except for deleting/restoring the course - - View Details - -
                        - -  Observer: Can only view information(students, submissions, comments etc.).  Cannot edit/delete/submit anything. - - View Details - -
                        - -  Tutor: Can view student details, give/view comments, submit/view responses for sessions - - View Details - -
                        - -  Custom: No access by default. Any access needs to be granted explicitly. -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I edit the information of an instructor in my course? -

                        -
                        -
                        -
                        -

                        - To edit the name, email and visible role of Instructor A from Course B, first go to the - - Edit Course - - page of Course B. -
                        - From your - - Home - - or - - Courses - - page, click the - - button of the course you would like to edit. You will be directed to the - - Edit Course - - page. -
                        -

                        -

                        - To edit Instructor A's information: -

                        -
                          -
                        1. - Scroll to the panel showing Instructor A's information. -
                          -
                        2. -
                        3. - Click the - - button in the top right hand corner of Instructor A's information panel. -
                          -
                        4. -
                        5. - Update the relevant fields with Instructor A's new information. -
                        6. -
                        7. - Click - - to save the changes and complete the edit process. -
                        8. -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I set an instructor's access level? -

                        -
                        -
                        -
                        -

                        - When - - adding an instructor - - or - - editing an instructor's information - - , you can set the instructor's access level. There are 4 pre-defined privilege options for you to choose from: -

                        -
                          -
                        • - - Co-owner - - : is able to perform any action on the course, including deleting the course. When you create a new course, your access level is Co-owner. This is the highest access level. -
                        • -
                        • - - Manager - - : has the same privileges as a Co-owner except that s/he is not allowed to delete the course. -
                        • -
                        • - - Observer - - : can view the course's information, but cannot edit or submit information -
                        • -
                        • - - Tutor - - : can view student details, give/view comments, and submit/view responses for sessions. -
                        • -
                        -

                        - All the access levels listed above have pre-defined privileges which you can view by clicking the 'View details' link next to the access level description. -
                        - To set custom privileges for an instructor, select the - - Custom - - access level, and specify which privileges the instructor should get. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I set custom privileges for an instructor? -

                        -
                        -
                        -
                        -

                        - When you set the access level for an instructor to - - Custom - - , detailed privilege settings will appear. -
                        - Use the checkboxes to give instructors specific privileges. -

                        -

                        - If a course has sections, you can customize an instructor's permissions for each section by clicking 'Give different permissions for a specific section'. -
                        - In the panel for section-level privilege settings, use the section checkboxes to apply your chosen settings to more than one section. -
                        - You can also change the degree of access the instructor has to specific sessions in that section by clicking 'Give different permissions for sessions in this section'. -

                        -
                        -
                        -
                        - - Instructor 1: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -  Co-owner: Can do everything   - - View Details - -
                        - -  Manager: Can do everything except for deleting/restoring the course   - - View Details - -
                        - -  Observer: Can only view information(students, submissions, comments etc.).  Cannot edit/delete/submit anything.   - - View Details - -
                        - -  Tutor: Can view student details, give/view comments, submit/view responses for sessions   - - View Details - -
                        - -  Custom: No access by default. Any access needs to be granted explicitly. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - In general, this instructor can - -
                        -
                        -
                        - - Edit/Delete/Restore Course -
                        -
                        - - Add/Edit/Delete Instructors -
                        -
                        - - Create/Edit/Delete/Restore Sessions -
                        -
                        - - Enroll/Edit/Delete Students -
                        -
                        -
                        -
                        - - View Students' Details -
                        - - Give Comments for Students -
                        - - View Others' Comments on Students -
                        - - Edit/Delete Others' Comments on Students -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - But in section(s) - -

                        -
                        -
                        -
                        -
                        - - section 1 -
                        -
                        - - section 2 -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -

                        - - the instructor can only, - -

                        -
                        -
                        - -
                        -
                        -
                        -
                        - - View Students' Details -
                        - - Give Comments for Students -
                        - - View Others' Comments on Students -
                        - - Edit/Delete Others' Comments on Students -
                        -
                        -
                        -
                        - - Sessions: Submit Responses and Add Comments -
                        - - Sessions: View Responses and Comments -
                        - - Sessions: Edit/Delete Responses/Comments by Others -
                        -
                        -
                        - - Give different permissions for sessions in this section - - -
                        -
                        -
                        - - Give different permissions for a specific section - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Managing Courses -

                        -
                        -
                        -
                        -

                        - How do I view a list of students in a course? -

                        -
                        -
                        -
                        -

                        - There are two ways to access the list of students in a course. -

                        -

                        - To view the list of students in Course A: -

                        -
                          -
                        • - From the - - Home - - page, find the panel corresponding to Course A. On the right hand side, click - - and then select - - View/Edit - - . -
                        • -
                        • - From the - - Courses - - page, click - - button of the row corresponding to Course A. -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I change a student's section? -

                        -
                        -
                        -
                        -

                        - To edit the section Student A from Course B is enrolled in: -

                        -
                          -
                        1. - Go to the - - Students - - page and click Course B's panel heading. You will see a list of students enrolled in Course B. -
                        2. -
                        3. - Click the - - button in the last column of the row corresponding to Student A. -
                        4. -
                        5. - A new page will open that allows you to - - edit the student's profile - - , including a field to edit the student's section. -
                          -
                        6. -
                        7. - After editing the section name, click - - to confirm Student A's new section. -
                        8. -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -

                        - What should I do if a student says his/her courses have disappeared from the system? -

                        -
                        -
                        -
                        -

                        - The most likely reason for this is that the student has changed the primary email address associated with his/her Google ID. Please ask the student to email - - teammates@comp.nus.edu.sg - - so that we help to rectify the problem. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I delete students from a course? -

                        -
                        -
                        -
                        -

                        - To remove Student A from Course B: -

                        -
                          -
                        1. - - View the student list - - of Course B. -
                        2. -
                        3. - In the row corresponding to Student A, click the - - button. -
                        4. -
                        5. - Click - - OK - - to confirm that you would like to delete Student A from Course B. -
                        6. -
                        -
                        -
                        -
                        -
                        -

                        - Archiving Courses -

                        -
                        -
                        -
                        -

                        - How do I archive a course? -

                        -
                        -
                        -
                        -

                        - When a course has ended, you can archive it so that it doesn't appear in your home page. Course, student and session details of an archived course are still stored on TEAMMATES. However, you cannot edit, create feedback sessions for or enroll students in an archived course. -

                        -

                        - In your - - Home - - page, you will see panels for each course and a table of feedback sessions inside it, similar to the example below. -
                        - Click on the - - button on the card heading of the course you want to archive. -
                        - Then select - - in the drop-down menu and click - - OK - - to confirm. -

                        -

                        - You can also archive a course from the - - Courses - - page. -
                        - Under 'Active Courses', click on the - - button in the row corresponding to the course you want to archive. -

                        -
                        -
                        -
                        -
                        -
                        - - [AI532] : Artificial Intelligence - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view courses I have archived? -

                        -
                        -
                        -
                        -

                        - You can view all your archived courses by navigating to the - - Courses - - page. -
                        - Scroll to the - - Archived courses - - heading, which looks similar to this: -

                        -
                        -

                        - - - Archived courses -

                        - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - - -
                        -
                        -

                        - The courses you have previously archived are listed here. In order to access information in an archived course, - - unarchive the course - - . -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I unarchive an archived course? -

                        -
                        -
                        -
                        -

                        - To unarchive a course, first - - view the course - - that you would like to unarchive in the - - Courses - - page. -
                        - Then, click on the - - button corresponding to the course you want to unarchive. -

                        -
                        -

                        - - - Archived courses -

                        - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - - -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Restoring Deleted Courses -

                        -
                        -
                        -
                        -

                        - How do I view courses I have deleted? -

                        -
                        -
                        -
                        -

                        - You can view all your deleted courses by navigating to the - - Courses - - page. -
                        - Scroll to the - - Deleted courses - - heading, which looks similar to this: -

                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - The courses you have previously deleted are listed here. In order to access information in a deleted course, - - restore the course - - . -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I restore a deleted course? -

                        -
                        -
                        -
                        -

                        - To restore a deleted course, first - - view the course - - that you would like to restore in the - - Courses - - page. -
                        - Then, click on the - - button corresponding to the course you want to restore. -

                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - After restoring the course, all the information relevant to the course (e.g. instructors, sessions, students) will also be restored. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I permanently delete a course? -

                        -
                        -
                        -
                        -

                        - To permanently delete a course, first - - view the course - - that you would like to permanently delete in the - - Courses - - page. -
                        - Then, click on the - - button corresponding to the course you want to delete. -

                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - After deleting the course, all the information relevant to the course (e.g. instructors, sessions, students) will also be permanently deleted. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I restore/delete all courses from Recycle Bin? -

                        -
                        -
                        -
                        -

                        - First - - view the course - - and check for courses in Recycle Bin. -
                        - To restore all courses, click on the - - - - - Restore All - - - button in - - Deleted courses - - heading; to delete all courses, click on the - - - - - Delete All - - - button in - - Deleted courses - - heading. -

                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - Back to Top - -

                        -
                        -
                        -
                        -
                        -

                        - Sessions -

                        -
                        -

                        - Setting Up Sessions -

                        -
                        -
                        -
                        -

                        - Tips for conducting team peer evaluation sessions -

                        -
                        -
                        -
                        -

                        - Any evaluation system has both positive and negative effects on those being evaluated. As teachers, you are probably keen to maximize the positive effect of this system on your course while minimizing any negative effects. Here are some of the things you could do: -

                        -
                          -
                        • - - Have frequent peer evaluations. - -
                          - Rather than have only one peer evaluation at the end of the course, have several peer evaluations at different points of the course. This way, students get frequent peer-feedback about their contribution, giving them plenty of chances to correct their conduct as necessary. -
                          -
                          -
                        • -
                        • - - Ignore early peer evaluations. - -
                          - Consider not using initial peer evaluations for grading. Let students know that in advance. This gives students time to get used to the system and be more relaxed in giving early feedback to peers. -
                          -
                          -
                        • -
                        • - - Interpret contribution numbers with care. - -
                          - If you use ‘Team contribution’ type questions in your peer evaluations, keep in mind the contribution numbers reported by TEAMMATES are based on student perceptions and may not reflect the real contribution of a student. Therefore, use those numbers primarily to identify cases that need further investigation. -
                          - You may ignore minor variations in the contribution numbers reported by TEAMMATES. The difference between [Equal share] and [Equal share - 2%] is not significant and can very well be due to rounding off within the system. -
                          -
                          - Keep in mind that it is human nature for one to downplay the value of contributions from others when one’s own contribution is being compared to that of others. As a result, it is common for the ‘perceived contribution’ to be somewhat lower than what the student actually did. -
                          - When taking further actions based on evaluation reports, also pay attention to the team’s consensus level about the contribution of a student. For example, you can take further actions with more confidence if all team members rated a certain student’s contribution low. -
                          -
                          -
                        • -
                        • - - Tolerate unequal contributions. - -
                          - This may be a good policy to adopt (If students know this policy, they will be more honest in reporting contribution values): -
                          -
                          - - It is OK to do less than an equal share of the work, as long as you are willing to accept a lower grade than your team members. It is your right to decide how much time you allocate to this course. How you prioritize your work is your own business. - -
                          -
                          -
                        • -
                        • - - Announce a 'cooling off' period. - -
                          - This may be a good guidelines to give to students: -
                          -
                          - - If you are unhappy about the peer-feedback received, please allow at least one day to lapse before you fire off a response email. You are likely to respond more rationally when you had some time to think it over. Also keep in mind that we do take note of how well you handle such a situation. You need to act professionally when facing conflicting views, opposition, and even deliberate sabotage. - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I create and schedule a new feedback session? -

                        -
                        -
                        -
                        - To create a new feedback session, click the - - Sessions - - tab at the top of the page. Then, fill out and submit the - - Add New Feedback Session - - form: -
                          -
                        1. - - Choose a session type - - . You can choose between creating a session with your own questions, creating a copy of a session you previously made, or using one of our session templates. -
                          -
                            -
                          • - Session with your own questions: you'll start with an empty template to which you can add your own questions -
                          • -
                          • - Session using template: TEAMMATES will provide you with a template of a typical session that you can add to and customize to suit your needs -
                          • -
                          • - Copy from previous feedback sessions: you can reuse questions and settings from a survey you created in the past -
                          • -
                          -
                        2. -
                        3. - - Select the course ID - - of the course for which the session will be created. -
                        4. -
                        5. - - Give your session a session name - - . This name will be visible to session respondents. -
                        6. -
                        7. - - Set the session's submission opening/closing time - - . This is the time period during which students can submit responses. TEAMMATES will automatically open and close the session at times you specify. -
                        8. -
                        9. - (Optional) Set advanced options to best suit your needs: -
                        10. -
                            -
                          • - Set a custom time zone -
                          • -
                          • - Give students more specific instructions -
                          • -
                          • - Set a grace period during which students can still submit responses if the session closes -
                          • -
                          • - Choose when you want this session to be visible to students. After this time, students can see the questions, but they cannot submit their responses until the session is - - open - -
                          • -
                          • - Choose when you want to make this session's responses visible. At this time, TEAMMATES will automatically publish the results for students to view -
                          • -
                          • - Choose whether TEAMMATES should send reminder or announcement emails to students about this session -
                          • -
                          • - Make the session private. A private session is a session that is never visible to others. This is for you to record your feedback about students. If you want to create a private session, set "Make session visible" to - - Never - -
                          • -
                          -
                        11. - - Click Create Feedback Session - - ! -
                        12. -
                        -

                        - This is the form used to set up sessions. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        - -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I add questions to a session? -

                        -
                        -
                        -
                        -

                        - After setting up a session, you can start adding questions. -
                        - You can also access this page by clicking the - - button of the desired session from the - - Home - - or - - Sessions - - page. -

                        -

                        - To add a question: -

                        -
                          -
                        1. - Scroll to the bottom of the page. -
                        2. -
                        3. - Select between adding a question from our predefined - - question types - - or copying a question from an existing feedback session. -
                        4. -
                        5. - Save changes to the question when you have finished creating the question -
                        6. -
                        7. - When you are finished adding questions, click - - . -
                        8. -
                        - -

                        - TEAMMATES gives you fine-grained control of each question. In addition to providing a range of different - - question types - - , you can also customize your desired: -

                        -
                          -
                        • - - Feedback Path - - : define who is giving feedback, and who the feedback is about. Select a common feedback path from the dropdown menu, or choose "Other predefined combinations..." to define the Feedback Giver and Recipient separately. If you choose a ‘team’ as the giver, any member can submit the response on behalf of the team. -
                        • -
                        • - - Visibility options - - : let students know who will be able to see their answers. Select a common visibility option from the dropdown menu, or choose "Custom visibility options..." to fully customize who can see the feedback response, the giver's identity, and the recipient's identity. -
                        • -
                        -

                        - In the example question below, students will give feedback on their own team members. The team member receiving feedback can see the feedback, but not who gave the feedback. Instructors can see who received what feedback, and who gave the feedback. -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -   Essay question - - - - Cancel - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I preview a session? -

                        -
                        -
                        -
                        - To see what the current session looks like to anyone in the course when they are submitting responses, use the - - Preview - - feature. -
                        - You can quickly and easily confirm that the questions and their settings are correct after editing questions. -

                        -

                        -

                        - To access the preview panel of a specific session, click the - - button for that session in the - - Home - - or - - Sessions - - page. The preview panel is located at the bottom of the Edit Feedback Session page. -

                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Managing Session Responses -

                        -
                        -
                        -
                        -

                        - What should I do if a student says he/she cannot submit an evaluation due to a technical glitch? -

                        -
                        -
                        -
                        -

                        - Instructors can submit responses on behalf of a student. To do so: -

                        -
                          -
                        1. - Ask the student to view the submission page and send you his/her answers to the session questions. -
                        2. -
                        3. - - View the results - - of the session. -
                        4. -
                        5. - Scroll to the panel titled - - Participants who have not responded to any question - - . Click on the panel to expand it. -
                        6. -
                        7. - Click the - - button of the corresponding student. You will be directed to a page where you can submit responses on behalf of the student. -
                        8. -
                        9. - Copy the student's responses to the corresponding questions, and click the - - button. -
                        10. -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view the results of my session? -

                        -
                        -
                        -
                        -

                        - View responses to a session by clicking the - - button of a session in the - - Home - - or - - Sessions - - page. -
                        - Click - - to sort the results in an order that best suits you. -

                        -

                        - 5 different views are available, each denoting the order in which responses are grouped. Additionally, you can group the results by team, show or hide statistics, view missing responses and filter responses from a particular section. -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - In the example below, results are sorted by - - Giver > Recipient > Question - - . Additionally, missing responses have been recorded. -

                        -
                        -
                        -
                        -
                        - From: - - Alice Betsy (Team 2) - - - [alice.b.tmms@gmail.com] - -
                        -
                        - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        -
                        - - - - -
                        -
                        -
                        - - From: -
                        - Alice Betsy (Team 2) -
                        -
                        -
                        -
                        -
                        -
                        - Question 6: What do you like about our product? -
                        - - - Multiple-choice (multiple answers) options: -
                          -
                        • - It's good -
                        • -
                        • - It's perfect -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - It's good -
                        • -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        -
                        - - Alice Betsy (Team 2) - -
                        -
                        -
                        - - From: -
                        - Alice Betsy (Team 2) -
                        -
                        -
                        -
                        -
                        -
                        - Question 1: What is the best selling point of your product? -
                        -
                        -
                        -
                        - My product is light. -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        -
                        - - Benny Charles (Team 1) - -
                        -
                        -
                        - - From: -
                        - Alice Betsy (Team 2) -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: Comment about 5 other students -
                        -
                        -
                        -
                        - Benny is a good student. -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Benny Charles (Team 1) - - - [benny.c.tmms@gmail.com] - -
                        -
                        - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        -
                        - - Charlie Davis (Team 1) - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1) -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: Comment about 5 other students -
                        -
                        -
                        -
                        - Charlie did alot of work. -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        -
                        - - Danny Engrid (Team 2) - -
                        -
                        -
                        - - From: -
                        - Benny Charles (Team 1) -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: Comment about 5 other students -
                        -
                        -
                        -
                        - Danny starts with D. -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Charlie Davis (Team 1) - - - [charlie.d.tmms@gmail.com] - -
                        -
                        - -
                        -   -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: -
                        -
                        - - Alice Betsy (Team 2) - -
                        -
                        -
                        - - From: -
                        - Charlie Davis (Team 1) -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: Comment about 5 other students -
                        -
                        -
                        -
                        - Alice is a good coder. -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - Participants who have not responded to any question -
                        -
                        -
                        - - - - - - - - - - - - - - - -
                        - Team - - Name - - Actions -
                        - Team 3 - - Danny Engrid - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - If you choose to publish the results of the session, students will receive an email with a link to access the session's results. What they can see is governed by the visibility levels you set when setting up the session. Here is an example of what a student might see: -

                        -
                        -
                        -
                        -

                        - Question 1: Tutor comments about the team presentation -

                        -
                        -
                        - - To: - - Team 1 -
                        - - - - - - - - - -
                        - - - From: - - - Tutor James Hardy -
                        - The content was good but overran the time limit -
                        -
                        -
                        -
                        - - To: - - Team 1 -
                        - - - - - - - - - -
                        - - - From: - - - Dr Lee Davis -
                        - Good presentation.Please keep to the time limit -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: Was this team member punctual? -
                        - - Multiple-choice (single answer) options: -
                          -
                        • - Yes -
                        • -
                        • - No -
                        • -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - anonymous -
                        - No -
                        -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - anonymous -
                        - No -
                        -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - anonymous -
                        - Yes -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view all the responses a student has given and received? -

                        -
                        -
                        -
                        -

                        - To view the responses that Student A from Course B has given and received: -

                        -
                          -
                        1. - Go to the - - Students - - page and click the panel heading for Course B. You will see a list of students enrolled in the course. -
                        2. -
                        3. - Click - - button corresponding to Student A to access all the responses Student A has given and received. -
                        4. -
                        -
                        -
                        -
                        -
                        -

                        - Adding Comments to Responses -

                        -
                        -
                        -
                        -

                        - How do I create a comment on a response? -

                        -
                        -
                        -
                        -

                        - While - - viewing the results - - of a session, you can add comments to respondents' answers. -

                        -

                        - To create comments on a response in a session: -

                        -
                          -
                        1. - View the results of a session -
                        2. -
                        3. - Click - - and change the view type to - - Group by - Giver > Recipient > Question - - or - - Group by - Recipient > Giver > Question - -
                        4. -
                        5. - Click the - - - icon on the right-hand side of the response you would like to comment on -
                        6. -
                        7. - Fill in the form, which will appear similar to the example below -
                        8. -
                        -
                        -
                        -
                        -
                        - To: - - Rose (Team 2) - -
                        -
                        -
                        - From: Alice (Team 1) -
                        -
                        -
                        -
                        -
                        - Question 3: - - Rate the latest assignment's difficulty. (1 = Very Easy, 5 = Very Hard).  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 4 -
                        - -
                        -
                          -
                        • -
                          -
                          -
                          -
                          -

                          - Giver: Alice (Team 1) -
                          - Recipient: Rose (Team 2) -

                          - You may change comment's visibility using the visibility options on the right hand side. -
                          - - - - Show Visibility Options - -
                          - - -
                          -
                          - - Add - - -
                          -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I edit or delete a comment on a response? -

                        -
                        -
                        -
                        -

                        - To edit or delete a comment that you previously made on a response: -

                        -
                          -
                        1. - Navigate to the page where you - - added the comment - - that you want to edit or delete. -
                        2. -
                        3. - Hover over the comment which you want to edit or delete. -
                        4. -
                        5. - Click the - - - icon to edit the comment, or or - - - icon to delete the comment. The icons are visible on the right-hand side of the comment field. -
                        6. -
                        7. - If you are editing the comment, make your edits and click - - to save changes. -
                        8. -
                        9. - If you are deleting the comment, click - - OK - - to confirm that you want to delete the comment. -
                        10. -
                        -
                        -
                        -
                        - -
                        -

                        - Restoring Deleted Sessions -

                        -
                        -
                        -
                        -

                        - How do I view sessions I have deleted? -

                        -
                        -
                        -
                        -

                        - You can view all your deleted feedback sessions by navigating to the - - Sessions - - page. -
                        - Scroll to the - - Deleted feedback sessions - - heading, which looks similar to this: -

                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Feedback for Project Presentation 1 - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - The feedback sessions you have previously deleted are listed here. In order to access information in a deleted session, - - restore the session - - . -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I restore a deleted session? -

                        -
                        -
                        -
                        -

                        - To restore a deleted feedback session, first - - view the session - - that you would like to restore in the - - Sessions - - page. -
                        - Then, click on the - - button corresponding to the session you want to restore. -

                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Feedback for Project Presentation 1 - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - After restoring the session, all the information relevant to the session (e.g. questions, responses, comments) will also be restored. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I permanently delete a session? -

                        -
                        -
                        -
                        -

                        - To permanently delete a feedback session, first - - view the session - - that you would like to permanently delete in the - - Sessions - - page. -
                        - Then, click on the - - button corresponding to the session you want to delete. -

                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Feedback for Project Presentation 1 - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - After deleting the session, all the information relevant to the session (e.g. questions, responses, comments) will also be permanently deleted. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I restore/delete all sessions from Recycle Bin? -

                        -
                        -
                        -
                        -

                        - First - - view the session - - and check for sessions in Recycle Bin. -
                        - To restore all sessions, click on the - - - - - Restore All - - - button in - - Deleted feedback sessions - - heading; to delete all sessions, click on the - - - - - Delete All - - - button in - - Deleted feedback sessions - - heading. -

                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - Back to Top - -

                        -
                        -
                        -
                        -
                        -

                        - Questions -

                        -
                        -
                        -
                        -
                        -

                        - Essay Questions -

                        -
                        -
                        -
                        -

                        - Essay questions are open-ended questions that allow respondents to give text feedback about a question. -
                        - To set up an essay question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - Specify the feedback path that should be used to generate the appropriate feedback recipients -
                        6. -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -   Essay question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Multiple Choice (Single Answer) Questions -

                        -
                        -
                        -
                        -

                        - Multiple-choice (single answer) questions allow respondents to choose one answer from your list of answer options. -
                        - Other than manually specifying options, TEAMMATES also supports - - generating options - - based on the list of students, teams and instructors in the course. -

                        -

                        - To set up a multiple choice (single answer) question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - Specify answer options by writing them manually, or generate options from your course's list of students, instructors or teams -
                        6. -
                        7. - (Optional) Specify 'Other' option, and let the student enter their own answer -
                        8. -
                        9. - (Optional) Assign weights to each option for calculating statistics -
                        10. -
                        11. - Specify the feedback path that should be used to generate the appropriate feedback recipients -
                        12. -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -  Multiple-choice (single answer) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        - Weights - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - -
                        -
                        - - - - - - - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - -
                        -
                        -

                        - When you view the results of a multiple-choice (single answer) question, TEAMMATES calculates some statistics about the results collected, such as the number of responses for each option, and the percentage of response in which each option was chosen. If weights are assigned in the question, then additional statistics are calculated such as count and average point for each option. 'Per Recipient Statistics' are calculated if weights are assigned, it contains the number of responses each recipient received for each option, and the total and average points for each recipient. -

                        -

                        - - Note: - - Weights can be assigned for questions with existing questions too. To do that, edit the question that needs weights, if there are existing responses for that question, the additional statistics will automatically get calculated for the question. -

                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        - - Did this team member work co-operatively with others?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choice - - - - Weight - - - - Response Count - - - - Percentage (%) - - - - Weighted Percentage (%) - - -
                        - Yes - - 2 - - 4 - - 50 - - 66.67 -
                        - No - - 1 - - 2 - - 25 - - 16.67 -
                        - Other - - 1 - - 2 - - 25 - - 16.67 -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team - - -

                        -
                        -

                        - Recipient Name - - -

                        -
                        -

                        - Yes [2] - - -

                        -
                        -

                        - No [1] - - -

                        -
                        -

                        - Other [1] - - -

                        -
                        -

                        - Total - - -

                        -
                        -

                        - Average - - -

                        -
                        - Team 1 - - Jean Wong - - 1 - - 0 - - 1 - - 3.00 - - 1.50 -
                        - Team 1 - - Ravi Kumar - - 2 - - 0 - - 0 - - 4.00 - - 2.00 -
                        - Team 1 - - Tom Jacobs - - 0 - - 1 - - 1 - - 2.00 - - 1.00 -
                        - Team 2 - - Chun Ling - - 0 - - 1 - - 0 - - 1.00 - - 1.00 -
                        - Team 2 - - Desmond Wu - - 1 - - 0 - - 0 - - 2.00 - - 2.00 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - Yes - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - No - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - More or less - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - Not sure - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - Yes - -
                        - - - - - -
                        - - -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - Yes - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Chun Ling - -
                        -
                        - Team 2 - -
                        - Desmond Wu - -
                        -
                        - Yes - -
                        - - - - - -
                        - - -
                        - Team 2 - -
                        - Desmond Wu - -
                        -
                        - Team 2 - -
                        - Chun Ling - -
                        -
                        - No - -
                        - - - - - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Multiple Choice (Multiple Answers) Questions -

                        -
                        -
                        -
                        -

                        - Multiple-choice (multiple answers) question are similar to the single answer version, except that respondents are able to select multiple options as their response. -
                        - The setup and result statistics is similar to the single answer version. See - - above - - for details. -

                        -

                        - - Note: - - Multiple-choice (multiple answers) question allow respondents to select 'None of the above' option as an answer, if 'Minimum number of options a respondent is allowed to select' option is not selected. The result statistics do not contain 'None of the above' responses, as statistics is not calculated for this option. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - Numerical Scale Questions -

                        -
                        -
                        -
                        -

                        - Numerical scale questions allow numerical responses from respondents -

                        -

                        - To set up a numerical scale question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - Specify the minimum and maximum valid input values — values outside of the range specified will not be allowed -
                        6. -
                        7. - Specify the precision at which input values should increment — TEAMMATES uses this value to enumerate all possible acceptable responses -
                        8. -
                        9. - Specify the feedback path that should be used to generate the appropriate feedback recipients -
                        10. -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -   Numerical-scale question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Minimum value: - -
                        -
                        - Increment: - -
                        -
                        - Maximum value: - -
                        -
                        -
                        -
                        -
                        - - [Based on the above settings, acceptable responses are: 1, 2, 3, 4, 5] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving instructor can see your response, but not your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Statistics for numerical scale questions are also provided for instructors. -
                        - TEAMMATES calculates the mean, minimum and maximum values based on all responses given. -

                        -
                        -
                        -
                        - -
                        - - -
                        - - Question 3: - - - Rate the latest assignment's difficulty. (1 = Very Easy, 5 = Very Hard).  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - 4.5 -

                        -
                        -
                        -
                        - -
                        -

                        - 4 -

                        -
                        -
                        -
                        - -
                        -

                        - 5 -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - -
                        - Team 1 - - Alice Betsy - - Team 2 - - Instructor A - - 4 -
                        - Team 2 - - Charlie Davis - - Team 2 - - Instructor A - - 5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Distribute Points (Among Options) Questions -

                        -
                        -
                        -
                        -

                        - Distribute points (among options) questions allow respondents to split a fixed number of points among options that you specify. -

                        -

                        - To setup a distribute points (among options) question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - List all the answer options from which students can choose -
                        6. -
                        7. - Choose the number of points students will get to split among the options — you can also choose to specify - - points to distribute X number of options - - , which gives students a total of - - (specified points) x (number of options) - - points -
                        8. -
                        9. - Specify the feedback path that should be used to generate the appropriate feedback recipients -
                        10. -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -   Distribute points (among options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        - - - - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - In the results view, TEAMMATES provides statistics on the average number of points each option received. -

                        -
                        -
                        -
                        -
                        - - -
                        - - Question 9: - - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - -
                        - Option - - Average Points -
                        - Grades - - 32 -
                        - Fun - - 67 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - -
                        - Team 1 - - Alice Betsy - - Team 1 - - Alice Betsy - -
                          -
                        • - Grades: 20 -
                        • -
                        • - Fun: 80 -
                        • -
                        -
                        - Team 2 - - Charlie Davis - - Team 2 - - Charlie Davis - -
                          -
                        • - Grades: 45 -
                        • -
                        • - Fun: 55 -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Distribute Points (Among Recipients) Questions -

                        -
                        -
                        -
                        -

                        - Distribute points (among recipients) questions allow respondents to split points among a list of recipients. -
                        - For example, if the question recipient is set to the giver's team members, students are required to split points among their team members. -

                        -

                        - To set up a distribute points (among recipients) question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - Choose the number of points students will get to split among the options — you can also choose to specify - - points to distribute X number of options - - , which gives students a total of - - (specified points) x (number of options) - - points -
                        6. -
                        7. - Specify the feedback path that should be used to generate the appropriate feedback recipients -
                        8. -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -   Distribute points (among recipients) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Team Contribution Questions -

                        -
                        -
                        -
                        -

                        - Team contribution questions are a specialized question type designed to evaluate a student's level of contribution in a team. -
                        - They estimate the perceived contribution of a student and prevent students from inflating their own scores. -

                        -

                        - If you do not wish to use TEAMMATES's specialized calculation scheme, you may choose to use a distribute points (among recipients) question type. Distribute points (among recipients) questions calculate the mean of all scores given to the recipient. -

                        -

                        - To set up a team contribution question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        -

                        - The feedback path for this question type is fixed: the feedback giver must be a student, and the student must give feedback about his/her team members and himself. -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -   Team contribution question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - - Allow response giver to select 'Not Sure' as the answer - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - The receiving student can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - The recipient's team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Contribution questions in TEAMMATES are unique because they are targeted at measuring team contributions. -
                        - Thus, TEAMMATES purposefully prevents students from influencing their own ‘perceived contribution’ value. -

                        -

                        - Perceived contribution is calculated based on what a student's other team members perceive as his/her contribution. The student's own opinion about his own contribution is not considered for the calculation. -

                        -

                        - Students enter contribution estimates for self and team members, using the scale - - Equal share + x% - - . e.g. - - Equal share -10% - -
                        - Based on those values, we try to deduce the student's answer to the following two questions: -

                        -
                          -
                        1. - In your opinion, what proportion of the project did you do? -
                        2. -
                        3. - In your opinion, if your teammates were doing the project by themselves without you, how would they compare against each other in terms of contribution? -
                        4. -
                        -

                        - In the calculation, we do not allow (1) to affect (2). We use (2) to calculate the average perceived contribution for each student. A more detailed version of this calculation can be found - - here - - . -

                        -

                        - The results and statistics are presented in the example below. Here is a summary of the terms used: -

                        -
                          -
                        • - - E (Equal share) - - : a relative measure of work done. e.g. For a 3-person team, an ‘Equal share’ means ‘a third of the total work done’. -
                        • -
                        • - - CC (Claimed Contribution) - - : This is what the student claimed he contributed. -
                        • -
                        • - - Ratings Received - - : These are the peer opinions as to how much the student contributed. These values have been adjusted to neutralize any attempts by students to boost their own standing by rating others low. -
                        • -
                        • - - PC (Perceived Contribution) - - : This is the average value of the ‘Ratings Received’. This can be considered as the - - team’s perception of how much the student contributed - - . -
                        • -
                        • - - Diff - - : The difference between the claimed contribution (CC) and the perceived contribution (PC). This value can be used to identify those who have over/under-estimated their own contribution. -
                        • -
                        -

                        - The ratings in a contribution question can be used to identify relative contribution levels of students in a team. If you use these values for grading, also refer the ‘Interpret contribution numbers with care’ caveat in the - - tips for conducting 'team peer evaluation' sessions - - section. -

                        -

                        - The actual contribution values entered by the student may appear different from the values shown in the results because the system ‘normalizes’ those values so that there is no artificial inflation of contribution. For example, if a student says everyone contributed ‘Equal share + 10%’, the system automatically normalizes it to ‘Equal share’ because in reality that is what the student means. ‘Normalize’ here means scale up/down the values so that the - - (sum of contributions) = ( n x Equal Share) - - where - - n - - is the number of students being reviewed. -

                        -
                        -
                        -
                        -
                        - - -
                        - - Question 1: - - - Please rate the estimated contribution of your team members and yourself.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Student - - - - - CC - - - - - - PC - - - - - Diff - - - - Ratings Received -
                        - Team 1 - - Emma Farrell - - - E - - - - E - - - - 0 - - - - E - - , - - E - - , - - E - -
                        - Team 1 - - Danny Engrid - - - E - - - - E - - - - 0 - - - - E - - , - - E - - , - - E - -
                        - Team 1 - - Alice Betsy - - - E - - - - E - - - - 0 - - - - E - - , - - E - - , - - E - -
                        - Team 1 - - Benny Charles - - - E - - - - E - - - - 0 - - - - E - - , - - E - - , - - E - -
                        - Team 2 - - Gene Hudson - - - E +4% - - - - E +5% - - - - +1% - - - - E - - , - - E +9% - - , - - E +7% - -
                        - Team 2 - - Francis Gabriel - - - E +5% - - - - E +6% - - - - +1% - - - - E - - , - - E +7% - - , - - E +10% - -
                        - Team 2 - - Happy Guy - - - E +5% - - - - E +7% - - - - +2% - - - - E - - , - - E +9% - - , - - E +12% - -
                        - Team 2 - - Charlie Davis - - - E -16% - - - - E -18% - - - - -2% - - - - E -19% - - , - - E -19% - - , - - E -17% - -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - -
                        - Team 1 - - Alice Betsy - - Team 1 - - Alice Betsy - - - Equal Share - - -   [Perceived Contribution: - - Equal Share - - ] - -
                        - Team 1 - - Alice Betsy - - Team 1 - - Benny Charles - - - Equal Share - -
                        - Team 1 - - Alice Betsy - - Team 1 - - Danny Engrid - - - Equal Share - -
                        - Team 1 - - Alice Betsy - - Team 1 - - Emma Farrell - - - Equal Share - -
                        - Team 1 - - Benny Charles - - Team 1 - - Alice Betsy - - - Equal Share - -
                        - Team 1 - - Benny Charles - - Team 1 - - Benny Charles - - - Equal Share - - -   [Perceived Contribution: - - Equal Share - - ] - -
                        - Team 1 - - Benny Charles - - Team 1 - - Danny Engrid - - - Equal Share - -
                        - Team 1 - - Benny Charles - - Team 1 - - Emma Farrell - - - Equal Share - -
                        - Team 2 - - Charlie Davis - - Team 2 - - Charlie Davis - - - Equal Share -16% - - -   [Perceived Contribution: - - Equal Share -18% - - ] - -
                        - Team 2 - - Charlie Davis - - Team 2 - - Francis Gabriel - - - Equal Share +6% - -
                        - Team 2 - - Charlie Davis - - Team 2 - - Gene Hudson - - - Equal Share +6% - -
                        - Team 2 - - Charlie Davis - - Team 2 - - Happy Guy - - - Equal Share +6% - -
                        - Team 1 - - Danny Engrid - - Team 1 - - Alice Betsy - - - Equal Share - -
                        - Additional answers omitted -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Rubric Questions -

                        -
                        -
                        -
                        -

                        - Rubric questions allow instructors to create multiple sub-questions with highly customizable choices and descriptions. -

                        -

                        - To respondents, a rubric question will appear as a table that looks similar to the example below. Respondents can choose one answer per row. -

                        -
                        -
                        -
                        -
                        - Question 10: -
                        - - Please answer the following questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student) : -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Strongly Agree -

                        -
                        -

                        - Agree -

                        -
                        -

                        - Disagree -

                        -
                        -

                        - Strongly Disagree -

                        -
                        -

                        - a) This student has contributed significantly to the project. -

                        -
                        - - - Routinely provides useful ideas when participating in the group and in classroom discussion. A definite leader who contributes a lot of effort. - - - - - Usually provides useful ideas when participating in the group and in classroom discussion. A strong group member who tries hard! - - - - - Sometimes provides useful ideas when participating in the group and in classroom discussion. A satisfactory group member who does what is required. - - - - - Rarely provides useful ideas when participating in the group and in classroom discussion. May refuse to participate. - -
                        -

                        - b) This student delivers quality work. -

                        -
                        - - - Provides work of the highest quality. - - - - - Provides high quality work. - - - - - Provides work that occasionally needs to be checked/redone by other group members to ensure quality. - - - - - Provides work that usually needs to be checked/redone by others to ensure quality. - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student) : -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Strongly Agree -

                        -
                        -

                        - Agree -

                        -
                        -

                        - Disagree -

                        -
                        -

                        - Strongly Disagree -

                        -
                        -

                        - a) This student has contributed significantly to the project. -

                        -
                        - - - Routinely provides useful ideas when participating in the group and in classroom discussion. A definite leader who contributes a lot of effort. - - - - - Usually provides useful ideas when participating in the group and in classroom discussion. A strong group member who tries hard! - - - - - Sometimes provides useful ideas when participating in the group and in classroom discussion. A satisfactory group member who does what is required. - - - - - Rarely provides useful ideas when participating in the group and in classroom discussion. May refuse to participate. - -
                        -

                        - b) This student delivers quality work. -

                        -
                        - - - Provides work of the highest quality. - - - - - Provides high quality work. - - - - - Provides work that occasionally needs to be checked/redone by other group members to ensure quality. - - - - - Provides work that usually needs to be checked/redone by others to ensure quality. - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -

                        - To set up a rubric question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - Add choices using the - - Add Column - - button, or delete choices using the - - x - - button at the bottom of each column -
                        6. -
                        7. - Add subquestions using the - - Add Row - - button, or delete subquestions using the - - x - - button to the left of each subquestion -
                        8. -
                        9. - (Optional) Add description text to describe each choice for each subquestion -
                        10. -
                        11. - (Optional) Assign weights to each choice of each sub-question for calculating statistics -
                        12. -
                        13. - Specify the feedback path that should be used to generate the appropriate feedback recipients -
                        14. -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - 1: - - - -  Rubric question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        - - - Choices are weighted - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Choices - - - - - - - - - - -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Result statistics for rubric questions show how often a choice is selected for each sub-question. -
                        - If weights are assigned to the choices, the weights will be used to calculate an average score. -

                        -

                        - - Response Summary Table: - - Each choice cell of each sub-question in the Response summary table has three parts - - Percentage (Response count) [Weight of the choice] - - . Each of the parts are explained below: -

                        -
                          -
                        • - Percentage: Shows the percentage of how often this choice is selected out of all responses for this sub-question. -
                        • -
                        • - Response count: Shows the number of times this choice is selected -
                        • -
                        • - Weight of the choice: Shows the weight attached with this choice of this sub-question. -
                        • -
                        - If weights are assigned to the question, then based on the weight of each choice and the response count of that choice, the overall average score of the sub-question is calculated. -

                        -

                        -

                        - - Per Recipient Statistics: - - This table is only shown to the questions which have weights assigned. Similar to the Response summary table, each choice of each sub-question in this table is divided into two parts, which are - - Response Count [Weight of the choice] - - . Based on the weight assigned to the choice and the response count of that choice, total and average points for the sub-question is calculated for each recipient. -

                        -
                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        - - How well did the team members communicate  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Strongly Disagree -

                        -
                        -

                        - Disagree -

                        -
                        -

                        - Agree -

                        -
                        -

                        - Strongly Agree -

                        -
                        -

                        - Average -

                        -
                        -

                        - a) This student participates well in online discussions. -

                        -
                        - 50% (3) [0] - - 17% (1) [1] - - 17% (1) [2] - - 17% (1) [3] - - 1.00 -
                        -

                        - b) This student completes assigned tasks on time. -

                        -
                        - 0% (0) [0.5] - - 17% (1) [1] - - 67% (4) [1.5] - - 17% (1) [2] - - 1.50 -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team -

                        -
                        -

                        - Recipient Name -

                        -
                        -

                        - Sub Question -

                        -
                        -

                        - Strongly Disagree -

                        -
                        -

                        - Disagree -

                        -
                        -

                        - Agree -

                        -
                        -

                        - Strongly Agree -

                        -
                        -

                        - Total -

                        -
                        -

                        - Average -

                        -
                        - Team 1 - - Jean Wong - - a) This student participates well in online discussions. - - 1 [0.00] - - 1 [1.00] - - 0 [2.00] - - 0 [3.00] - - 1.00 - - 0.50 -
                        - Team 1 - - Jean Wong - - b) This student completes assigned tasks on time. - - 0 [0.50] - - 0 [1.00] - - 2 [1.50] - - 0 [2.00] - - 3.00 - - 1.50 -
                        - Team 1 - - Ravi Kumar - - a) This student participates well in online discussions. - - 1 [0.00] - - 0 [1.00] - - 0 [2.00] - - 1 [3.00] - - 3.00 - - 1.50 -
                        - Team 1 - - Ravi Kumar - - b) This student completes assigned tasks on time. - - 0 [0.50] - - 0 [1.00] - - 1 [1.50] - - 1 [2.00] - - 3.50 - - 1.75 -
                        - Team 1 - - Tom Jacobs - - a) This student participates well in online discussions. - - 1 [0.00] - - 0 [1.00] - - 1 [2.00] - - 0 [3.00] - - 2.00 - - 1.00 -
                        - Team 1 - - Tom Jacobs - - b) This student completes assigned tasks on time. - - 0 [0.50] - - 1 [1.00] - - 1 [1.50] - - 0 [2.00] - - 2.50 - - 1.25 -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Giver - - - - Team - - - - Recipient - - - - Feedback - - - - Actions -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - a) Strongly Disagree - - - (Choice 1) - - -
                        - b) Agree - - - (Choice 3) - - -
                        -
                        -
                        - -
                        - - -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - a) Agree - - - (Choice 3) - - -
                        - b) Disagree - - - (Choice 2) - - -
                        -
                        -
                        - -
                        - - -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - a) Strongly Disagree - - - (Choice 1) - - -
                        - b) Agree - - - (Choice 3) - - -
                        -
                        -
                        - -
                        - - -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - a) Strongly Disagree - - - (Choice 1) - - -
                        - b) Agree - - - (Choice 3) - - -
                        -
                        -
                        - -
                        - - -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - Team 1 - -
                        - Jean Wong - -
                        -
                        - a) Disagree - - - (Choice 2) - - -
                        - b) Agree - - - (Choice 3) - - -
                        -
                        -
                        - -
                        - - -
                        - Team 1 - -
                        - Tom Jacobs - -
                        -
                        - Team 1 - -
                        - Ravi Kumar - -
                        -
                        - a) Strongly Agree - - - (Choice 4) - - -
                        - b) Strongly Agree - - - (Choice 4) - - -
                        -
                        -
                        - -
                        - - -
                        - Team 2 - -
                        - Chun Ling - -
                        -
                        - Team 2 - -
                        - Desmond Wu - -
                        -
                        - - No Response - - -
                        - -
                        -
                        - Team 2 - -
                        - Desmond Wu - -
                        -
                        - Team 2 - -
                        - Chun Ling - -
                        -
                        - - No Response - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Rank (Options) Questions -

                        -
                        -
                        -
                        -

                        - Rank options questions allow respondents to rank the options that you create. -

                        -

                        - To set up a rank options question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - List the options for respondents to rank -
                        6. -
                        7. - (Optional) Allow respondents to give the same rank to multiple options -
                        8. -
                        9. - (Optional) Set the minimum and/or maximum number of options a respondent should rank — setting these values ensures that respondents will rank your desired number of options -
                        10. -
                        11. - Specify the feedback path that should be used to generate the appropriate feedback recipients -
                        12. -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -  Rank (options) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        - - - - -
                        -
                        -
                        -
                        - - - - -
                        -
                        - - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Rank (Recipients) Questions -

                        -
                        -
                        -
                        -

                        - Rank recipients questions allow respondents to rank themselves, students, teams, or instructors. -

                        -

                        -

                        -

                        - To set up a rank recipients question: -

                        -
                          -
                        1. - Specify the question text -
                        2. -
                        3. - (Optional) Add a description for the question -
                        4. -
                        5. - Specify the feedback path that should be used to generate the options respondents get to rank -
                        6. -
                        7. - (Optional) Allow respondents to give the same rank to multiple options -
                        8. -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - Question - - -  Rank (recipients) question - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -

                        -
                        -

                        -
                        - - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Who is giving feedback about whom?) -
                        - - -
                        -
                        -
                        -
                        - - Visibility - - (Who can see the responses?) -
                        - - -
                        - This is the visibility hint as seen by the feedback giver: -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - -
                        -
                        -

                        - When viewing the results of a rank recipients question, you will be able to see the following results for each feedback recipient: -

                        -
                          -
                        • - - Ranks received - - : a list of the ranks which a recipient received from respondents -
                        • -
                        • - - Overall rank - - : the recipient's rank relative to other recipients, as computed by TEAMMATES -
                        • -
                        -

                        - Technical details about how ranks are calculated are available - - here - - . -

                        -
                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Ranks Received - - - - Overall Rank - - -
                        - - - - Team 1 - - 1 , 1 , 2 - - 1 -
                        - - - - Team 2 - - 1 , 2 - - 2 -
                        - - - - Team 3 - - 1 , 2 - - 2 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - - Back to Top - -

                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorHelpPageSearchMultipleKeywords.html b/src/test/resources/pages/instructorHelpPageSearchMultipleKeywords.html deleted file mode 100644 index 8f1f410d272..00000000000 --- a/src/test/resources/pages/instructorHelpPageSearchMultipleKeywords.html +++ /dev/null @@ -1,808 +0,0 @@ -
                        -
                        -
                        -

                        - How do I - - enroll - - - students - - into sections? -

                        -
                        -
                        -
                        -

                        - To specify a section for each student at the time of - - enroll - - ment, include a - - Section - - column in the spreadsheet and ensure it is copied over to the student data text box, together with the rest of the data. To view more information, go to the - - Courses - - page, click on the - - button for any course and scroll down to the - - More Info - - section. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I edit a student's details after - - enroll - - ing the student? -

                        -
                        -
                        -
                        -

                        - To edit the name, section, team, contact email, or instructor comments of Student A from Course B: -

                        -
                          -
                        1. - Go to the - - - Students - - - page and click the panel heading for Course B. You will see a list of - - students - - - enroll - - ed in Course B. -
                        2. -
                        3. - Click the - - button in the last column of the row corresponding to Student A. -
                          -
                        4. -
                        5. - In the new page that opens, edit the relevant fields of Student A's details. The page will look similar to the example below. -
                        6. -
                        7. - Click - - to save your changes to Student A's details. -
                        8. -
                        -

                        - Note that moving a student to a different team (i.e. changing the student's Team ID) will change the student's team in all existing sessions in the course. -

                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I add - - students - - to a course? -

                        -
                        -
                        -
                        -

                        - There are two ways to - - enroll - - - students - - in a course: -

                        -
                          -
                        • - From the - - Home - - page, click on the - - button of the corresponding course, and choose - - - Enroll - - - . -
                        • -
                        • - From the - - Courses - - page, click on the - - button of the corresponding course. -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -

                        - What should I do if my course doesn’t have teams? -

                        -
                        -
                        -
                        -

                        - When you - - enroll - - - students - - in a course, TEAMMATES requires you to specify a - - Team - - for each student. -
                        - If your class does not use groups or teams, simply provide a dummy value in the Team column. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - Is there a size limit for a course? -

                        -
                        -
                        -
                        -

                        - No. However, if courses with an - - enroll - - ment of more than 100 - - students - - need to be - - divided into sections - - . -
                        - TEAMMATES uses section information to organize the results of your sessions into a downloadable report. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - What are sections meant for? -

                        -
                        -
                        -
                        -

                        - Sections are used to organize - - students - - in courses with significantly large numbers of - - students - - . It is mandatory for courses with more than 100 - - students - - to organize - - students - - into sections. Courses with less than 100 - - students - - do not need to be split into sections. -

                        -

                        - Section information is used to paginate the downloadable report of a session's results. When you download the results of a session as an Excel spreadsheet, each section will be given its own page in the file. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view all the responses a student has given and received? -

                        -
                        -
                        -
                        -

                        - To view the responses that Student A from Course B has given and received: -

                        -
                          -
                        1. - Go to the - - - Students - - - page and click the panel heading for Course B. You will see a list of - - students - - - enroll - - ed in the course. -
                        2. -
                        3. - Click - - button corresponding to Student A to access all the responses Student A has given and received. -
                        4. -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view all the responses a student has given and received? -

                        -
                        -
                        -
                        -

                        - To view the responses that Student A from Course B has given and received: -

                        -
                          -
                        1. - Go to the - - - Students - - - page and click the panel heading for Course B. You will see a list of - - students - - - enroll - - ed in the course. -
                        2. -
                        3. - Click - - button corresponding to Student A to access all the responses Student A has given and received. -
                        4. -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I change a student's section? -

                        -
                        -
                        -
                        -

                        - To edit the section Student A from Course B is - - enroll - - ed in: -

                        -
                          -
                        1. - Go to the - - - Students - - - page and click Course B's panel heading. You will see a list of - - students - - - enroll - - ed in Course B. -
                        2. -
                        3. - Click the - - button in the last column of the row corresponding to Student A. -
                        4. -
                        5. - A new page will open that allows you to - - edit the student's profile - - , including a field to edit the student's section. -
                          -
                        6. -
                        7. - After editing the section name, click - - to confirm Student A's new section. -
                        8. -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view a student's profile? -

                        -
                        -
                        -
                        -

                        - To view the profile of Student A from Course B: -

                        -
                          -
                        1. - Go to the - - - Students - - - page and click the panel heading for Course B. You will see a list of - - students - - - enroll - - ed in the course. -
                        2. -
                        3. - Click the - - button in the last column of the row corresponding to Student A. A new page will open displaying the student's profile, similar to the sample profile below. -
                        4. -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Profile -
                        - Short Name (Gender) - - Alice ( - - female - - ) -
                        - Personal Email - - alice@email.com -
                        - Institution - - National University of Singapore -
                        - Nationality - - American -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -

                        - Alice Betsy -

                        -
                        -
                        -
                        - -
                        -

                        - Section A -

                        -
                        -
                        -
                        - -
                        -

                        - Team A -

                        -
                        -
                        -
                        - -
                        -

                        - alice@email.com -

                        -
                        -
                        -
                        - -
                        -

                        - Alice is a transfer student. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - The student's profile page displays the student's details and course-related information, such as: -

                        -
                          -
                        • - - Section name - - : the name of the section you - - enroll - - ed the student in. This only appears if sections are created for the course. -
                        • -
                        • - - Team name - - : the name of the team you - - enroll - - ed the student in, or - - NA - - if the student does not belong to a team. -
                        • -
                        • - - Official email address - - : the email address that will be used to contact the student, taken from - - enroll - - ment information -
                        • -
                        • - - Comments - - : additional student information you entered in the Comments column during - - enroll - - ment -
                        • -
                        -

                        - Below this is the - - More Info - - section containing a personal description given by the student, if any. -
                        - You can press the - - - button in the top-right corner to display the information in a lightbox for better readability. -

                        -
                        - -
                        -
                        -
                        -
                        - - -
                        - More Info -
                        -

                        - Hi I am Alice Betsy! I am from Colorado, America. I am a programming and gaming enthusiast. Aspiring to become a Software Architect in a well reputed organization. -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHelpPageSearchSingleKeyword.html b/src/test/resources/pages/instructorHelpPageSearchSingleKeyword.html deleted file mode 100644 index baf8334ff6f..00000000000 --- a/src/test/resources/pages/instructorHelpPageSearchSingleKeyword.html +++ /dev/null @@ -1,14406 +0,0 @@ -
                        -
                        -
                        -

                        - How do I archive a - - course - - ? -

                        -
                        -
                        -
                        -

                        - When a - - course - - has ended, you can archive it so that it doesn't appear in your home page. - - Course - - , student and session details of an archived - - course - - are still stored on TEAMMATES. However, you cannot edit, create feedback sessions for or enroll students in an archived - - course - - . -

                        -

                        - In your - - Home - - page, you will see panels for each - - course - - and a table of feedback sessions inside it, similar to the example below. -
                        - Click on the - - button on the card heading of the - - course - - you want to archive. -
                        - Then select - - in the drop-down menu and click - - OK - - to confirm. -

                        -

                        - You can also archive a - - course - - from the - - - Course - - s - - page. -
                        - Under 'Active - - Course - - s', click on the - - button in the row corresponding to the - - course - - you want to archive. -

                        -
                        -
                        -
                        -
                        -
                        - - [AI532] : Artificial Intelligence - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I unarchive an archived - - course - - ? -

                        -
                        -
                        -
                        -

                        - To unarchive a - - course - - , first - - view the - - course - - - that you would like to unarchive in the - - - Course - - s - - page. -
                        - Then, click on the - - button corresponding to the - - course - - you want to unarchive. -

                        -
                        -

                        - - - Archived - - course - - s -

                        - - - - - - - - - - - - - - - - - -
                        - - Course - - ID - - - - - Course - - Name - - - - Creation Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I view - - course - - s I have archived? -

                        -
                        -
                        -
                        -

                        - You can view all your archived - - course - - s by navigating to the - - - Course - - s - - page. -
                        - Scroll to the - - Archived - - course - - s - - heading, which looks similar to this: -

                        -
                        -

                        - - - Archived - - course - - s -

                        - - - - - - - - - - - - - - - - - -
                        - - Course - - ID - - - - - Course - - Name - - - - Creation Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - - -
                        -
                        -

                        - The - - course - - s you have previously archived are listed here. In order to access information in an archived - - course - - , - - unarchive the - - course - - - . -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I restore a deleted - - course - - ? -

                        -
                        -
                        -
                        -

                        - To restore a deleted - - course - - , first - - view the - - course - - - that you would like to restore in the - - - Course - - s - - page. -
                        - Then, click on the - - button corresponding to the - - course - - you want to restore. -

                        -
                        -

                        - - - Deleted - - course - - s -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - - Course - - ID - - - - - Course - - Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - After restoring the - - course - - , all the information relevant to the - - course - - (e.g. instructors, sessions, students) will also be restored. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I permanently delete a - - course - - ? -

                        -
                        -
                        -
                        -

                        - To permanently delete a - - course - - , first - - view the - - course - - - that you would like to permanently delete in the - - - Course - - s - - page. -
                        - Then, click on the - - button corresponding to the - - course - - you want to delete. -

                        -
                        -

                        - - - Deleted - - course - - s -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - - Course - - ID - - - - - Course - - Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - AI532 - - Artificial Intelligence - - 20 Jan 2018 - - 10 Mar 2018 - - - -
                        -
                        -
                        -
                        -
                        -

                        - After deleting the - - course - - , all the information relevant to the - - course - - (e.g. instructors, sessions, students) will also be permanently deleted. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I delete students from a - - course - - ? -

                        -
                        -
                        -
                        -

                        - To remove Student A from - - Course - - B: -

                        -
                          -
                        1. - - View the student list - - of - - Course - - B. -
                        2. -
                        3. - In the row corresponding to Student A, click the - - button. -
                        4. -
                        5. - Click - - OK - - to confirm that you would like to delete Student A from - - Course - - B. -
                        6. -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Is there a size limit for a - - course - - ? -

                        -
                        -
                        -
                        -

                        - No. However, if - - course - - s with an enrollment of more than 100 students need to be - - divided into sections - - . -
                        - TEAMMATES uses section information to organize the results of your sessions into a downloadable report. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - What should I do if my - - course - - doesn’t have teams? -

                        -
                        -
                        -
                        -

                        - When you enroll students in a - - course - - , TEAMMATES requires you to specify a - - Team - - for each student. -
                        - If your class does not use groups or teams, simply provide a dummy value in the Team column. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I add students to a - - course - - ? -

                        -
                        -
                        -
                        -

                        - There are two ways to enroll students in a - - course - - : -

                        -
                          -
                        • - From the - - Home - - page, click on the - - button of the corresponding - - course - - , and choose - - Enroll - - . -
                        • -
                        • - From the - - - Course - - s - - page, click on the - - button of the corresponding - - course - - . -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -

                        - How do I add instructors to my - - course - - ? -

                        -
                        -
                        -
                        -

                        - From your - - Home - - or - - - Course - - s - - page, click the - - button of the - - course - - you would like to edit. You will be directed to the - - Edit - - Course - - - page, which will look similar to the example below. -
                        - Here, you can add new instructors to the - - course - - , edit existing instructors' details, and delete instructors from the - - course - - , depending on your access privileges. -

                        -
                        -
                        -
                        - - Instructor 3: - - -
                        -
                        -
                        - - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -

                        - - Co-owner - - -  View Details - -

                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - To add an instructor: -

                        -
                          -
                        1. - Click the - - button at the bottom of the page. A form will appear for you to specify the necessary information about the new instructor. -
                        2. -
                        3. - Fill in the name, email, role, and access level of the instructor you want to add. If you are not clear about certain input field, hover your cursor over the input field to view the tooltip for explanation of the field. -
                          -
                        4. -
                        5. - Click - - to add the instructor. -
                        6. -
                        -
                        -
                        -
                        - - Instructor 2: - -
                        -
                        -
                        - - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -  Co-owner: Can do everything - - View Details - -
                        - -  Manager: Can do everything except for deleting/restoring the - - course - - - View Details - -
                        - -  Observer: Can only view information(students, submissions, comments etc.).  Cannot edit/delete/submit anything. - - View Details - -
                        - -  Tutor: Can view student details, give/view comments, submit/view responses for sessions - - View Details - -
                        - -  Custom: No access by default. Any access needs to be granted explicitly. -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        diff --git a/src/test/resources/pages/instructorHomeCourseArchiveSuccessful.html b/src/test/resources/pages/instructorHomeCourseArchiveSuccessful.html deleted file mode 100644 index d1ef6f688e8..00000000000 --- a/src/test/resources/pages/instructorHomeCourseArchiveSuccessful.html +++ /dev/null @@ -1,732 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - The course CHomeUiT.CS1101 has been archived. It will not appear in the home page any more. You can access archived courses from the 'Courses' tab. -
                        - Go there to undo the archiving and bring the course back to the home page. -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeCourseDeleteSuccessful.html b/src/test/resources/pages/instructorHomeCourseDeleteSuccessful.html deleted file mode 100644 index 0b2434eee15..00000000000 --- a/src/test/resources/pages/instructorHomeCourseDeleteSuccessful.html +++ /dev/null @@ -1,167 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - The course CHomeUiT.CS2104 has been deleted. You can restore it from the 'Courses' tab. -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTML.html b/src/test/resources/pages/instructorHomeHTML.html deleted file mode 100644 index 6601b4aaa80..00000000000 --- a/src/test/resources/pages/instructorHomeHTML.html +++ /dev/null @@ -1,876 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLEmpty.html b/src/test/resources/pages/instructorHomeHTMLEmpty.html deleted file mode 100644 index 033bcda29cc..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLEmpty.html +++ /dev/null @@ -1,177 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - New to TEAMMATES? You may wish to have a look at our - - Getting Started Guide - - . -
                        - A video tour is also available in our - - home page - - . -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLPersistenceCheck.html b/src/test/resources/pages/instructorHomeHTMLPersistenceCheck.html deleted file mode 100644 index efcd446a787..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLPersistenceCheck.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - Home [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Account creation is still in progress. Please reload the page after sometime. -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/instructorHomeHTMLResponseRateFail.html b/src/test/resources/pages/instructorHomeHTMLResponseRateFail.html deleted file mode 100644 index ee59f89fbdc..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLResponseRateFail.html +++ /dev/null @@ -1,877 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - Failed. - - Try again? - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLResponseRatePass.html b/src/test/resources/pages/instructorHomeHTMLResponseRatePass.html deleted file mode 100644 index 73ea303474a..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLResponseRatePass.html +++ /dev/null @@ -1,874 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - 0 / 0 - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLSortByDate.html b/src/test/resources/pages/instructorHomeHTMLSortByDate.html deleted file mode 100644 index 6601b4aaa80..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLSortByDate.html +++ /dev/null @@ -1,876 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLSortById.html b/src/test/resources/pages/instructorHomeHTMLSortById.html deleted file mode 100644 index 4340219af71..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLSortById.html +++ /dev/null @@ -1,876 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLSortByName.html b/src/test/resources/pages/instructorHomeHTMLSortByName.html deleted file mode 100644 index 919c3102e32..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLSortByName.html +++ /dev/null @@ -1,876 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLSortSessionsByEndDate.html b/src/test/resources/pages/instructorHomeHTMLSortSessionsByEndDate.html deleted file mode 100644 index 6f539fe975d..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLSortSessionsByEndDate.html +++ /dev/null @@ -1,876 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLSortSessionsByName.html b/src/test/resources/pages/instructorHomeHTMLSortSessionsByName.html deleted file mode 100644 index 9ad3e9535f7..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLSortSessionsByName.html +++ /dev/null @@ -1,876 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLSortSessionsByStartDate.html b/src/test/resources/pages/instructorHomeHTMLSortSessionsByStartDate.html deleted file mode 100644 index c7cb9445607..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLSortSessionsByStartDate.html +++ /dev/null @@ -1,876 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLWithHelperView.html b/src/test/resources/pages/instructorHomeHTMLWithHelperView.html deleted file mode 100644 index 74f75f1b611..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLWithHelperView.html +++ /dev/null @@ -1,852 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS1101] : Programming Methodology - -
                        -
                        - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.CS2104] : Programming Language Concepts - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - First Feedback Session - - - 1 Apr 12:00 NOON - - - - 30 Apr 11:59 PM - - - - Open - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Second Feedback Session - - - 29 Mar 10:59 PM - - - - 30 Apr 12:00 NOON - - - - Awaiting - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Third Feedback Session - - - 10 Apr 11:59 PM - - - - 30 Apr 11:59 PM - - - - Closed - - - - Not Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        - Fourth Feedback Session - - - 5 Apr 11:59 AM - - - - 20 Apr 12:00 NOON - - - - Closed - - - - Published - - - - Show - - - - Edit - - - Delete - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeHTMLWithUnloadedCourse.html b/src/test/resources/pages/instructorHomeHTMLWithUnloadedCourse.html deleted file mode 100644 index 127ac71739f..00000000000 --- a/src/test/resources/pages/instructorHomeHTMLWithUnloadedCourse.html +++ /dev/null @@ -1,641 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ins.wit-demo1] : Sample Course 101 - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ins.wit-demo2] : Sample Course 201 - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ins.wit-demo3] : Sample Course 301 - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ins.wit-Unloaded] : Sample Course Unloaded - -
                        -
                        - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeNewInstructorWithSampleCourse.html b/src/test/resources/pages/instructorHomeNewInstructorWithSampleCourse.html deleted file mode 100644 index 72ffec53928..00000000000 --- a/src/test/resources/pages/instructorHomeNewInstructorWithSampleCourse.html +++ /dev/null @@ -1,328 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - New to TEAMMATES? You may wish to have a look at our - - Getting Started Guide - - . -
                        - A video tour is also available in our - - home page - - . -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [newIns.wit-demo] : Sample Course 101 - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeNewInstructorWithoutSampleCourse.html b/src/test/resources/pages/instructorHomeNewInstructorWithoutSampleCourse.html deleted file mode 100644 index 5ef7479d82f..00000000000 --- a/src/test/resources/pages/instructorHomeNewInstructorWithoutSampleCourse.html +++ /dev/null @@ -1,177 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - New to TEAMMATES? You may wish to have a look at our - - Getting Started Guide - - . -
                        - A video tour is also available in our - - home page - - . -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorHomeTestingSanitization.html b/src/test/resources/pages/instructorHomeTestingSanitization.html deleted file mode 100644 index 6452efd5020..00000000000 --- a/src/test/resources/pages/instructorHomeTestingSanitization.html +++ /dev/null @@ -1,313 +0,0 @@ -
                        -
                        -
                        -

                        - Home -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - - - -
                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        -
                        -
                        - - Sort By: - -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [CHomeUiT.idOfTestingSanitizationCourse] : Testing<script> alert('hi!'); </script> - -
                        -
                        - - - - - - - - -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - Session Name - - - - Start Date - - - - End Date - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - This course does not have any sessions yet. - - - - - - -
                        -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorOfCS2105WithMultipleSoftDeletedSessions.html b/src/test/resources/pages/instructorOfCS2105WithMultipleSoftDeletedSessions.html deleted file mode 100644 index a86e975ecab..00000000000 --- a/src/test/resources/pages/instructorOfCS2105WithMultipleSoftDeletedSessions.html +++ /dev/null @@ -1,1024 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - Computer Networks -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CFeedbackUiT.CS2105 - - First Session #1 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        - CFeedbackUiT.CS2105 - - Second Session #2 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        - CFeedbackUiT.CS2105 - - Third Session #3 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorOfCS2106WithMultipleSoftDeletedSessions.html b/src/test/resources/pages/instructorOfCS2106WithMultipleSoftDeletedSessions.html deleted file mode 100644 index 99ab5c4e4f5..00000000000 --- a/src/test/resources/pages/instructorOfCS2106WithMultipleSoftDeletedSessions.html +++ /dev/null @@ -1,1024 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Feedback Session -

                        -
                        -
                        -
                        -
                        -

                        - Create new -

                        -
                        -
                        - -
                        -
                        -
                        - - - - -
                        -
                        -
                        -

                        - Or: -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - UTC -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - Operating Systems -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - 38 - - characters left -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -

                        - Please answer all the given questions. -

                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - Session is visible at submission opening time, responses are only visible when you publish the results. - - - [Change] - -
                        -
                        - - Emails are sent when session opens (within 15 mins), 24 hrs before session closes and when results are published. - - - [Change] - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                        - - - - -
                        -

                        - Note: The table above doesn't contain sessions from archived courses and soft-deleted courses. To view sessions from an archived course, unarchive the course first; to view sessions from a soft-deleted course, restore the course first. -

                        -
                        -
                        -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -
                        -

                        - - - Deleted feedback sessions -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Session Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CFeedbackUiT.CS2106 - - First Session #1 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        - CFeedbackUiT.CS2106 - - Second Session #2 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        - CFeedbackUiT.CS2106 - - Third Session #3 - - 2 Apr 2012 - - 2 Jun 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        diff --git a/src/test/resources/pages/instructorSearchPageDefault.html b/src/test/resources/pages/instructorSearchPageDefault.html deleted file mode 100644 index 42db3d99576..00000000000 --- a/src/test/resources/pages/instructorSearchPageDefault.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - Search [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Search Tips: -
                        -
                          -
                        • - Put more keywords to search for more precise results. -
                        • -
                        • - Put quotation marks around words - - "[any word]" - - to search for an exact phrase in an exact order. -
                        • -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - diff --git a/src/test/resources/pages/instructorSearchPageSearchCommentsAsHelper.html b/src/test/resources/pages/instructorSearchPageSearchCommentsAsHelper.html deleted file mode 100644 index 56644b7d04b..00000000000 --- a/src/test/resources/pages/instructorSearchPageSearchCommentsAsHelper.html +++ /dev/null @@ -1,183 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Questions, responses, comments on responses - -
                        -
                        -
                        -
                        - - Session: searchUI.First feedback session (searchUI.idOfTypicalCourse1) - -
                        -
                        -
                        -
                        - - Question 2 - - : Rate 1 other student's product -
                        - - - - - - - - - - - - - - - -
                        - - From: - - student3 In Course1 (Team 1.2) - - To: - - searchUI.student2InCourse1@gmail.tmt -
                        - - - Response - - : - - - Response - - from student 3 "to" student 2. Multiline test. -
                        - - Comment - - (s): -
                        -
                          -
                        • -
                          -
                          - - From: Anonymous [Tue, 03 Feb 2015, 01:59 AM SAST] - - - -
                          -
                          -
                          -
                          -
                          - Anonymous - - comment - - to feedback Question 2 -
                          -
                        • -
                        • -
                          -
                          - - From: Instructor Instructor2 Course1 [Wed, 04 Feb 2015, 01:59 AM SAST] - - - -
                          -
                          -
                          -
                          -
                          - Instructor 2 - - comment - - to feedback Question 2 (Student 3 see this as anonymous - - comment - - ) -
                          -
                        • -
                        • -
                          -
                          - - From: Instructor Instructor2 Course1 [Thu, 05 Feb 2015, 01:59 AM SAST] (last edited by Instructor Instructor3 Course1 at Fri, 06 Feb 2015, 01:59 AM SAST) - - - -
                          -
                          -
                          -
                          -
                          - Instructor 3 edited - - comment - - to feedback Question 2 -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorSearchPageSearchFeedbackResponseComments.html b/src/test/resources/pages/instructorSearchPageSearchFeedbackResponseComments.html deleted file mode 100644 index 6965971bf6b..00000000000 --- a/src/test/resources/pages/instructorSearchPageSearchFeedbackResponseComments.html +++ /dev/null @@ -1,263 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Questions, responses, comments on responses - -
                        -
                        -
                        -
                        - - Session: searchUI.First feedback session (searchUI.idOfTypicalCourse1) - -
                        -
                        -
                        -
                        - - Question 1 - - : What is the best selling point of your product? -
                        - - - - - - - - - - - - - - - -
                        - - From: - - student1 In Course1</option></td></div>'\" (Team 1.1</td></div>'\") - - To: - - student1 In Course1</option></td></div>'\" (Team 1.1</td></div>'\") -
                        - - Response: - - Student 1 self feedback. -
                        - - Comment - - (s): -
                        -
                          -
                        • -
                          -
                          - - From: Instructor Instructor1 Course1 [Mon, 02 Mar 2026, 01:59 AM SAST] - - - -
                          -
                          -
                          -
                          -
                          - Instructor 1 - - comment - - to student 1 self feedback -
                          -
                        • -
                        -
                        -
                        -
                        -
                        - - Question 2 - - : Rate 1 other student's product -
                        - - - - - - - - - - - - - - - -
                        - - From: - - student3 In Course1 (Team 1.2) - - To: - - searchUI.student2InCourse1@gmail.tmt -
                        - - Response: - - Response from student 3 "to" student 2. Multiline test. -
                        - - Comment - - (s): -
                        -
                          -
                        • -
                          -
                          - - From: Instructor Instructor1 Course1 [Mon, 02 Feb 2015, 01:59 AM SAST] - - - -
                          -
                          -
                          -
                          -
                          - Instructor 1 - - comment - - to feedback Question 2 -
                          -
                        • -
                        • -
                          -
                          - - From: Anonymous [Tue, 03 Feb 2015, 01:59 AM SAST] - - - -
                          -
                          -
                          -
                          -
                          - Anonymous - - comment - - to feedback Question 2 -
                          -
                        • -
                        • -
                          -
                          - - From: Instructor Instructor2 Course1 [Wed, 04 Feb 2015, 01:59 AM SAST] - - - -
                          -
                          -
                          -
                          -
                          - Instructor 2 - - comment - - to feedback Question 2 (Student 3 see this as anonymous - - comment - - ) -
                          -
                        • -
                        • -
                          -
                          - - From: Instructor Instructor2 Course1 [Thu, 05 Feb 2015, 01:59 AM SAST] (last edited by Instructor Instructor3 Course1 at Fri, 06 Feb 2015, 01:59 AM SAST) - - - -
                          -
                          -
                          -
                          -
                          - Instructor 3 edited - - comment - - to feedback Question 2 -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorSearchPageSearchNone.html b/src/test/resources/pages/instructorSearchPageSearchNone.html deleted file mode 100644 index 0a10ea4262d..00000000000 --- a/src/test/resources/pages/instructorSearchPageSearchNone.html +++ /dev/null @@ -1,66 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Search Tips: -
                        -
                          -
                        • - Put more keywords to search for more precise results. -
                        • -
                        • - Put quotation marks around words - - "[any word]" - - to search for an exact phrase in an exact order. -
                        • -
                        -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent1.html b/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent1.html deleted file mode 100644 index 41735b7e640..00000000000 --- a/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent1.html +++ /dev/null @@ -1,340 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Students - -
                        -
                        -
                        -
                        - - [searchUI.idOfTypical - - Course1 - - ] - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section 1 - - Team 1.1</td></div>'" - - - student1 - - - In - - - Course1 - - </option></td></div>'" - - Jo - - in - - ed - - searchUI. - - student1 - - - In - - - Course1 - - @gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section 1 - - Team 1.1</td></div>'" - - student2 2 - - In - - - Course1 - - - Jo - - in - - ed - - searchUI.student2.2 - - In - - - Course1 - - @gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section 1 - - Team 1.1</td></div>'" - - student2 - - In - - - Course1 - - - Jo - - in - - ed - - searchUI.student2 - - In - - - Course1 - - @gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section 1 - - Team 1.2 - - student3 - - In - - - Course1 - - - Jo - - in - - ed - - searchUI.student3 - - In - - - Course1 - - @gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent2.html b/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent2.html deleted file mode 100644 index 4ac387a54d0..00000000000 --- a/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent2.html +++ /dev/null @@ -1,319 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Students - -
                        -
                        -
                        -
                        - - [searchUI.idOfTypicalCourse1] - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section 1 - - Team 1.1</td></div>'" - - student1 - - In - - Course1</option></td></div>'" - - Jo - - in - - ed - - searchUI.student1 - - In - - Course1@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        - No Image Given -
                        -
                        - Section 1 - - Team 1.1</td></div>'" - - - student2 - - 2 - - In - - Course1 - - Jo - - in - - ed - - searchUI. - - student2 - - .2 - - In - - Course1@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section 1 - - Team 1.1</td></div>'" - - - student2 - - - In - - Course1 - - Jo - - in - - ed - - searchUI. - - student2 - - - In - - Course1@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section 1 - - Team 1.2 - - student3 - - In - - Course1 - - Jo - - in - - ed - - searchUI.student3 - - In - - Course1@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent2WithExactString.html b/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent2WithExactString.html deleted file mode 100644 index b1bf51e9fb6..00000000000 --- a/src/test/resources/pages/instructorSearchPageSearchStudentsForStudent2WithExactString.html +++ /dev/null @@ -1,147 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Students - -
                        -
                        -
                        -
                        - - [searchUI.idOfTypicalCourse1] - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section 1 - - Team 1.1</td></div>'" - - - student2 2 In Course1 - - - Joined - - searchUI.student2.2InCourse1@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorSearchPageSearchTestingSanitization.html b/src/test/resources/pages/instructorSearchPageSearchTestingSanitization.html deleted file mode 100644 index ac6abf259ca..00000000000 --- a/src/test/resources/pages/instructorSearchPageSearchTestingSanitization.html +++ /dev/null @@ -1,249 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Questions, responses, comments on responses - -
                        -
                        -
                        -
                        - - - Session - - : - - Normal - - - feedback - - - session - - - name - - (searchUI.idOfTestingSanitizationCourse) - -
                        -
                        -
                        -
                        - - Question 1 - - : Testing quotation marks '" Testing unclosed tags </td></div> Testing script injection <script> alert('hello'); </script> -
                        - - - - - - - - - - - - - - - -
                        - - From: - - Stud1<script> alert(\"hi!\"); </script> (Team tags&\"</td>) - - To: - - Stud1<script> alert(\"hi!\"); </script> (Team tags&\"</td>) -
                        - - Response: - - - Feedback - - reponse. Testing quotation marks '" Testing unclosed tags Testing script injection -
                        - Comment(s): -
                        -
                          -
                        • -
                          -
                          - - From: inst'\"/><script>alert('hi!');</script> Instructor<script> alert('hi!'); </script> [Mon, 02 Mar 2026, 01:59 AM SAST] (last edited by inst'\"/><script>alert('hi!');</script> Instructor<script> alert('hi!'); </script> at Wed, 04 Mar 2026, 01:59 AM SAST) - - - -
                          -
                          -
                          -
                          -
                          - Comment value. Testing quotation marks '" Testing unclosed tags Testing script injection -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Students - -
                        -
                        -
                        -
                        - - [searchUI.idOfTestingSanitizationCourse] - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student - - Name - - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section'"/></td> - - Team tags&"</td> - - Stud1<script> alert("hi!"); </script> - - Joined - - searchUI. - - normal - - @sanitization.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentList.html b/src/test/resources/pages/instructorStudentList.html deleted file mode 100644 index 18a7337c40b..00000000000 --- a/src/test/resources/pages/instructorStudentList.html +++ /dev/null @@ -1,724 +0,0 @@ -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Courses - -
                        -
                        -
                        - - -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        - - Sections - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Teams - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Emails - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        - CCSDetailsUiT.alice.tmms@gmail.tmt -
                        -
                        - benny.c.tmms@gmail.tmt -
                        -
                        - hugh.i.tmms@gmail.tmt -
                        -
                        - ivan.j.tmms@gmail.tmt -
                        -
                        - jack.k.tmms@gmail.tmt -
                        - - -
                        - CCSDetailsUiT.charlie.tmms@gmail.tmt -
                        -
                        - denny.c.tmms@gmail.tmt -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course2] : - - Name of Course 2 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section A</option></td>tags and char here</div>&'" - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section B - - Team 2 - - Benny Charles - - Yet to join - - benny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 2 - - Hugh Ivanov - - Yet to join - - hugh.i.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 3 - - Ivan James - - Yet to join - - ivan.j.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 3 - - Jack Khan - - Yet to join - - jack.k.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course3] : - - Name of Course 3 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 1</td>tags and char here</div>&'" - - Benny Charles - - Yet to join - - benny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Team 2 - - Charlie D - - Joined - - CCSDetailsUiT.charlie.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 2 - - Denny Charlés - - Yet to join - - denny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListPageDisplayArchivedCourses.html b/src/test/resources/pages/instructorStudentListPageDisplayArchivedCourses.html deleted file mode 100644 index fbc11428c1d..00000000000 --- a/src/test/resources/pages/instructorStudentListPageDisplayArchivedCourses.html +++ /dev/null @@ -1,572 +0,0 @@ -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Courses - -
                        -
                        -
                        - - -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        - - Sections - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Teams - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Emails - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        - CCSDetailsUiT.alice.tmms@gmail.tmt -
                        -
                        - benny.c.tmms@gmail.tmt -
                        -
                        - CCSDetailsUiT.charlie.tmms@gmail.tmt -
                        -
                        - denny.c.tmms@gmail.tmt -
                        -
                        - ann.tmms@gmail.tmt -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course1] : - - Name of Course 1 -
                        -
                        -
                        - - - - - - -
                        - There are no students in this course -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course3] : - - Name of Course 3 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 1</td>tags and char here</div>&'" - - Benny Charles - - Yet to join - - benny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Team 2 - - Charlie D - - Joined - - CCSDetailsUiT.charlie.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 2 - - Denny Charlés - - Yet to join - - denny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course4] : - - Name of Course 4 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</td>tags and char here</div>&'" - - Ann - - Yet to join - - ann.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListPageHideArchivedCourses.html b/src/test/resources/pages/instructorStudentListPageHideArchivedCourses.html deleted file mode 100644 index 418e92b7b99..00000000000 --- a/src/test/resources/pages/instructorStudentListPageHideArchivedCourses.html +++ /dev/null @@ -1,442 +0,0 @@ -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Courses - -
                        -
                        -
                        - - -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        - - Sections - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Teams - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Emails - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        - CCSDetailsUiT.alice.tmms@gmail.tmt -
                        -
                        - benny.c.tmms@gmail.tmt -
                        -
                        - CCSDetailsUiT.charlie.tmms@gmail.tmt -
                        -
                        - denny.c.tmms@gmail.tmt -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course1] : - - Name of Course 1 -
                        -
                        -
                        - - - - - - -
                        - There are no students in this course -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course3] : - - Name of Course 3 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 1</td>tags and char here</div>&'" - - Benny Charles - - Yet to join - - benny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Team 2 - - Charlie D - - Joined - - CCSDetailsUiT.charlie.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 2 - - Denny Charlés - - Yet to join - - denny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListPageNoCourse.html b/src/test/resources/pages/instructorStudentListPageNoCourse.html deleted file mode 100644 index b0c05779173..00000000000 --- a/src/test/resources/pages/instructorStudentListPageNoCourse.html +++ /dev/null @@ -1,139 +0,0 @@ -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        - -
                        -
                        - There are no course or students information to be displayed -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorStudentListPageNoStudent.html b/src/test/resources/pages/instructorStudentListPageNoStudent.html deleted file mode 100644 index 1794e99953e..00000000000 --- a/src/test/resources/pages/instructorStudentListPageNoStudent.html +++ /dev/null @@ -1,177 +0,0 @@ -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Courses - -
                        -
                        -
                        - - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Sections - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Teams - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Emails - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course1] : - - Name of Course 1 -
                        -
                        -
                        - - - - - - -
                        - There are no students in this course -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListPageSearchNoMatch.html b/src/test/resources/pages/instructorStudentListPageSearchNoMatch.html deleted file mode 100644 index 8419aac75ed..00000000000 --- a/src/test/resources/pages/instructorStudentListPageSearchNoMatch.html +++ /dev/null @@ -1,53 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No results found. -
                        -
                        - -
                        diff --git a/src/test/resources/pages/instructorStudentListPageSearchStudent.html b/src/test/resources/pages/instructorStudentListPageSearchStudent.html deleted file mode 100644 index 55b6dbf24e5..00000000000 --- a/src/test/resources/pages/instructorStudentListPageSearchStudent.html +++ /dev/null @@ -1,152 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Students - -
                        -
                        -
                        -
                        - - [course3] - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 2 - - - Charlie - - D - - Joined - - CCSDetailsUiT. - - charlie - - .tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListPageSearchStudentMultiple.html b/src/test/resources/pages/instructorStudentListPageSearchStudentMultiple.html deleted file mode 100644 index 1133333515c..00000000000 --- a/src/test/resources/pages/instructorStudentListPageSearchStudentMultiple.html +++ /dev/null @@ -1,246 +0,0 @@ -
                        -
                        -
                        -

                        - Search -

                        -
                        -
                        -
                        -
                        -
                        -
                        - - - - -
                        - -
                        -
                        -
                          -
                        • - - -
                        • -
                        • - - -
                        • -
                        • - - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - - Students - -
                        -
                        -
                        -
                        - - [course2] - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section A</option></td>tags and char here</div>&'" - - Team 1</td>tags and char here</div>&'" - - - Alice - - </option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT. - - alice - - .tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        - - [course3] - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</td>tags and char here</div>&'" - - - Alice - - </option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT. - - alice - - .tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListPageTestingSanitization.html b/src/test/resources/pages/instructorStudentListPageTestingSanitization.html deleted file mode 100644 index a675c0d8e75..00000000000 --- a/src/test/resources/pages/instructorStudentListPageTestingSanitization.html +++ /dev/null @@ -1,168 +0,0 @@ -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Courses - -
                        -
                        -
                        - - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - Sections - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Teams - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Emails - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [CSListUiT.idOfTestingSanitizationCourse] : - - Testing<script> alert('hi!'); </script> -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListPageWithPicture.html b/src/test/resources/pages/instructorStudentListPageWithPicture.html deleted file mode 100644 index 9c1faaba4a5..00000000000 --- a/src/test/resources/pages/instructorStudentListPageWithPicture.html +++ /dev/null @@ -1,673 +0,0 @@ -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Courses - -
                        -
                        -
                        - - -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        - - Sections - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Teams - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Emails - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        - CCSDetailsUiT.alice.tmms@gmail.tmt -
                        -
                        - hugh.i.tmms@gmail.tmt -
                        -
                        - ivan.j.tmms@gmail.tmt -
                        -
                        - jack.k.tmms@gmail.tmt -
                        - -
                        - benny.c.tmms@gmail.tmt -
                        -
                        - CCSDetailsUiT.charlie.tmms@gmail.tmt -
                        -
                        - denny.c.tmms@gmail.tmt -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course2] : - - Name of Course 2 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        -
                        - No Image Given -
                        -
                        - Section A</option></td>tags and char here</div>&'" - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section B - - Team 2 - - Hugh Ivanov - - Yet to join - - hugh.i.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 3 - - Ivan James - - Yet to join - - ivan.j.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 3 - - Jack Khan - - Yet to join - - jack.k.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course3] : - - Name of Course 3 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 1</td>tags and char here</div>&'" - - Benny Charles - - Yet to join - - benny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        - No Image Given -
                        -
                        - Team 2 - - Charlie D - - Joined - - CCSDetailsUiT.charlie.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 2 - - Denny Charlés - - Yet to join - - denny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentListWithHelperView.html b/src/test/resources/pages/instructorStudentListWithHelperView.html deleted file mode 100644 index 4238ac2f459..00000000000 --- a/src/test/resources/pages/instructorStudentListWithHelperView.html +++ /dev/null @@ -1,849 +0,0 @@ - - - - Student List [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Student List -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - - -
                        -
                        -
                        -
                        -
                        -

                        - Filter Students -

                        -
                        -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Courses - -
                        -
                        -
                        - - -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        - - Sections - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Teams - -
                        -
                        -
                        - - -
                        -
                        -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - Emails - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        - CCSDetailsUiT.alice.tmms@gmail.tmt -
                        -
                        - benny.c.tmms@gmail.tmt -
                        -
                        - hugh.i.tmms@gmail.tmt -
                        -
                        - ivan.j.tmms@gmail.tmt -
                        -
                        - jack.k.tmms@gmail.tmt -
                        - - -
                        - CCSDetailsUiT.charlie.tmms@gmail.tmt -
                        -
                        - denny.c.tmms@gmail.tmt -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course2] : - - Name of Course 2 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Section - - - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Section A</option></td>tags and char here</div>&'" - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Section B - - Team 2 - - Benny Charles - - Yet to join - - benny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 2 - - Hugh Ivanov - - Yet to join - - hugh.i.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 3 - - Ivan James - - Yet to join - - ivan.j.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Section B - - Team 3 - - Jack Khan - - Yet to join - - jack.k.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        - - - - Enroll - -
                        -
                        - - [course3] : - - Name of Course 3 -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Photo - - Team - - - - Student Name - - - - Status - - - - Email - - - - Action(s) -
                        - - - Team 1</td>tags and char here</div>&'" - - Alice</option></td>tags and char here</div>&'" - - Joined - - CCSDetailsUiT.alice.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 1</td>tags and char here</div>&'" - - Benny Charles - - Yet to join - - benny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        - - - Team 2 - - Charlie D - - Joined - - CCSDetailsUiT.charlie.tmms@gmail.tmt - - - View - - - Edit - - - Delete - - - All Records - -
                        - - - Team 2 - - Denny Charlés - - Yet to join - - denny.c.tmms@gmail.tmt - - - View - - - Edit - - - Send Invite - - - Delete - - - All Records - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 5 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/instructorStudentRecords.html b/src/test/resources/pages/instructorStudentRecords.html deleted file mode 100644 index 2f348e0ddc9..00000000000 --- a/src/test/resources/pages/instructorStudentRecords.html +++ /dev/null @@ -1,1008 +0,0 @@ - - - - Benny Charlés's Records<small class="muted"> - ISR.CS2104</small> [Instructor] - - - - - - - - - - -
                        -
                        -
                        -

                        - Benny Charlés's Records - - - ISR.CS2104 - -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - - Profile Details - - (submitted by student) -

                        -
                        - Short Name (Gender) - - Ben ( - - male - - ) -
                        - Personal Email - - - Not Specified - -
                        - Institution - - TEAMMATES Test Institute 7 -
                        - Nationality - - Singaporean -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -

                        - More Info: -

                        -

                        - This is a lot of info! -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : First feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Benny Charlés (Team 1) - -
                        -
                        -
                        -
                        - From: - - Alice Betsy (Team 2) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Benny is a good student. -
                        -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 01:59 AM SAST] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - First comment to Alice about feedback to Benny from different instructor -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Mon, 02 Mar 2026, 01:59 AM SAST] (last edited by Teammates Test at Tue, 03 Mar 2026, 01:59 AM SAST) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor second comment to Alice about feedback to Benny -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 01:59 AM SAST] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor third comment to Alice about feedback to Benny -
                          - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Benny Charlés (Team 1) - -
                        -
                        -
                        -
                        - To: - - Alice Betsy (Team 2) - -
                        -
                        -
                        -
                        - Question 4: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - It's good -
                        -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Benny's comment to alice -
                        -
                      • -
                          -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 01:59 AM SAST] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor comment to Benny about feedback to Alice -
                          - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Charlie Davis (Team 1) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Charlie did alot of work. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Danny starts with D. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : Second feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        - No feedback by Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : 3rd feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        - No feedback by Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 10 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - diff --git a/src/test/resources/pages/instructorStudentRecordsPageEditedComment.html b/src/test/resources/pages/instructorStudentRecordsPageEditedComment.html deleted file mode 100644 index 6d1dbe5dc42..00000000000 --- a/src/test/resources/pages/instructorStudentRecordsPageEditedComment.html +++ /dev/null @@ -1,889 +0,0 @@ -
                        -
                        -
                        -

                        - Benny Charlés's Records - - - ISR.CS2104 - -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - - Profile Details - - (submitted by student) -

                        -
                        - Short Name (Gender) - - Ben ( - - male - - ) -
                        - Personal Email - - - Not Specified - -
                        - Institution - - TEAMMATES Test Institute 7 -
                        - Nationality - - Singaporean -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -

                        - More Info: -

                        -

                        - This is a lot of info! -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : First feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Benny Charlés (Team 1) - -
                        -
                        -
                        -
                        - From: - - Alice Betsy (Team 2) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Benny is a good student. -
                        -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 01:59 AM SAST] (last edited by Teammates Test at ${datetime.now} SAST) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - First edited comment to Alice about feedback to Benny from different Instructor -

                          -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Mon, 02 Mar 2026, 01:59 AM SAST] (last edited by Teammates Test at ${datetime.now} SAST) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - Instructor second edited comment to Alice about feedback to Benny -

                          -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 01:59 AM SAST] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor third comment to Alice about feedback to Benny -
                          - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Benny Charlés (Team 1) - -
                        -
                        -
                        -
                        - To: - - Alice Betsy (Team 2) - -
                        -
                        -
                        -
                        - Question 4: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - It's good -
                        -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Benny's comment to alice -
                        -
                      • -
                          -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 01:59 AM SAST] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor comment to Benny about feedback to Alice -
                          - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Charlie Davis (Team 1) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Charlie did alot of work. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Danny starts with D. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : Second feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        - No feedback by Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : 3rd feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        - No feedback by Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentRecordsPageEditedCommentOfDifferentInstructor.html b/src/test/resources/pages/instructorStudentRecordsPageEditedCommentOfDifferentInstructor.html deleted file mode 100644 index 02c49fdde1a..00000000000 --- a/src/test/resources/pages/instructorStudentRecordsPageEditedCommentOfDifferentInstructor.html +++ /dev/null @@ -1,885 +0,0 @@ -
                        -
                        -
                        -

                        - Benny Charlés's Records - - - ISR.CS2104 - -

                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - - Profile Details - - (submitted by student) -

                        -
                        - Short Name (Gender) - - Ben ( - - male - - ) -
                        - Personal Email - - - Not Specified - -
                        - Institution - - TEAMMATES Test Institute 7 -
                        - Nationality - - Singaporean -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -

                        - More Info: -

                        -

                        - This is a lot of info! -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : First feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Benny Charlés (Team 1) - -
                        -
                        -
                        -
                        - From: - - Alice Betsy (Team 2) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Benny is a good student. -
                        -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test2 [Tue, 03 Apr 2012, 01:59 AM SAST] (last edited by Teammates Test at ${datetime.now} SAST) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          -

                          - First edited comment to Alice about feedback to Benny from different Instructor -

                          -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Mon, 02 Mar 2026, 01:59 AM SAST] (last edited by Teammates Test at Tue, 03 Mar 2026, 01:59 AM SAST) - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor second comment to Alice about feedback to Benny -
                          - -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 01:59 AM SAST] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor third comment to Alice about feedback to Benny -
                          - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - Benny Charlés (Team 1) - -
                        -
                        -
                        -
                        - To: - - Alice Betsy (Team 2) - -
                        -
                        -
                        -
                        - Question 4: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - It's good -
                        -
                        -
                        -
                      • -
                        -
                        - - Comment by response giver. - - - -
                        -
                        -
                        -
                        -
                        - Benny's comment to alice -
                        -
                      • -
                          -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 01:59 AM SAST] - - - -
                          -
                          -
                          - - - - - - - - - - - -
                          - - - - -
                          -
                          -
                          - Instructor comment to Benny about feedback to Alice -
                          - -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Charlie Davis (Team 1) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Charlie did alot of work. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - Danny Engrid (Team 2) - -
                        -
                        -
                        -
                        - Question 2: - - Rate 5 other students' products - -
                        -
                        -
                        -
                        - Danny starts with D. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : Second feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        - No feedback by Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : 3rd feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        - No feedback by Benny Charlés (Team 1) found -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentRecordsPageMixedQuestionType.html b/src/test/resources/pages/instructorStudentRecordsPageMixedQuestionType.html deleted file mode 100644 index 02df78c22db..00000000000 --- a/src/test/resources/pages/instructorStudentRecordsPageMixedQuestionType.html +++ /dev/null @@ -1,1784 +0,0 @@ -
                        -
                        -
                        -

                        - student1 In Course1</td></div>'"'s Records - - - FSQTT.idOfTypicalCourse1 - -

                        -
                        -
                        -
                        - Normally, we would show the student’s profile here. However, this student has not created a profile yet -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : CONSTSUM Session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - From: - - Instructor1 Course1 (Instructors) - -
                        -
                        -
                        -
                        - Question 3: - - How much has each student worked?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 30 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Grades: 19 -
                        • -
                        • - Fun: 81 -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Grades: 19 -
                        • -
                        • - Fun: 81 -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : CONTRIB Session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - How much has each team member including yourself, contributed to the project?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share -5% - - -   [Perceived Contribution: - - N/A - - ] - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - How much has each team member including yourself, contributed to the project?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student2 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - How much has each team member including yourself, contributed to the project?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share -20% - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student3 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - How much has each team member including yourself, contributed to the project?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share +10% - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student4 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - How much has each team member including yourself, contributed to the project?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share +30% - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : CONTRIB Session Student Anonymised - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for student1 In Course1</td></div>'" (Team 1.1</td></div>'") found -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - Anonymous student ${participant.hash} - -
                        -
                        -
                        -
                        - Question 1: - - How much has each team member including yourself, contributed to the project?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - Equal Share - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : MCQ Session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - It's good -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - What can be improved for this class?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Lecture notes -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - It's good -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - It's good -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - What can be improved for this class?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - Lecture notes -
                        -
                        -
                        -
                        -
                        -
                        - Question 4: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - It's good -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : MSQ Session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - It's good -
                        • -
                        • - It's perfect -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - Choose all the food you like  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Pizza -
                        • -
                        • - Pasta -
                        • -
                        • - Chicken rice -
                        • -
                        • - Hotdog -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - What do you like best about our product?  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - It's good -
                        • -
                        • - It's perfect -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 3: - - Choose all the food you like  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - Pizza -
                        • -
                        • - Pasta -
                        • -
                        • - Chicken rice -
                        • -
                        • - Hotdog -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : NUMSCALE Session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Rate our product.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : RANK Session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Rank the other students.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 4 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - Team 1.1</td></div>'" - -
                        -
                        -
                        -
                        - Question 2: - - Rank the areas of improvement you think your team should make progress in.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                          -
                        • - 1: Quality of work -
                        • -
                        • - 2: Quality of progress reports -
                        • -
                        • - 3: Time management -
                        • -
                        • - 4: Teamwork and communication -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Rank the other students.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 4 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student2 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Rank the other students.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 3 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student3 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Rank the other students.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 2 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student4 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Rank the other students.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - 1 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : RUBRIC Session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) No - - - (Choice 2) - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - From: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - To: - - student1 In Course1</td></div>'" (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) No - - - (Choice 2) - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student2 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) No - - - (Choice 2) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - Question 2: - - Please choose the best choice for the following sub-questions. Only first subquestion has responses  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) - - - No Response - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student3 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) Yes - - - (Choice 1) - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - To: - - student4 In Course1 (Team 1.1</td></div>'") - -
                        -
                        -
                        -
                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - a) - - - No Response - - -
                        - b) Yes - - - (Choice 1) - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentRecordsPageNoRecords.html b/src/test/resources/pages/instructorStudentRecordsPageNoRecords.html deleted file mode 100644 index d7f164e50d4..00000000000 --- a/src/test/resources/pages/instructorStudentRecordsPageNoRecords.html +++ /dev/null @@ -1,28 +0,0 @@ -
                        -
                        -
                        -

                        - Alice Betsy's Records - - - ISR.NoEval - -

                        -
                        -
                        -
                        - Normally, we would show the student’s profile here. However, this student has not created a profile yet -
                        -
                        - No records were found for this student -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentRecordsPageWithPrivateFeedback.html b/src/test/resources/pages/instructorStudentRecordsPageWithPrivateFeedback.html deleted file mode 100644 index 9008a273ca8..00000000000 --- a/src/test/resources/pages/instructorStudentRecordsPageWithPrivateFeedback.html +++ /dev/null @@ -1,57 +0,0 @@ -
                        -
                        -
                        -

                        - Teammates Test's Records - - - ISR.CS1101 - -

                        -
                        -
                        -
                        - Normally, we would show the student’s profile here. However, this student has not created a profile yet -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - -
                        - - - Feedback Session : Instructor feedback session - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - No feedback for Teammates Test (Team 1) found -
                        -
                        -
                        -
                        -
                        - No feedback by Teammates Test (Team 1) found -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentRecordsPageWithScriptInjectionProfile.html b/src/test/resources/pages/instructorStudentRecordsPageWithScriptInjectionProfile.html deleted file mode 100644 index 9e1ffc39bdb..00000000000 --- a/src/test/resources/pages/instructorStudentRecordsPageWithScriptInjectionProfile.html +++ /dev/null @@ -1,131 +0,0 @@ -
                        -
                        -
                        -

                        - Stud1"</td></div><script>alert('hi!');</script>'s Records - - - ISR.sanitizationCourse - -

                        -
                        -
                        -
                        - No records were found for this student -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - - Profile Details - - (submitted by student) -

                        -
                        - Short Name (Gender) - - Stud1<script> alert('hi!'); </script> ( - - - Not Specified - - - ) -
                        - Personal Email - - weird&'@gmail.tmt -
                        - Institution - - inst<script> alert('hi!'); </script> -
                        - Nationality - - American -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - -

                        - More Info: -

                        -

                        - I am just a student :P<script> alert('hi!'); </script> -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/instructorStudentRecordsWithHelperView.html b/src/test/resources/pages/instructorStudentRecordsWithHelperView.html deleted file mode 100644 index 2cacd94bb23..00000000000 --- a/src/test/resources/pages/instructorStudentRecordsWithHelperView.html +++ /dev/null @@ -1,28 +0,0 @@ -
                        -
                        -
                        -

                        - Benny Charlés's Records - - - ISR.CS2104 - -

                        -
                        -
                        -
                        - Normally, we would show the student’s profile here. However, you do not have access to view this student's profile -
                        -
                        - No records were found for this student -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/otherInstructorCoursesMultipleSoftDeletedCourses.html b/src/test/resources/pages/otherInstructorCoursesMultipleSoftDeletedCourses.html deleted file mode 100644 index bff435e2440..00000000000 --- a/src/test/resources/pages/otherInstructorCoursesMultipleSoftDeletedCourses.html +++ /dev/null @@ -1,246 +0,0 @@ -
                        -
                        -
                        -

                        - Add New Course -

                        -
                        -
                        -
                        -
                        - - - -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - You do not seem to have any courses. Use the form above to create a course. -
                        -
                        -
                        -
                        -

                        - Active courses -

                        - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                        - - - - - - - -
                        -
                        -
                        - No records found. -
                        -
                        -
                        -
                        -

                        - - - Deleted courses -

                        -
                        - -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Course ID - - - - Course Name - - - - Creation Date - - - - Deletion Date - - - - Action(s) -
                        - CCAddUiTest.CS2106 - - Operating Systems - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        - CCAddUiTest.CS2107 - - Introduction to Information Security - - 2 Apr 2012 - - 12 Apr 2012 - - - Restore - - - Delete Permanently - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/pageNotFound.html b/src/test/resources/pages/pageNotFound.html deleted file mode 100644 index 0d77becd42a..00000000000 --- a/src/test/resources/pages/pageNotFound.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - TEAMMATES - - - - - - - -
                        - -
                        -
                        - -

                        - The page you are looking for is not there. -
                        -
                        - Make sure that the URL is correct, or go to - - main page - -
                        -
                        -

                        -
                        -
                        -
                        -
                        -

                        - Uh oh! Something went wrong. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - We are sorry this happened. You can safely ignore this error page in the following cases: -

                        -
                          -
                        • - Retrying the same action a few minutes later succeeds (i.e. no more error page). -
                        • -
                        • - You loaded an outdated page unintentionally. e.g. some browsers auto-load the pages that were loaded in the previous browsing session. -
                        • -
                        -

                        - However, if you keep seeing this page on multiple failed attempts when trying to perform some action in TEAMMATES, please help us troubleshoot the problem by providing us some additional details using the form below. -

                        -
                        -
                        -
                        -
                        - -
                        - - Note: This is the TEAMMATES support email. It has been pre-filled for your convenience and is not editable. - - -
                        -
                        - -
                        - - Note: This field has also been pre-filled for convenience. Feel free to change it to suit your needs. - - -
                        -
                        - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - diff --git a/src/test/resources/pages/studentCourseJoinConfirmationHTML.html b/src/test/resources/pages/studentCourseJoinConfirmationHTML.html deleted file mode 100644 index b1af4d5ea9d..00000000000 --- a/src/test/resources/pages/studentCourseJoinConfirmationHTML.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - Course Join Confirmation - - - - - - - - - - -
                        -
                        -
                        -

                        - Course Join Confirmation -

                        -
                        - -
                        -
                        -
                        -

                        - Confirm your Google account -

                        -
                        -
                        -

                        - You are currently logged in as - - - ${test.student1} - - - . -
                        - If this is not you please - - log out - - and re-login using your own Google account. -
                        - If this is you, please confirm below to complete your registration. -
                        -

                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/studentCourseJoinConfirmationLoggedInHTML.html b/src/test/resources/pages/studentCourseJoinConfirmationLoggedInHTML.html deleted file mode 100644 index 8e13dfdbbb7..00000000000 --- a/src/test/resources/pages/studentCourseJoinConfirmationLoggedInHTML.html +++ /dev/null @@ -1,60 +0,0 @@ -
                        -
                        -
                        -

                        - Course Join Confirmation -

                        -
                        - -
                        -
                        -
                        -

                        - Confirm your Google account -

                        -
                        -
                        -

                        - You are currently logged in as - - - ${test.student1} - - - . You have been redirected to this page because you navigated to a link for the course - - SFResultsUiT.CS2104 - - , which you have not been registered in. -
                        - If you wish to register as - - ${test.student1} - - , please confirm below to complete your registration. -
                        - If you wish to register with another Google ID or do not wish to register for this course, please - - log out - - , log in with your desired Google ID if necessary, and navigate to the link again. -
                        -

                        - -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentExtendedFeedbackResultsPageRubric.html b/src/test/resources/pages/studentExtendedFeedbackResultsPageRubric.html deleted file mode 100644 index a7216d42c56..00000000000 --- a/src/test/resources/pages/studentExtendedFeedbackResultsPageRubric.html +++ /dev/null @@ -1,1573 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Fourth Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - Recipient: None. See responses: students, instructor.   - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary (of visible responses) - - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - a) You have done a good job. -

                        -
                        - 67% (2) - - 33% (1) -
                        -

                        - b) You have tried your best. -

                        -
                        - 33% (1) - - 67% (2) -
                        -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - You have done a good job. - - - - -
                        - You have tried your best. - - - - -
                        -
                        - - - From: - - - Anonymous student -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - You have done a good job. - - - - -
                        - You have tried your best. - - - - -
                        -
                        - - - From: - - - Anonymous student -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - You have done a good job. - - - - -
                        - You have tried your best. - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Recipient: OWN_TEAM_MEMBERS_INCLUDING_SELF. See responses: recipients, instructor.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary (of received responses) - - -
                        -
                        - - - Exclude self evaluation - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Average - - -

                        -
                        -

                        - a) This student has done a good job. -

                        -
                        - 50% (1) [1.01] - - 50% (1) [-0.99] - - 0.01 -
                        -

                        - b) This student has tried his/her best. -

                        -
                        - 50% (1) [1.01] - - 50% (1) [-0.99] - - 0.01 -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - - '"'" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team - - -

                        -
                        -

                        - Recipient Name - - -

                        -
                        -

                        - Sub Question - - -

                        -
                        -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Total - - -

                        -
                        -

                        - Average - - -

                        -
                        - Team 1 - - - '" - - Alice Betsy - - a) This student has done a good job. - - 1 [1.01] - - 1 [-0.99] - - 0.02 - - 0.01 -
                        - Team 1 - - - '" - - Alice Betsy - - b) This student has tried his/her best. - - 1 [1.01] - - 1 [-0.99] - - 0.02 - - 0.01 -
                        - Team 1 - - - '" - - Benny Charles - - a) This student has done a good job. - - 1 [1.01] - - 0 [-0.99] - - 1.01 - - 1.01 -
                        - Team 1 - - - '" - - Benny Charles - - b) This student has tried his/her best. - - 1 [1.01] - - 0 [-0.99] - - 1.01 - - 1.01 -
                        -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        - - - From: - - - Anonymous student -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Recipient: TEAMS. See responses: recipients, instructor.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary (of received responses) - - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Average - - -

                        -
                        -

                        - a) This student has done a good job. -

                        -
                        - 100% (1) [2] - - 0% (0) [0] - - 2.00 -
                        -

                        - b) This student has tried his/her best. -

                        -
                        - 0% (0) [2] - - 100% (1) [0] - - 0.00 -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team - - -

                        -
                        -

                        - Recipient Name - - -

                        -
                        -

                        - Sub Question - - -

                        -
                        -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Total - - -

                        -
                        -

                        - Average - - -

                        -
                        - - Team 1 - - - '" - - a) This student has done a good job. - - 1 [2] - - 0 [0] - - 2.00 - - 2.00 -
                        - - Team 1 - - - '" - - b) This student has tried his/her best. - - 0 [2] - - 1 [0] - - 0.00 - - 0.00 -
                        - - Team 2 - - - '" - - a) This student has done a good job. - - 1 [2] - - 0 [0] - - 2.00 - - 2.00 -
                        - - Team 2 - - - '" - - b) This student has tried his/her best. - - 1 [2] - - 0 [0] - - 2.00 - - 2.00 -
                        -
                        -
                        -
                        -
                        -
                        - - To: - - Your Team (Team 1</option><option value="dump"></td><td>'") -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Team 2</option><option value="dump"></td><td>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 4: - - Recipient: OWN_TEAM_MEMBERS. See responses: recipients, instructor. No received responses.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary (of received responses) - - -
                        - -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Average - - -

                        -
                        -

                        - a) This student has done a good job. -

                        -
                        - - (0) [0.01] - - - (0) [-0.01] - - - -
                        -

                        - b) This student has tried his/her best. -

                        -
                        - - (0) [0.01] - - - (0) [-0.01] - - - -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team - - -

                        -
                        -

                        - Recipient Name - - -

                        -
                        -

                        - Sub Question - - -

                        -
                        -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Total - - -

                        -
                        -

                        - Average - - -

                        -
                        - Team 1 - - - '" - - Benny Charles - - a) This student has done a good job. - - 1 [0.01] - - 0 [-0.01] - - 0.01 - - 0.01 -
                        - Team 1 - - - '" - - Benny Charles - - b) This student has tried his/her best. - - 1 [0.01] - - 0 [-0.01] - - 0.01 - - 0.01 -
                        -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageCONSTSUM.html b/src/test/resources/pages/studentFeedbackResultsPageCONSTSUM.html deleted file mode 100644 index 194ebfcccd3..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageCONSTSUM.html +++ /dev/null @@ -1,383 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - CONSTSUM Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - How important are the following factors to you? Give points accordingly.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        -
                          -
                        • - Grades: 20 -
                        • -
                        • - Fun: 80 -
                        • -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        -
                          -
                        • - Grades: 30 -
                        • -
                        • - Fun: 70 -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Split points among 3 students.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - 80 -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - 100 -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - 20 -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 200 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Split points among your team members by how much they contributed.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 99 -
                        -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 101 -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageCONTRIB.html b/src/test/resources/pages/studentFeedbackResultsPageCONTRIB.html deleted file mode 100644 index 8025d6e7521..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageCONTRIB.html +++ /dev/null @@ -1,220 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - CONTRIB Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have not received any new feedback but you may review your own submissions below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - Rate the contribution by yourself and your team members.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - Comparison of work distribution -
                        - - - - - - - - - - - - - -
                        - - - My view: - - - - - - of me: - - - - E +10% - - - - - of others: - - - - E - -   - - - - - -
                        - - Team's view: - - - - - of me: - - - - N/A - - - - - of others: - - - - E - -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageEmpty.html b/src/test/resources/pages/studentFeedbackResultsPageEmpty.html deleted file mode 100644 index e1b5a0d4375..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageEmpty.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - Feedback Results - - - - - - - - - - -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Third Session -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have not received any new feedback but you may review your own submissions below. -
                        -
                        - -
                        -
                        - There are currently no responses for you for this feedback session. -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/studentFeedbackResultsPageMCQ.html b/src/test/resources/pages/studentFeedbackResultsPageMCQ.html deleted file mode 100644 index cb923bab040..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageMCQ.html +++ /dev/null @@ -1,471 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - MCQ Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - What is the best selling point of your product?  - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - Algo -
                        -
                          -
                        • -
                          -
                          - - Comment by response giver. - - - -
                          -
                          -
                          -
                          -
                          - Alice comment for herself -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate 3 other students' products  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Good -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Good -
                        -
                          -
                        • -
                          -
                          - - Comment by response giver. - - - -
                          -
                          -
                          -
                          -
                          - Drop out comment to danny -
                          -
                        • -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Good -
                        -
                        -
                        -
                        - - To: - - Danny Engrid -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - OK -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Give feedback to your team mates  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Benny Charles -
                        - Can improve -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 4: - - Choose the best student in the course.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Danny Engrid -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Danny -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 5: - - Choose the best team in the course.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Benny Charles -
                        - Team 1 -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageMSQ.html b/src/test/resources/pages/studentFeedbackResultsPageMSQ.html deleted file mode 100644 index 3db4e83ccc1..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageMSQ.html +++ /dev/null @@ -1,617 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - MSQ Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - What is the best selling point of your product?  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        -
                          -
                        • - Algo -
                        • -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        -
                          -
                        • - UI -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate 3 other students' products  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        -
                          -
                        • - Good -
                        • -
                        • - OK -
                        • -
                        -
                        - - - From: - - - Anonymous student -
                        -
                          -
                        • - Poor -
                        • -
                        -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        -
                          -
                        • - OK -
                        • -
                        -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        -
                          -
                        • - OK -
                        • -
                        • - Poor -
                        • -
                        -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        -
                          -
                        • - Good -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Give feedback to your team mates  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        -
                          -
                        • - Can improve -
                        • -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        -
                          -
                        • - Can improve -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 4: - - Choose the students you were impressed by in the course.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        -
                          -
                        • - Benny -
                        • -
                        • - Danny -
                        • -
                        -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        -
                          -
                        • - Danny -
                        • -
                        • - Alice -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 5: - - Choose the teams you were impressed by in the course.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        -
                          -
                        • - Team 1 -
                        • -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        -
                          -
                        • - Team 1 -
                        • -
                        • - Team 2 -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageNUMSCALE.html b/src/test/resources/pages/studentFeedbackResultsPageNUMSCALE.html deleted file mode 100644 index 36a68dd2322..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageNUMSCALE.html +++ /dev/null @@ -1,1415 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - NUMSCALE Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - Rate your product?  - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 1 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate others' product?  - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 5 -
                        -
                        -
                        -
                        - - To: - - Danny Engrid -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 3.5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Rate your team's product?  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Summary of responses received by you - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - - - - Average excluding self response - - - -
                        - Team 1</td></div>'" - - You - - 2.25 - - 2.5 - - 2 - - 2.25 -
                        -
                        -
                        -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Benny Charles -
                        - 2.5 -
                        - - - From: - - - Danny Engrid -
                        - 2 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 4: - - Rate the class  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - -
                        - - - - General - - 0.25 - - 2.5 - - -2 -
                        -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - - -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - 2.5 -
                        - - - From: - - - Anonymous student -
                        - -2 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 5: - - Rate other team's products  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Summary of responses received by your team - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - - - - Average excluding self response - - - -
                        - - Your Team (Team 1</td></div>'") - - 3.75 - - 4 - - 3.5 - - 3.75 -
                        -
                        -
                        -
                        -
                        -
                        - - To: - - Your Team (Team 1</td></div>'") -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Team 2 -
                        - 3.5 -
                        - - - From: - - - Team 3 -
                        - 4 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 6: - - Rate other team's products. Responses are visible to the entire class  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - - - - Average excluding self response - - - -
                        - - Your Team (Team 1</td></div>'") - - 4 - - 4.5 - - 3.5 - - 4 -
                        - - Team 2 - - 4.25 - - 5 - - 3.5 - - 4.25 -
                        -
                        -
                        -
                        -
                        -
                        - - To: - - Your Team (Team 1</td></div>'") -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Team 2 -
                        - 3.5 -
                        - - - From: - - - Team 2 -
                        - 4.5 -
                        -
                        -
                        -
                        - - To: - - Team 2 -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Your Team (Team 1</td></div>'") -
                        - 3.5 -
                        - - - From: - - - Your Team (Team 1</td></div>'") -
                        - 5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 7: - - Rate your team member's individual products, including your own  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Summary of responses received by you - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - - - - Average excluding self response - - - -
                        - Team 1</td></div>'" - - You - - 3.25 - - 3.5 - - 3 - - 3 -
                        -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - 3.5 -
                        - - - From: - - - Benny Charles -
                        - 3 -
                        -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 8: - - Rate every student's individual products. Responses are visible to the entire class  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - - Average - - - - - - Max - - - - - - Min - - - - - - Average excluding self response - - - -
                        - Team 2 - - Charlie Davis - - 2.75 - - 4.5 - - 1 - - 2.75 -
                        - Team 1</td></div>'" - - Benny Charles - - 2.75 - - 4 - - 1.5 - - 2.75 -
                        -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - 4 -
                        - - - From: - - - Anonymous student -
                        - 1.5 -
                        -
                        -
                        -
                        - - To: - - Charlie Davis -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - 4.5 -
                        - - - From: - - - Anonymous student -
                        - 1 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 9: - - Rate other teams' products. Responses, but not giver or recipient names, are visible to the entire class  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous team -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - 2 -
                        -
                        -
                        -
                        - - To: - - Anonymous team -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - 3 -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Team 2 -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 5 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 10: - - Rate teammates, recipient hidden.   - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Charlie Davis -
                        - 2 -
                        - - - From: - - - Emily -
                        - 1 -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 4.5 -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageNewlyRegistered.html b/src/test/resources/pages/studentFeedbackResultsPageNewlyRegistered.html deleted file mode 100644 index c08e4eed1eb..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageNewlyRegistered.html +++ /dev/null @@ -1,387 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have been successfully added to the course [SFResultsUiT.CS2104] Programming Language Concepts. -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - What is the best selling point of your product? - -

                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Alice self feedback. -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [Mon, 02 Mar 2026, 07:59 AM SGT] (last edited by Teammates Test at Tue, 03 Mar 2026, 07:59 AM SGT) - - - -
                          -
                          -
                          -
                          -
                          - Instructor first comment to Alice -
                          -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 07:59 AM SGT] - - - -
                          -
                          -
                          -
                          -
                          - Instructor second comment to Alice -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate 3 other students' products - -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Dropout. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Benny. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Danny. -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Alice from Dropout. -
                        -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Benny from Dropout. -
                        -
                        -
                        -
                        - - To: - - Danny Engrid -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Danny from Dropout. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Give feedback to 3 other teams. - -

                        -
                        -
                        - - To: - - Team 1</td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - Your Team (Team 2) -
                        - Team 2 (danny) to team 1 -
                        -
                        -
                        -
                        - - To: - - Your Team (Team 2) -
                        - - - - - - - - - -
                        - - - From: - - - Team 1</td></div>'" -
                        - alice to team 2 -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageOpen.html b/src/test/resources/pages/studentFeedbackResultsPageOpen.html deleted file mode 100644 index 92cd0ed2130..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageOpen.html +++ /dev/null @@ -1,628 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - What is the best selling point of your product? - -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - Alice self feedback. -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [Mon, 02 Mar 2026, 07:59 AM SGT] (last edited by Teammates Test at Tue, 03 Mar 2026, 07:59 AM SGT) - - - -
                          -
                          -
                          -
                          -
                          - Instructor first comment to Alice -
                          -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 07:59 AM SGT] - - - -
                          -
                          -
                          -
                          -
                          - Instructor second comment to Alice -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate 3 other students' products - -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Alice from Dropout. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Benny from Dropout. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Danny from Dropout. -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Benny. -
                        -
                        -
                        -
                        - - To: - - Danny Engrid -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Danny. -
                        -
                        -
                        -
                        - - To: - - Drop out -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Dropout. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Feedback to class - -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - - -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - Secret feedback about class. (to nobody test) -
                        - - - From: - - - Anonymous student -
                        - Secret feedback about class. (to nobody test) -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 4: - - Give feedback to 3 other teams. - -

                        -
                        -
                        - - To: - - Your Team (Team 1</td></div>'") -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Team 2 -
                        - Team 2 (danny) to team 1 -
                        - - - From: - - - Team 3 -
                        - Team 3 to Team 1 multiline special char test -
                        -
                        -
                        -
                        - - To: - - Team 2 -
                        - - - - - - - - - -
                        - - - From: - - - Your Team (Team 1</td></div>'") -
                        - alice to team 2 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 5: - - Give feedback to your team mates - -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Benny Charles -
                        - Teammate feedback from benny -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Teammate feedback from alice -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 6: - - Give feedback on how well the team worked together. - -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Team 1</td></div>'" -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - Feedback from alice to the team -
                        - - - From: - - - Benny Charles -
                        - Feedback from benny to the team -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 7: - - This question should be hidden. - -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Teammates Test -
                        - Feedback from instructor to Alice -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageRank.html b/src/test/resources/pages/studentFeedbackResultsPageRank.html deleted file mode 100644 index 83f89fcbf0a..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageRank.html +++ /dev/null @@ -1,1062 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Student Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - As a student, rank every instructors on their feedback provided. Give the quality that the instructor should improve on most rank 1. You can give the same rank multiple times  - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Teammates Helper who can only see section 1 -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        -
                          -
                        • - 1: Approachability -
                        • -
                        • - 3: Timeliness -
                        • -
                        • - 3: Level of detail -
                        • -
                        • - 4: Effort -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - As a student, rank the instructors  - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Teammates Helper who can only see section 1 -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 1 -
                        -
                        -
                        -
                        - - To: - - Teammates Test -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 2 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Rank you and your team members, own team members can see the responses but not recipient name  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Summary of responses received by you - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Ranks Received - - - - Self Rank - - - - Overall Rank - - - - Overall Rank Excluding Self - - -
                        - Team 1</option><option value="dump"></td><td>'" - - Alice Betsy</option></td></div>'" - - 2 , 2 - - 2 - - 2 - - 1 -
                        -
                        -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Benny Charles -
                        - 1 -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - 2 -
                        - - - From: - - - Benny Charles -
                        - 2 -
                        -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 1 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 4: - - Rank up to 7 students in the course. All students can see the responses, but not the giver's name.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Charlie Davis -
                        - 2 -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - 2 -
                        - - - From: - - - Anonymous student -
                        - 2 -
                        -
                        -
                        -
                        - - To: - - Charlie Davis -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 1 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 5: - - Rank the other teams, you can give the same rank multiple times.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Your Team (Team 1</option><option value="dump"></td><td>'") -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Charlie Davis -
                        - 2 -
                        - - - From: - - - Emily F. -
                        - 1 -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Team 2 -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 1 -
                        -
                        -
                        -
                        - - To: - - Team 3 -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - 1 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 6: - - As a student, rank the areas of improvement you think you should make progress on.   - - - [more] - -
                        - -
                        -
                        -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        -
                          -
                        • - 1: Related work -
                        • -
                        • - 2: Sleep -
                        • -
                        • - 3: Style -
                        • -
                        • - 4: Quality of work -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 7: - - As an instructor, rank for the 4 students you are mentoring, their areas of their reports that were good.   - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Teammates Test -
                        -
                          -
                        • - 1: Future work -
                        • -
                        • - 2: Progress made -
                        • -
                        • - 3: Related work -
                        • -
                        • - 4: Organisation -
                        • -
                        • - 5: Style -
                        • -
                        • - 6: Motivation -
                        • -
                        • - 7: Pictures -
                        • -
                        • - 8: Graphs -
                        • -
                        • - 9: Reporting -
                        • -
                        • - 10: Level of detail -
                        • -
                        • - 11: Samples of data collected and work -
                        • -
                        • - 12: ; -
                        • -
                        • - 13: Originality -
                        • -
                        • - 14: Introduction -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 8: - - Rank other teams  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Summary of responses received by your team - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        - Team - - - - Recipient - - - - Ranks Received - - - - Self Rank - - - - Overall Rank - - - - Overall Rank Excluding Self - - -
                        - Team 1</option><option value="dump"></td><td>'" - - Team 1</option><option value="dump"></td><td>'" - - 1 , 1 - - - - - 1 - - 1 -
                        -
                        -
                        -
                        -
                        -
                        - - To: - - Your Team (Team 1</option><option value="dump"></td><td>'") -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - TEAM 2 -
                        - 1 -
                        - - - From: - - - TEAM 3 -
                        - 2 -
                        -
                        -
                        -
                        - - To: - - Anonymous team -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous team -
                        - 1 -
                        -
                        -
                        -
                        - - To: - - Anonymous team -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous team -
                        - 2 -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageRubric.html b/src/test/resources/pages/studentFeedbackResultsPageRubric.html deleted file mode 100644 index 6dfde27ed39..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageRubric.html +++ /dev/null @@ -1,747 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - Please choose the best choice for the following sub-questions.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        -
                        - - Response Summary (of received responses) - - -
                        -
                        - - - Exclude self evaluation - -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        - -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Average - - -

                        -
                        -

                        - a) This student has done a good job. -

                        -
                        - 50% (1) [1.01] - - 50% (1) [-0.99] - - 0.01 -
                        -

                        - b) This student has tried his/her best. -

                        -
                        - 0% (0) [1.5] - - 100% (1) [1] - - 1.00 -
                        -
                        -
                        -
                        - - Per Recipient Statistics - - - '"'" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -

                        - Team - - -

                        -
                        -

                        - Recipient Name - - -

                        -
                        -

                        - Sub Question - - -

                        -
                        -

                        - Yes - - -

                        -
                        -

                        - No - - -

                        -
                        -

                        - Total - - -

                        -
                        -

                        - Average - - -

                        -
                        - Team 1 - - - '" - - Alice Betsy - - a) This student has done a good job. - - 1 [1.01] - - 1 [-0.99] - - 0.02 - - 0.01 -
                        - Team 1 - - - '" - - Alice Betsy - - b) This student has tried his/her best. - - 0 [1.5] - - 1 [1] - - 1.00 - - 1.00 -
                        - Team 1 - - - '" - - Benny Charles - - a) This student has done a good job. - - 1 [1.01] - - 1 [-0.99] - - 0.02 - - 0.01 -
                        - Team 1 - - - '" - - Benny Charles - - b) This student has tried his/her best. - - 2 [1.5] - - 0 [1] - - 3.00 - - 1.50 -
                        - Team 2 - - - '" - - Colin Daniels - - a) This student has done a good job. - - 0 [1.01] - - 1 [-0.99] - - -0.99 - - -0.99 -
                        - Team 2 - - - '" - - Colin Daniels - - b) This student has tried his/her best. - - 1 [1.5] - - 0 [1] - - 1.50 - - 1.50 -
                        -
                        -
                        -
                        -
                        -
                        - - To: - - Colin Daniels -
                        - - - - - - - - - -
                        - - - From: - - - Colin Daniels -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - -
                        -
                        - - - From: - - - Benny Charles -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        - - - From: - - - Benny Charles -
                        - - - - - - - - - - - - - - - - - - - - -
                        - Criteria - - Yes - - No -
                        - This student has done a good job. - - - - -
                        - This student has tried his/her best. - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackResultsPageTeamToTeam.html b/src/test/resources/pages/studentFeedbackResultsPageTeamToTeam.html deleted file mode 100644 index 52532882d1b..00000000000 --- a/src/test/resources/pages/studentFeedbackResultsPageTeamToTeam.html +++ /dev/null @@ -1,551 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - What is the best selling point of your product? - -

                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Alice self feedback. -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [Mon, 02 Mar 2026, 07:59 AM SGT] (last edited by Teammates Test at Tue, 03 Mar 2026, 07:59 AM SGT) - - - -
                          -
                          -
                          -
                          -
                          - Instructor first comment to Alice -
                          -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 07:59 AM SGT] - - - -
                          -
                          -
                          -
                          -
                          - Instructor second comment to Alice -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate 3 other students' products - -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - Response to Benny. -
                        - - - From: - - - Anonymous student -
                        - Response to Benny from Dropout. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - Response to Danny. -
                        - - - From: - - - Anonymous student -
                        - Response to Danny from Dropout. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - Response to Dropout. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Alice from Dropout. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Feedback to class - -

                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - - -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - Secret feedback about class. (to nobody test) -
                        - - - From: - - - Anonymous student -
                        - Secret feedback about class. (to nobody test) -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 4: - - Give feedback to 3 other teams. - -

                        -
                        -
                        - - To: - - Your Team (Team 1</td></div>'") -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Team 2 -
                        - Team 2 (danny) to team 1 -
                        - - - From: - - - Team 3 -
                        - Team 3 to Team 1 multiline special char test -
                        -
                        -
                        -
                        - - To: - - Team 2 -
                        - - - - - - - - - -
                        - - - From: - - - Your Team (Team 1</td></div>'") -
                        - alice to team 2 -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 5: - - Give feedback to your team mates - -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - Teammate feedback from alice -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Teammate feedback from benny -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 6: - - Give feedback on how well the team worked together. - -

                        -
                        -
                        - - To: - - Team 1</td></div>'" -
                        - - - - - - - - - - - - - - - -
                        - - - From: - - - Alice Betsy</option></td></div>'" -
                        - Feedback from alice to the team -
                        - - - From: - - - You -
                        - Feedback from benny to the team -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageAwaiting.html b/src/test/resources/pages/studentFeedbackSubmitPageAwaiting.html deleted file mode 100644 index 00fe64040c7..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageAwaiting.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - Submit Feedback - - - - - - - - - - - - -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - - The feedback session is currently not open for submissions. - - You can view the questions and any submitted responses for this feedback session but cannot submit new responses. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Fourth Session -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2035, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 30 Apr 2035, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the second feedback session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - Give feedback to your instructors - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        - [for - - TEAMMATES Test Institute 1 - - ] -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - - - diff --git a/src/test/resources/pages/studentFeedbackSubmitPageClosed.html b/src/test/resources/pages/studentFeedbackSubmitPageClosed.html deleted file mode 100644 index f1e48dc6024..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageClosed.html +++ /dev/null @@ -1,696 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - - The feedback session is currently not open for submissions. - - You can view the questions and any submitted responses for this feedback session but cannot submit new responses. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 30 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the second feedback session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - Give feedback to your instructors - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - What do you like best about our product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - What do you like best about our product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Rate our product. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageEmpty.html b/src/test/resources/pages/studentFeedbackSubmitPageEmpty.html deleted file mode 100644 index 4aa7f5fc74f..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageEmpty.html +++ /dev/null @@ -1,91 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Third Session -

                        -
                        -
                        -
                        - -
                        -

                        - Mon, 02 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Please please fill in the last feedback session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - There are no questions for you to answer here! -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageFullyFilled.html b/src/test/resources/pages/studentFeedbackSubmitPageFullyFilled.html deleted file mode 100644 index 245b4c393f9..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageFullyFilled.html +++ /dev/null @@ -1,4442 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Test Self Feedback -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 other students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Edited response to Benny. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to student who is going to drop out. -

                        -
                        - -
                        - -
                        - Response length: - - 9 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to extra guy. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Feedback to instructors -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to 3 other teams. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        - Feedback to team 2. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        - Feedback to team 3 -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Give feedback to your team mates - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Feedback to teammate. -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who is the best class mate? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 200. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Rate the contribution of your team members and yourself. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - Please choose the best choice for the following sub-questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Nominate and rank at least 2 students for prizes. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        • - Other students in the course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - You need to choose at least 2 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - Rank exactly 3 options. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 24: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 25: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 26: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 27: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageGracePeriod.html b/src/test/resources/pages/studentFeedbackSubmitPageGracePeriod.html deleted file mode 100644 index 5f9fc12ac45..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageGracePeriod.html +++ /dev/null @@ -1,607 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - - The feedback session is currently not open for submissions. - - You can view the questions and any submitted responses for this feedback session but cannot submit new responses. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Grace Period Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - ${datetime.now} SGT -

                        -
                        -
                        -
                        - -
                        -

                        - This going to be a grace period session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - You cannot answer 'Not Sure' here. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageModified.html b/src/test/resources/pages/studentFeedbackSubmitPageModified.html deleted file mode 100644 index 13e92a64277..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageModified.html +++ /dev/null @@ -1,4298 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Test Self Feedback -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 other students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Edited response to Benny. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to extra guy. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Feedback to instructors -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to 3 other teams. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        - Feedback to team 2. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        - Feedback to team 3 -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Give feedback to your team mates - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - This question is for team members and you don't have any team members. Therefore, you will not be able to answer this question. -

                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who is the best class mate? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 300. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        - - - - Actual total is 200! Distribute the remaining 100 points. - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Rate the contribution of your team members and yourself. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - Please choose the best choice for the following sub-questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Nominate and rank at least 2 students for prizes. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        • - Other students in the course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - You need to choose at least 2 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - Rank exactly 3 options. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 24: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 25: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 26: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 27: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageNotYetVisible.html b/src/test/resources/pages/studentFeedbackSubmitPageNotYetVisible.html deleted file mode 100644 index 59f7e3bedae..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageNotYetVisible.html +++ /dev/null @@ -1,79 +0,0 @@ -
                        - -
                        -
                        -
                        -
                        - -

                        - Sorry, this session is currently not open for submission. It will be open from Mon, 02 Apr 2035, 11:59 PM SGT -
                        -
                        -

                        -
                        -
                        -
                        -
                        -
                        -

                        - Uh oh! Something went wrong. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - We are sorry this happened. You can safely ignore this error page in the following cases: -

                        -
                          -
                        • - Retrying the same action a few minutes later succeeds (i.e. no more error page). -
                        • -
                        • - You loaded an outdated page unintentionally. e.g. some browsers auto-load the pages that were loaded in the previous browsing session. -
                        • -
                        -

                        - However, if you keep seeing this page on multiple failed attempts when trying to perform some action in TEAMMATES, please help us troubleshoot the problem by providing us some additional details using the form below. -

                        -
                        -
                        -
                        -
                        - -
                        - - Note: This is the TEAMMATES support email. It has been pre-filled for your convenience and is not editable. - - -
                        -
                        - -
                        - - Note: This field has also been pre-filled for convenience. Feel free to change it to suit your needs. - - -
                        -
                        - - -
                        - - - - - -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageOpen.html b/src/test/resources/pages/studentFeedbackSubmitPageOpen.html deleted file mode 100644 index d9eb9a9dc86..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageOpen.html +++ /dev/null @@ -1,4402 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 other students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to 3 other teams. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Give feedback to your team mates - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who is the best class mate? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 200. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Rate the contribution of your team members and yourself. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - Please choose the best choice for the following sub-questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Nominate and rank at least 2 students for prizes. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        • - Other students in the course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - You need to choose at least 2 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - Rank exactly 3 options. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 24: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 25: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 26: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 27: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPagePartiallyFilled.html b/src/test/resources/pages/studentFeedbackSubmitPagePartiallyFilled.html deleted file mode 100644 index 11bab0f16aa..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPagePartiallyFilled.html +++ /dev/null @@ -1,4420 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Test Self Feedback -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 other students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to Benny. -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to student who is going to drop out. -

                        -
                        - -
                        - -
                        - Response length: - - 9 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to extra guy. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to 3 other teams. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        - Feedback to team 3 -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Give feedback to your team mates - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who is the best class mate? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 200. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Rate the contribution of your team members and yourself. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - Please choose the best choice for the following sub-questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Nominate and rank at least 2 students for prizes. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        • - Other students in the course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - You need to choose at least 2 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - Rank exactly 3 options. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 24: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 25: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 26: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 27: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPagePreview.html b/src/test/resources/pages/studentFeedbackSubmitPagePreview.html deleted file mode 100644 index 04f46aa4707..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPagePreview.html +++ /dev/null @@ -1,272 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - CFeedbackEditUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Fri, 01 May 2026, 10:00 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        -

                        -

                        - Please fill in the edited feedback session. -

                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - question for students - -
                        -
                        -
                        -
                        - - More details: - -

                        - more details -

                        -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - question for students to instructors - -
                        -
                        -
                        -
                        - - More details: - -

                        - more details -

                        -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructor can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageRank.html b/src/test/resources/pages/studentFeedbackSubmitPageRank.html deleted file mode 100644 index 576be321dc1..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageRank.html +++ /dev/null @@ -1,3733 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Student Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - For students to submit and view results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - As a student, rank every instructors on their feedback provided. Give the quality that the instructor should improve on most rank 1. You can give the same rank multiple times - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - As a student, rank the instructors - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Rank you and your team members, own team members can see the responses but not recipient name - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -

                        -

                        -
                        -
                        -
                        - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Rank your team members - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Rank up to 7 students in the course. All students can see the responses, but not the giver's name. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, but not your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - Rank the other teams, you can give the same rank multiple times. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - As a student, rank the areas of improvement you think you should make progress on. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - Rank atleast 2 options based on impact they cause on your activities. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 2 options. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - Rank at most 2 options based on impact they cause on your activities. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - Rank no more than 2 options. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Rank exactly 3 options based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 3 options. -
                        • -
                        • - Rank no more than 3 options. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Rank atleast 2 recipients based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 2 recipients. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Rank atmost 2 recipients based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - Rank no more than 2 recipients. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Rank exactly 3 recipients based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 3 recipients. -
                        • -
                        • - Rank no more than 3 recipients. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rank other teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageRubricSuccess.html b/src/test/resources/pages/studentFeedbackSubmitPageRubricSuccess.html deleted file mode 100644 index 97a4b41e4eb..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageRubricSuccess.html +++ /dev/null @@ -1,409 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRubricQnUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - Second Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for second session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - Please choose the best choice for the following sub-questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/studentFeedbackSubmitPageSuccessRank.html b/src/test/resources/pages/studentFeedbackSubmitPageSuccessRank.html deleted file mode 100644 index 71240eeb876..00000000000 --- a/src/test/resources/pages/studentFeedbackSubmitPageSuccessRank.html +++ /dev/null @@ -1,3737 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - FRankUiT.CS4221 -

                        -
                        -
                        -
                        - -
                        -

                        - Student Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SAST -

                        -
                        -
                        -
                        - -
                        -

                        - For students to submit and view results -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - As a student, rank every instructors on their feedback provided. Give the quality that the instructor should improve on most rank 1. You can give the same rank multiple times - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -

                        -

                        -
                        -
                        -
                        - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - As a student, rank the instructors - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving instructors can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        - - (Instructor): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -

                        -

                        -
                        -
                        -
                        - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Rank you and your team members, own team members can see the responses but not recipient name - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -

                        -

                        -
                        -
                        -
                        - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Rank your team members - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving student can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Rank up to 7 students in the course. All students can see the responses, but not the giver's name. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, but not your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - Rank the other teams, you can give the same rank multiple times. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -

                        -

                        -
                        -
                        -
                        - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - As a student, rank the areas of improvement you think you should make progress on. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -

                        -

                        -
                        -
                        -
                        - - - - - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - Rank atleast 2 options based on impact they cause on your activities. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 2 options. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - Rank at most 2 options based on impact they cause on your activities. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - Rank no more than 2 options. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Rank exactly 3 options based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 3 options. -
                        • -
                        • - Rank no more than 3 options. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Please rank the above options. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Rank atleast 2 recipients based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 2 recipients. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Rank atmost 2 recipients based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - Rank no more than 2 recipients. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Rank exactly 3 recipients based on popularity. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -

                        - Instructions: -

                        -
                          -
                        • - You need to rank at least 3 recipients. -
                        • -
                        • - Rank no more than 3 recipients. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rank other teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        - - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        -
                        -

                        - Please rank the above recipients. -

                        -
                        -
                        -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/unauthorized.html b/src/test/resources/pages/unauthorized.html deleted file mode 100644 index edbe93185ac..00000000000 --- a/src/test/resources/pages/unauthorized.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - TEAMMATES - - - - - - - -
                        - -
                        -
                        -
                        -
                        - -

                        - You are not authorized to view this page. -
                        -
                        - - Logout and return to main page. - -

                        -
                        -
                        -
                        -
                        -
                        -

                        - Uh oh! Something went wrong. -

                        -
                        -
                        -
                        -
                        -
                        -

                        - We are sorry this happened. You can safely ignore this error page in the following cases: -

                        -
                          -
                        • - Retrying the same action a few minutes later succeeds (i.e. no more error page). -
                        • -
                        • - You loaded an outdated page unintentionally. e.g. some browsers auto-load the pages that were loaded in the previous browsing session. -
                        • -
                        -

                        - However, if you keep seeing this page on multiple failed attempts when trying to perform some action in TEAMMATES, please help us troubleshoot the problem by providing us some additional details using the form below. -

                        -
                        -
                        -
                        -
                        - -
                        - - Note: This is the TEAMMATES support email. It has been pre-filled for your convenience and is not editable. - - -
                        -
                        - -
                        - - Note: This field has also been pre-filled for convenience. Feel free to change it to suit your needs. - - -
                        -
                        - - -
                        - - - - - -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - diff --git a/src/test/resources/pages/unregisteredStudentFeedbackResultsPageMCQ.html b/src/test/resources/pages/unregisteredStudentFeedbackResultsPageMCQ.html deleted file mode 100644 index 8da885a9054..00000000000 --- a/src/test/resources/pages/unregisteredStudentFeedbackResultsPageMCQ.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - Feedback Results - - - - - - - - - - -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        - You are viewing feedback results as - - Drop out - - . You may submit feedback for sessions that are currently open and view results without logging in. To access other features you need - - to login using a Google account - - (recommended). -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - MCQ Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - What is the best selling point of your product?  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Algo -
                        -
                          -
                        • -
                          -
                          - - Comment by response giver. - - - -
                          -
                          -
                          -
                          -
                          - Alice comment for herself -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate 3 other students' products  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Good -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - OK -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Charlie Davis -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Good -
                        -
                        -
                        -
                        - - To: - - Danny Engrid -
                        - - - - - - - - - - - - -
                        - - - From: - - - You -
                        - Good -
                        -
                          -
                        • -
                          -
                          - - Comment by response giver. - - - -
                          -
                          -
                          -
                          -
                          - Drop out comment to danny -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Choose the best student in the course.  - - - [more] - -
                        - -
                        -
                        -

                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Danny -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - diff --git a/src/test/resources/pages/unregisteredStudentFeedbackResultsPageOpen.html b/src/test/resources/pages/unregisteredStudentFeedbackResultsPageOpen.html deleted file mode 100644 index c84a0c6f3e6..00000000000 --- a/src/test/resources/pages/unregisteredStudentFeedbackResultsPageOpen.html +++ /dev/null @@ -1,395 +0,0 @@ -
                        -
                        -
                        -

                        - Feedback Results -

                        -
                        -
                        - You are viewing feedback results as - - Drop out - - . You may submit feedback for sessions that are currently open and view results without logging in. To access other features you need - - to login using a Google account - - (recommended). -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFResultsUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - You have received feedback from others. Please see below. -
                        -
                        - -
                        -
                        -
                        -

                        - Question 1: - - What is the best selling point of your product? - -

                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Alice self feedback. -
                        -
                          -
                        • -
                          -
                          - - From: Teammates Test [Mon, 02 Mar 2026, 07:59 AM SGT] (last edited by Teammates Test at Tue, 03 Mar 2026, 07:59 AM SGT) - - - -
                          -
                          -
                          -
                          -
                          - Instructor first comment to Alice -
                          -
                        • -
                        • -
                          -
                          - - From: Teammates Test [Tue, 03 Mar 2026, 07:59 AM SGT] - - - -
                          -
                          -
                          -
                          -
                          - Instructor second comment to Alice -
                          -
                        • -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 2: - - Rate 3 other students' products - -

                        -
                        -
                        - - To: - - You -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Dropout. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Benny. -
                        -
                        -
                        -
                        - - To: - - Anonymous student -
                        - - - - - - - - - -
                        - - - From: - - - Anonymous student -
                        - Response to Danny. -
                        -
                        -
                        - - Your own responses: - -
                        -
                        -
                        - - To: - - Alice Betsy</option></td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Alice from Dropout. -
                        -
                        -
                        -
                        - - To: - - Benny Charles -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Benny from Dropout. -
                        -
                        -
                        -
                        - - To: - - Danny Engrid -
                        - - - - - - - - - -
                        - - - From: - - - You -
                        - Response to Danny from Dropout. -
                        -
                        -
                        -
                        -
                        -
                        -
                        -

                        - Question 3: - - Give feedback to 3 other teams. - -

                        -
                        -
                        - - To: - - Team 1</td></div>'" -
                        - - - - - - - - - -
                        - - - From: - - - Your Team (Team 2) -
                        - Team 2 (danny) to team 1 -
                        -
                        -
                        -
                        - - To: - - Your Team (Team 2) -
                        - - - - - - - - - -
                        - - - From: - - - Team 1</td></div>'" -
                        - alice to team 2 -
                        -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/pages/unregisteredStudentFeedbackSubmitPageOpen.html b/src/test/resources/pages/unregisteredStudentFeedbackSubmitPageOpen.html deleted file mode 100644 index 0db05140b92..00000000000 --- a/src/test/resources/pages/unregisteredStudentFeedbackSubmitPageOpen.html +++ /dev/null @@ -1,5238 +0,0 @@ - - - - Submit Feedback - - - - - - - - - - - - -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - You are submitting feedback as - - Drop out - - . You may submit feedback for sessions that are currently open and view results without logging in. To access other features you need - - to login using a Google account - - (recommended). -
                        -
                        - - - - - -
                        -
                        - Note that you can use the Submit button to save responses already entered, and continue to answer remaining questions after that. You may also edit your submission any number of times before the closing time of this session. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 other students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to 3 other teams. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Give feedback to your team mates - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who is the best class mate? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 200. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Rate the contribution of your team members and yourself. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - Please choose the best choice for the following sub-questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Nominate and rank at least 2 students for prizes. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        • - Other students in the course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - You need to choose at least 2 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - Rank exactly 3 options. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 24: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 25: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 26: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 27: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - [ - - TEAMMATES - - V${version}] - -
                        -
                        -
                        -
                        - - [Send - - Feedback - - ] - -
                        -
                        -
                        -
                        - - - - - - - - - - diff --git a/src/test/resources/pages/unregisteredStudentFeedbackSubmitPagePartiallyFilled.html b/src/test/resources/pages/unregisteredStudentFeedbackSubmitPagePartiallyFilled.html deleted file mode 100644 index 781a301adc4..00000000000 --- a/src/test/resources/pages/unregisteredStudentFeedbackSubmitPagePartiallyFilled.html +++ /dev/null @@ -1,5159 +0,0 @@ -
                        -
                        -
                        -

                        - Submit Feedback -

                        -
                        -
                        - - - ${studentmotd.container} -
                        -
                        - You are submitting feedback as - - Drop out - - . You may submit feedback for sessions that are currently open and view results without logging in. To access other features you need - - to login using a Google account - - (recommended). -
                        -
                        - - - - - -
                        -
                        - All responses submitted successfully! -
                        -
                        - Note that some questions are yet to be answered. They are: 3, 5, 6, 8, 10, 11, 12, 13, 15, 16, 17, 19, 21, 22, 23, 24, 25, 26, 27. -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - SFSubmitUiT.CS2104 -

                        -
                        -
                        -
                        - -
                        -

                        - First Session -

                        -
                        -
                        -
                        - -
                        -

                        - Sun, 01 Apr 2012, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Thu, 30 Apr 2026, 11:59 PM SGT -

                        -
                        -
                        -
                        - -
                        -

                        - Instructions for first session -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 1: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Test Self Feedback -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 2: - - - Rate 3 other students' products - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - The receiving students can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, and your name, but not the name of the recipient. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to student who is number 1. -

                        -
                        - -
                        - -
                        - Response length: - - 7 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to Benny. -

                        -
                        - -
                        - -
                        - Response length: - - 3 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        - Response to extra guy. -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 3: - - - Comments about the class - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, but not your name. -
                        • -
                        • - Your team members can see your response, but not your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 4: - - - Give feedback to 3 other teams. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        - Feedback to team 3 -

                        -
                        - -
                        - -
                        - Response length: - - 4 - - words -
                        -
                        -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 5: - - - Give feedback to your team mates - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving students can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -

                        -
                        -

                        -
                        - -
                        - -
                        - Response length: - - 0 - - words -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 6: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 7: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 8: - - - What is the best selling point of your product? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - - - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 9: - - - What do you think is the other teams' best feature? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 10: - - - Who is the best class mate? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 11: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 12: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 13: - - - Who do you recommend as tutor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 14: - - - Rate your product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 15: - - - Rate others' product - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - - - - -
                        -
                        - [Possible values: 1, 1.5, 2, ..., 4, 4.5, 5] -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 16: - - - Who is the best instructor? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 17: - - - Who do you recommend as tutors? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 18: - - - How important are the following factors to you? Give points accordingly. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - You can see your own feedback in the results page later on. -
                        • -
                        • - Your team members can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Other students in the course can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 100. -
                        -

                        -
                        -
                        -
                        -
                        - -
                        -
                        - -
                        - -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - - -
                        -
                        -

                        - - - - All points distributed! - -
                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 19: - - - Split points among the teams - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - The receiving teams can see your response, but not the name of the recipient, or your name. -
                        • -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -

                        - Note: -

                        -

                        - - - Total points distributed should add up to 200. -
                        -

                        -
                        -
                        -
                        - -
                        -
                        -

                        - Please note that you are submitting this response on behalf of your team. -

                        -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        - -
                        -
                        -
                        - - (Team): -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        - - - - - - -
                        -
                        -

                        -

                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 20: - - - Rate the contribution of your team members and yourself. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        - - -
                        - -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        - -
                        -
                        - - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 21: - - - Please choose the best choice for the following sub-questions. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -
                        -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        -
                        - a) This student has done a good job. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - b) This student has tried his/her best. -
                        -
                        -
                        - -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 22: - - - Nominate and rank at least 2 students for prizes. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        • - Other students in the course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        -

                        - You need to choose at least 2 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 23: - - - Rank exactly 3 options. - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, the name of the recipient, and your name. -
                        • -
                        • - Other students in the course can see your response, the name of the recipient, and your name. -
                        • -
                        -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        - - (Student): -
                        -
                        -

                        - You need to choose at least 3 options. -

                        -

                        - You cannot choose more than 3 options. -

                        - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 24: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 25: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 26: - - - Which is the best team? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        -
                        -
                        - -
                        - -
                        -
                        -
                        -
                        -
                        -
                        - - - -
                        -
                        -
                        - - Question 27: - - - Who do you like working with? - -
                        -
                        -

                        - Only the following persons can see your responses: -

                        -
                          -
                        • - Instructors in this course can see your response, and your name. -
                        • -
                        -
                        -
                        -
                        -
                        - -
                        - - - - - - - - - - - - - - -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        -
                        - -
                        -
                        - - -
                        -
                        -
                        -
                        -
                        -
                        -
                        -
                        - - Send me a confirmation email - -
                        -
                        -
                        -
                        -
                        diff --git a/src/test/resources/testng-architecture.xml b/src/test/resources/testng-architecture.xml index 681ef148784..7512f16f0a5 100644 --- a/src/test/resources/testng-architecture.xml +++ b/src/test/resources/testng-architecture.xml @@ -3,7 +3,7 @@ - + diff --git a/src/test/resources/testng-component.xml b/src/test/resources/testng-component.xml index 6d37da52627..0f834eb0cd3 100644 --- a/src/test/resources/testng-component.xml +++ b/src/test/resources/testng-component.xml @@ -3,15 +3,16 @@ - - - - - - - - - + + + + + + + + + + diff --git a/src/web/app/app.component.ts b/src/web/app/app.component.ts index 9b38148dc3a..8358cfb8998 100644 --- a/src/web/app/app.component.ts +++ b/src/web/app/app.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Event, NavigationEnd, Router } from '@angular/router'; +import { NgbTooltipConfig } from '@ng-bootstrap/ng-bootstrap'; import { filter } from 'rxjs/operators'; import { environment } from '../environments/environment'; import { MasqueradeModeService } from '../services/masquerade-mode.service'; @@ -13,7 +14,11 @@ import { MasqueradeModeService } from '../services/masquerade-mode.service'; }) export class AppComponent implements OnInit { constructor(private router: Router, private route: ActivatedRoute, - private masqueradeModeService: MasqueradeModeService) {} + private masqueradeModeService: MasqueradeModeService, tooltipConfig: NgbTooltipConfig) { + tooltipConfig.openDelay = 400; + tooltipConfig.closeDelay = 100; + tooltipConfig.triggers = 'hover'; + } ngOnInit(): void { // sync the URL param `user` with the masqueraded userID in the service diff --git a/src/web/app/app.module.ts b/src/web/app/app.module.ts index 57dcce9d775..0311472f8bd 100644 --- a/src/web/app/app.module.ts +++ b/src/web/app/app.module.ts @@ -1,21 +1,89 @@ import { HttpClientModule } from '@angular/common/http'; -import { NgModule } from '@angular/core'; +import { NgModule, Provider } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterModule, Routes } from '@angular/router'; +import { RouterModule, Routes, UrlSerializer } from '@angular/router'; import { ServiceWorkerModule } from '@angular/service-worker'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import { NgxPageScrollCoreModule } from 'ngx-page-scroll-core'; import { environment } from '../environments/environment'; +import { Intent } from '../types/api-request'; import { AppComponent } from './app.component'; -import { - StatusMesssageModalModule, -} from './components/status-message/status-messsage-modal/status-messsage-modal.module'; +import { ErrorReportModule } from './components/error-report/error-report.module'; +import { LoaderBarModule } from './components/loader-bar/loader-bar.module'; +import { LoadingSpinnerModule } from './components/loading-spinner/loading-spinner.module'; +import { SimpleModalModule } from './components/simple-modal/simple-modal.module'; +import { ToastModule } from './components/toast/toast.module'; +import { CustomUrlSerializer } from './custom-url-serializer'; +import { MaintenancePageComponent } from './maintenance-page.component'; +import { ClickOutsideDirective, PageComponent } from './page.component'; +import { AdminPageComponent } from './pages-admin/admin-page.component'; +import { InstructorPageComponent } from './pages-instructor/instructor-page.component'; +import { StaticPageComponent } from './pages-static/static-page.component'; +import { StudentPageComponent } from './pages-student/student-page.component'; +import { PublicPageComponent } from './public-page.component'; -const routes: Routes = [ +const customUrlSerializer: CustomUrlSerializer = new CustomUrlSerializer(); +const customUrlSerializerProvider: Provider = { + provide: UrlSerializer, + useValue: customUrlSerializer, +}; +let routes: Routes = [ { path: 'web', - loadChildren: () => import('./pages.module').then((m: any) => m.PagesModule), + children: [ + { + path: 'front', + component: StaticPageComponent, + loadChildren: () => import('./pages-static/static-pages.module').then((m: any) => m.StaticPagesModule), + }, + { + path: 'join', + component: PublicPageComponent, + loadChildren: () => import('./user-join-page.module').then((m: any) => m.UserJoinPageModule), + }, + { + path: 'sessions', + component: PublicPageComponent, + children: [ + { + path: 'result', + loadChildren: () => import('./pages-session/session-result-page/session-result-page.module') + .then((m: any) => m.SessionResultPageModule), + }, + { + path: 'submission', + loadChildren: () => import('./pages-session/session-submission-page/session-submission-page.module') + .then((m: any) => m.SessionSubmissionPageModule), + data: { + pageTitle: 'Submit Feedback', + intent: Intent.STUDENT_SUBMISSION, + }, + }, + ], + }, + { + path: 'student', + component: StudentPageComponent, + loadChildren: () => import('./pages-student/student-pages.module').then((m: any) => m.StudentPagesModule), + }, + { + path: 'instructor', + component: InstructorPageComponent, + loadChildren: () => import('./pages-instructor/instructor-pages.module') + .then((m: any) => m.InstructorPagesModule), + }, + { + path: 'admin', + component: AdminPageComponent, + loadChildren: () => import('./pages-admin/admin-pages.module').then((m: any) => m.AdminPagesModule), + }, + { + path: '**', + pathMatch: 'full', + redirectTo: 'front', + }, + ], }, { path: '', @@ -24,25 +92,64 @@ const routes: Routes = [ }, ]; +if (environment.maintenance) { + routes = [ + { + path: 'web', + component: PublicPageComponent, + children: [ + { + path: '', + component: MaintenancePageComponent, + }, + { + path: '**', + pathMatch: 'full', + redirectTo: '', + }, + ], + }, + { + path: '**', + pathMatch: 'full', + redirectTo: 'web', + }, + ]; +} + /** * Root module. */ @NgModule({ - declarations: [AppComponent], + declarations: [ + AppComponent, + PageComponent, + ClickOutsideDirective, + PublicPageComponent, + StaticPageComponent, + StudentPageComponent, + InstructorPageComponent, + AdminPageComponent, + MaintenancePageComponent, + ], imports: [ + SimpleModalModule, BrowserModule, BrowserAnimationsModule, HttpClientModule, - NgbModule, + NgbDropdownModule, RouterModule.forRoot(routes), - StatusMesssageModalModule, + ErrorReportModule, + ToastModule, + LoaderBarModule, NgxPageScrollCoreModule.forRoot(), ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production, registrationStrategy: 'registerImmediately', }), + LoadingSpinnerModule, ], - providers: [], + providers: [customUrlSerializerProvider], bootstrap: [AppComponent], }) export class AppModule {} diff --git a/src/web/app/components/ajax-loading/ajax-loading.component.html b/src/web/app/components/ajax-loading/ajax-loading.component.html index 7a7dc47a290..f84ddd053fc 100644 --- a/src/web/app/components/ajax-loading/ajax-loading.component.html +++ b/src/web/app/components/ajax-loading/ajax-loading.component.html @@ -1 +1,3 @@ - +
                        +
                        +
                        diff --git a/src/web/app/components/ajax-loading/ajax-loading.component.scss b/src/web/app/components/ajax-loading/ajax-loading.component.scss index e69de29bb2d..a61e6d3ab7e 100644 --- a/src/web/app/components/ajax-loading/ajax-loading.component.scss +++ b/src/web/app/components/ajax-loading/ajax-loading.component.scss @@ -0,0 +1,3 @@ +.loading-container { + display: inline; +} diff --git a/src/web/app/components/ajax-loading/ajax-loading.component.ts b/src/web/app/components/ajax-loading/ajax-loading.component.ts index 13b7029f6cb..9bf82595bac 100644 --- a/src/web/app/components/ajax-loading/ajax-loading.component.ts +++ b/src/web/app/components/ajax-loading/ajax-loading.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; /** * Displaying the ajax loader. @@ -10,6 +10,9 @@ import { Component, OnInit } from '@angular/core'; }) export class AjaxLoadingComponent implements OnInit { + @Input() + useBlueSpinner: boolean = false; + constructor() { } ngOnInit(): void { diff --git a/src/web/app/components/comment-box/comment-box.module.ts b/src/web/app/components/comment-box/comment-box.module.ts index 47497b7f965..f5942cc3fec 100644 --- a/src/web/app/components/comment-box/comment-box.module.ts +++ b/src/web/app/components/comment-box/comment-box.module.ts @@ -1,7 +1,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { SingleResponseModule } from '../question-responses/single-response/single-response.module'; import { RichTextEditorModule } from '../rich-text-editor/rich-text-editor.module'; import { TeammatesCommonModule } from '../teammates-common/teammates-common.module'; @@ -15,9 +15,6 @@ import { CommentVisibilityTypeDescriptionPipe, CommentVisibilityTypeNamePipe, CommentVisibilityTypesJointNamePipe, } from './comment-visibility-setting.pipe'; import { CommentsToCommentTableModelPipe } from './comments-to-comment-table-model.pipe'; -import { - ConfirmDeleteCommentModalComponent, -} from './confirm-delete-comment-modal/confirm-delete-comment-modal.component'; /** * Module for comments table @@ -26,7 +23,6 @@ import { declarations: [ CommentEditFormComponent, CommentRowComponent, - ConfirmDeleteCommentModalComponent, CommentTableModalComponent, CommentTableComponent, CommentVisibilityControlNamePipe, @@ -41,7 +37,7 @@ import { CommonModule, SingleResponseModule, RichTextEditorModule, - NgbModule, + NgbTooltipModule, FormsModule, ], exports: [ @@ -52,9 +48,6 @@ import { CommentToCommentRowModelPipe, CommentsToCommentTableModelPipe, ], - entryComponents: [ - ConfirmDeleteCommentModalComponent, - ], providers: [ CommentToCommentRowModelPipe, ], diff --git a/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.html b/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.html index 906447de453..cfdb8a15f26 100755 --- a/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.html +++ b/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.html @@ -10,11 +10,10 @@
                        + {{ isVisibilityTableExpanded ? "Hide" : "Show" }} Visibility Options - @@ -23,37 +22,37 @@

                        You may change comment's visibility using the visibility options on the right hand side.

                        - - - - - - - - - - - - +
                        +
                        User/Group{{ commentVisibilityControl | commentVisibilityControlName }}
                        {{ commentVisibilityType | commentVisibilityTypeName }} - -
                        + + + + - - -
                        User/Group{{ commentVisibilityControl | commentVisibilityControlName }}
                        + + + + + {{ commentVisibilityType | commentVisibilityTypeName }} + + + + + + + +
                        - - diff --git a/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.ts b/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.ts index dc06503902f..e90db544393 100755 --- a/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.ts +++ b/src/web/app/components/comment-box/comment-edit-form/comment-edit-form.component.ts @@ -8,6 +8,7 @@ import { ResponseOutput, } from '../../../../types/api-output'; import { CommentVisibilityControl } from '../../../../types/comment-visibility-control'; +import { collapseAnim } from '../../teammates-common/collapse-anim'; import { CommentRowMode } from '../comment-row/comment-row.component'; /** @@ -28,6 +29,7 @@ export interface CommentEditFormModel { selector: 'tm-comment-edit-form', templateUrl: './comment-edit-form.component.html', styleUrls: ['./comment-edit-form.component.scss'], + animations: [collapseAnim], }) export class CommentEditFormComponent implements OnInit, OnChanges { diff --git a/src/web/app/components/comment-box/comment-row/comment-row.component.html b/src/web/app/components/comment-box/comment-row/comment-row.component.html index 16e2f93f4b0..a36b7477a81 100755 --- a/src/web/app/components/comment-box/comment-row/comment-row.component.html +++ b/src/web/app/components/comment-box/comment-row/comment-row.component.html @@ -21,25 +21,25 @@ {{ model.commentGiverName ? model.commentGiverName : model.originalComment.commentGiver }} commented at - + {{ model.originalComment.createdAt | formatDateBrief: model.timezone! }} - edited by {{ model.lastEditorName ? model.lastEditorName : model.originalComment.lastEditorEmail }} - + -
                        - -
                        -
                        +
                        diff --git a/src/web/app/components/comment-box/comment-row/comment-row.component.scss b/src/web/app/components/comment-box/comment-row/comment-row.component.scss index 0d7433595d4..13ee8000b53 100755 --- a/src/web/app/components/comment-box/comment-row/comment-row.component.scss +++ b/src/web/app/components/comment-box/comment-row/comment-row.component.scss @@ -1,11 +1,3 @@ -.comment-row button { - margin-left: 10px; -} - .dot-xs { font-size: .3em; } - -.underline-hover:hover { - text-decoration: underline; -} diff --git a/src/web/app/components/comment-box/comment-row/comment-row.component.ts b/src/web/app/components/comment-box/comment-row/comment-row.component.ts index ee73a6a3072..f3554dc6d65 100755 --- a/src/web/app/components/comment-box/comment-row/comment-row.component.ts +++ b/src/web/app/components/comment-box/comment-row/comment-row.component.ts @@ -1,15 +1,13 @@ import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { CommentVisibilityStateMachine } from '../../../../services/comment-visibility-state-machine'; import { FeedbackResponseCommentService } from '../../../../services/feedback-response-comment.service'; -import { - CommentVisibilityType, FeedbackResponseComment, FeedbackVisibilityType, ResponseOutput, +import { SimpleModalService } from '../../../../services/simple-modal.service'; +import { CommentVisibilityType, FeedbackResponseComment, FeedbackVisibilityType, ResponseOutput, } from '../../../../types/api-output'; import { CommentVisibilityControl } from '../../../../types/comment-visibility-control'; +import { SimpleModalType } from '../../simple-modal/simple-modal-type'; import { CommentEditFormModel } from '../comment-edit-form/comment-edit-form.component'; -import { - ConfirmDeleteCommentModalComponent, -} from '../confirm-delete-comment-modal/confirm-delete-comment-modal.component'; /** * Model for a comment row. @@ -114,7 +112,8 @@ export class CommentRowComponent implements OnInit, OnChanges { visibilityStateMachine: CommentVisibilityStateMachine; - constructor(private modalService: NgbModal, private commentService: FeedbackResponseCommentService) { + constructor(private simpleModalService: SimpleModalService, + private commentService: FeedbackResponseCommentService) { this.visibilityStateMachine = this.commentService.getNewVisibilityStateMachine(this.questionShowResponsesTo); } @@ -155,7 +154,9 @@ export class CommentRowComponent implements OnInit, OnChanges { * Triggers the delete comment event */ triggerDeleteCommentEvent(): void { - const modalRef: NgbModalRef = this.modalService.open(ConfirmDeleteCommentModalComponent); + const modalRef: NgbModalRef = this.simpleModalService + .openConfirmationModal('Delete the comment permanently?', SimpleModalType.DANGER, + 'Are you sure you want to continue?'); modalRef.result.then(() => { this.deleteCommentEvent.emit(); diff --git a/src/web/app/components/comment-box/comment-table-modal/comment-table-modal.component.spec.ts b/src/web/app/components/comment-box/comment-table-modal/comment-table-modal.component.spec.ts index 96efdb17269..f8f89c52955 100644 --- a/src/web/app/components/comment-box/comment-table-modal/comment-table-modal.component.spec.ts +++ b/src/web/app/components/comment-box/comment-table-modal/comment-table-modal.component.spec.ts @@ -1,6 +1,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { RichTextEditorModule } from '../../rich-text-editor/rich-text-editor.module'; import { TeammatesCommonModule } from '../../teammates-common/teammates-common.module'; @@ -35,6 +36,7 @@ describe('CommentTableModalComponent', () => { HttpClientTestingModule, RichTextEditorModule, NgbModule, + BrowserAnimationsModule, ], providers: [NgbActiveModal], }) diff --git a/src/web/app/components/comment-box/comment-table/comment-table.component.html b/src/web/app/components/comment-box/comment-table/comment-table.component.html index 1e16b852240..bf11225c45d 100644 --- a/src/web/app/components/comment-box/comment-table/comment-table.component.html +++ b/src/web/app/components/comment-box/comment-table/comment-table.component.html @@ -1,6 +1,6 @@
                        -
                        @@ -9,7 +9,7 @@
                      • -
                      • +
                      • { HttpClientTestingModule, TeammatesCommonModule, FormsModule, + BrowserAnimationsModule, ], }) .compileComponents(); diff --git a/src/web/app/components/comment-box/comment-table/comment-table.component.ts b/src/web/app/components/comment-box/comment-table/comment-table.component.ts index 8dfa365129c..6b420d93254 100644 --- a/src/web/app/components/comment-box/comment-table/comment-table.component.ts +++ b/src/web/app/components/comment-box/comment-table/comment-table.component.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FeedbackResponseComment, FeedbackVisibilityType, ResponseOutput, } from '../../../../types/api-output'; +import { collapseAnim } from '../../teammates-common/collapse-anim'; import { CommentRowMode, CommentRowModel } from '../comment-row/comment-row.component'; /** @@ -22,6 +23,7 @@ export interface CommentTableModel { selector: 'tm-comment-table', templateUrl: './comment-table.component.html', styleUrls: ['./comment-table.component.scss'], + animations: [collapseAnim], }) export class CommentTableComponent implements OnInit { diff --git a/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.html b/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.html deleted file mode 100755 index 61798834dc0..00000000000 --- a/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.spec.ts b/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.spec.ts deleted file mode 100755 index f1bf00c0fe5..00000000000 --- a/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.spec.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; - -import { ConfirmDeleteCommentModalComponent } from './confirm-delete-comment-modal.component'; - -describe('ConfirmDeleteCommentModalComponent', () => { - let component: ConfirmDeleteCommentModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [], - declarations: [ConfirmDeleteCommentModalComponent], - providers: [NgbActiveModal], - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ConfirmDeleteCommentModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.ts b/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.ts deleted file mode 100755 index f7a420f80b2..00000000000 --- a/src/web/app/components/comment-box/confirm-delete-comment-modal/confirm-delete-comment-modal.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; - -/** - * Confirm delete modal. - */ -@Component({ - selector: 'tm-confirm-delete-comment-modal', - templateUrl: './confirm-delete-comment-modal.component.html', - styleUrls: ['./confirm-delete-comment-modal.component.scss'], -}) -export class ConfirmDeleteCommentModalComponent implements OnInit { - - constructor(public activeModal: NgbActiveModal) { } - - ngOnInit(): void { - } - -} diff --git a/src/web/app/components/copy-session-modal/__snapshots__/copy-session-modal.component.spec.ts.snap b/src/web/app/components/copy-session-modal/__snapshots__/copy-session-modal.component.spec.ts.snap index 00d11787ebc..631765ac091 100644 --- a/src/web/app/components/copy-session-modal/__snapshots__/copy-session-modal.component.spec.ts.snap +++ b/src/web/app/components/copy-session-modal/__snapshots__/copy-session-modal.component.spec.ts.snap @@ -4,7 +4,7 @@ exports[`CopySessionModalComponent should snap with default fields 1`] = `
                      • -
                        - - - - - - - - - + + + + +
                        @@ -60,24 +46,24 @@
                      +
                    • +
                    • + Columns Information +
                        +
                      • + Section [Compulsory for courses having more than 100 students]: Section name/ID +
                      • +
                      • + Team [Compulsory]: Team name/ID +
                          +
                        • + A team must be unique within a course. A team cannot be in 2 different sections. +
                        • +
                        • + If you do not have teams in your course, use “N/A” as the team name for all students. +
                        • +
                        +
                      • +
                      • + Name [Compulsory]: Student name +
                      • +
                      • + Email [Compulsory]: The email address used to contact the student.
                        +
                          +
                        • + This need not be a Gmail address. +
                        • +
                        • + It should be unique for each student. + If two students are given the same email, they will be considered the same student. +
                        • +
                        +
                      • +
                      • + Comments [Optional]: Any other information you want to record about a student. +
                      • +
                      +
                    • +
                    • + Mass editing enrolled students +
                        +
                      • + To mass-edit data of enrolled students (except email address), simply use this page to re-enroll them with + the + updated data. +
                      • +
                      • + To DELETE students or to UPDATE EMAIL address of a student, please go to the courses page and + click the Students -> View/Edit link of the course. +
                      • +
                      +
                    • +
                    - - - - - - -
                    -

                    More info

                    -
                    -
                      -
                    • - Spreadsheet Information -
                        -
                      • - If you have student data in a spreadsheet, simply copy the relevant cell-range from your spreadsheet and - paste into the New students spreadsheet interface above.

                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                        SectionTeamNameEmailComments
                        Tutorial Group 1Team 1Tom Jacobstom@example.com
                        Tutorial Group 1Team 1Jean Wongjean@example.comExchange Student
                        Tutorial Group 1Team 1Ravi Kumarravi@example.com
                        Tutorial Group 2Team 2Chun Lingling@example.com
                        Tutorial Group 2Team 2Desmond Wudesmond@example.com
                        Tutorial Group 2Team 3Harsha Silvaharsha@example.com
                        -
                      • -
                      • Each existing cells can be edited by just clicking on it.
                      • -
                      • The entire table can be sorted by just clicking on the column name.
                      • -
                      • You can re-arrange column order by clicking on the column header and dragging them left or right.
                      • -
                      • To access more edit functions, right-click on a cell.
                      • -
                      • Column width can be adjusted.
                      • -
                      • Expand the Existing students spreadsheet interface to view existing students in the course.
                      • -
                      -
                    • -
                    • - Columns Information -
                        -
                      • - Section [Compulsory for courses having more than 100 students]: Section name/ID -
                      • -
                      • - Team [Compulsory]: Team name/ID -
                          -
                        • - A team must be unique within a course. A team cannot be in 2 different sections. -
                        • -
                        • - If you do not have teams in your course, use “N/A” as the team name for all students. -
                        • -
                        -
                      • -
                      • - Name [Compulsory]: Student name -
                      • -
                      • - Email [Compulsory]: The email address used to contact the student.
                        -
                          -
                        • - This need not be a Gmail address. -
                        • -
                        • - It should be unique for each student. - If two students are given the same email, they will be considered the same student. -
                        • -
                        -
                      • -
                      • - Comments [Optional]: Any other information you want to record about a student. -
                      • -
                      -
                    • -
                    • - Mass editing enrolled students -
                        -
                      • - To mass-edit data of enrolled students (except email address), simply use this page to re-enroll them with - the - updated data. -
                      • -
                      • - To DELETE students or to UPDATE EMAIL address of a student, please go to the courses page and - click the Students -> View/Edit link of the course. -
                      • -
                      -
                    • -
                    -
                    - +
                    -
                    -
                    -

                    Enrollment Results for {{ courseid }}

                    -
                    -
                    - -
                    -
                    +

                    Enrollment Results for {{ courseId }}

                    {{ enrollResultPanel.messageForEnrollmentStatus }}
                    - +
                    diff --git a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.scss b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.scss index 2d9973eb2e5..56f133c1146 100644 --- a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.scss +++ b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.scss @@ -58,14 +58,6 @@ margin-left: 10px; } -::ng-deep.modal-content { - padding: 0 !important; -} - -::ng-deep.close:focus { - outline: 0; -} - .enroll-results-panel { margin-bottom: 15px; } diff --git a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.spec.ts b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.spec.ts index e3281d10e80..672bee07bca 100644 --- a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.spec.ts @@ -2,7 +2,11 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { HotTableModule } from '@handsontable/angular'; +import { AjaxLoadingModule } from '../../components/ajax-loading/ajax-loading.module'; import { AjaxPreloadModule } from '../../components/ajax-preload/ajax-preload.module'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; +import { PanelChevronModule } from '../../components/panel-chevron/panel-chevron.module'; import { StatusMessageModule } from '../../components/status-message/status-message.module'; import { InstructorCourseEnrollPageComponent } from './instructor-course-enroll-page.component'; @@ -18,7 +22,11 @@ describe('InstructorCourseEnrollPageComponent', () => { HotTableModule, RouterTestingModule, AjaxPreloadModule, + AjaxLoadingModule, StatusMessageModule, + LoadingSpinnerModule, + LoadingRetryModule, + PanelChevronModule, ], }) .compileComponents(); diff --git a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts index ee54903dd90..5e40b74b408 100644 --- a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts +++ b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.component.ts @@ -1,15 +1,18 @@ -import { Component, ContentChild, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; +import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { HotTableRegisterer } from '@handsontable/angular'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import Handsontable from 'handsontable'; +import { finalize } from 'rxjs/operators'; import { CourseService } from '../../../services/course.service'; +import { SimpleModalService } from '../../../services/simple-modal.service'; import { StatusMessageService } from '../../../services/status-message.service'; import { StudentService } from '../../../services/student.service'; import { HasResponses, JoinState, Student, Students } from '../../../types/api-output'; import { StudentEnrollRequest, StudentsEnrollRequest } from '../../../types/api-request'; +import { SimpleModalType } from '../../components/simple-modal/simple-modal-type'; import { StatusMessage } from '../../components/status-message/status-message'; +import { collapseAnim } from '../../components/teammates-common/collapse-anim'; import { ErrorMessageOutput } from '../../error-message-output'; import { EnrollStatus } from './enroll-status'; @@ -26,18 +29,20 @@ interface EnrollResultPanel { selector: 'tm-instructor-course-enroll-page', templateUrl: './instructor-course-enroll-page.component.html', styleUrls: ['./instructor-course-enroll-page.component.scss'], + animations: [collapseAnim], }) export class InstructorCourseEnrollPageComponent implements OnInit { // enum EnrollStatus: typeof EnrollStatus = EnrollStatus; - courseid: string = ''; + courseId: string = ''; coursePresent?: boolean; + isLoadingCourseEnrollPage: boolean = false; showEnrollResults?: boolean = false; + enrollErrorMessage: string = ''; statusMessage: StatusMessage[] = []; @ViewChild('moreInfo') moreInfo?: ElementRef; - @ContentChild('pasteModalBox') pasteModalBox?: NgbModal; @Input() isNewStudentsPanelCollapsed: boolean = false; @Input() isExistingStudentsPanelCollapsed: boolean = true; @@ -65,17 +70,20 @@ export class InstructorCourseEnrollPageComponent implements OnInit { existingStudentsHOT: string = 'existingStudentsHOT'; isExistingStudentsPresent: boolean = true; - loading: boolean = false; + hasLoadingStudentsFailed: boolean = false; + isLoadingExistingStudents: boolean = false; isAjaxSuccess: boolean = true; + isEnrolling: boolean = false; constructor(private route: ActivatedRoute, private statusMessageService: StatusMessageService, private courseService: CourseService, private studentService: StudentService, - private ngbModal: NgbModal) { } + private simpleModalService: SimpleModalService) { } ngOnInit(): void { this.route.queryParams.subscribe((queryParams: any) => { + this.courseId = queryParams.courseid; this.getCourseEnrollPageData(queryParams.courseid); }); } @@ -84,6 +92,8 @@ export class InstructorCourseEnrollPageComponent implements OnInit { * Submits enroll data */ submitEnrollData(): void { + this.isEnrolling = true; + this.enrollErrorMessage = ''; const newStudentsHOTInstance: Handsontable = this.hotRegisterer.getInstance(this.newStudentsHOT); @@ -100,18 +110,20 @@ export class InstructorCourseEnrollPageComponent implements OnInit { .filter((row: string[]) => (!row.every((cell: string) => cell === null || cell === ''))) .forEach((row: string[]) => (studentsEnrollRequest.studentEnrollRequests.push({ section: row[hotInstanceColHeaders.indexOf(this.colHeaders[0])] === null ? - '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[0])], + '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[0])].trim(), team: row[hotInstanceColHeaders.indexOf(this.colHeaders[1])] === null ? - '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[1])], + '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[1])].trim(), name: row[hotInstanceColHeaders.indexOf(this.colHeaders[2])] === null ? - '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[2])], + '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[2])].trim(), email: row[hotInstanceColHeaders.indexOf(this.colHeaders[3])] === null ? - '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[3])], + '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[3])].trim(), comments: row[hotInstanceColHeaders.indexOf(this.colHeaders[4])] === null ? - '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[4])], + '' : row[hotInstanceColHeaders.indexOf(this.colHeaders[4])].trim(), }))); - this.studentService.enrollStudents(this.courseid, studentsEnrollRequest).subscribe((resp: Students) => { + this.studentService.enrollStudents( + this.courseId, studentsEnrollRequest, + ).pipe(finalize(() => this.isEnrolling = false)).subscribe((resp: Students) => { const enrolledStudents: Student[] = resp.students; this.showEnrollResults = true; this.statusMessage.pop(); // removes any existing error status message @@ -120,10 +132,9 @@ export class InstructorCourseEnrollPageComponent implements OnInit { this.populateEnrollResultPanelList(this.existingStudents, enrolledStudents, studentsEnrollRequest.studentEnrollRequests); }, (resp: ErrorMessageOutput) => { - this.statusMessage.pop(); // removes any existing error status message - this.statusMessageService.showErrorToast(resp.error.message); + this.enrollErrorMessage = resp.error.message; }, () => { - this.studentService.getStudentsFromCourse({ courseId: this.courseid }).subscribe((resp: Students) => { + this.studentService.getStudentsFromCourse({ courseId: this.courseId }).subscribe((resp: Students) => { this.existingStudents = resp.students; if (!this.isExistingStudentsPanelCollapsed) { const existingStudentTable: Handsontable = this.hotRegisterer.getInstance(this.existingStudentsHOT); @@ -182,7 +193,7 @@ export class InstructorCourseEnrollPageComponent implements OnInit { if (enrolledStudent === undefined) { studentLists[EnrollStatus.ERROR].push({ email: request.email, - courseId: this.courseid, + courseId: this.courseId, name: request.name, sectionName: request.section, teamName: request.team, @@ -210,14 +221,12 @@ export class InstructorCourseEnrollPageComponent implements OnInit { } if (studentLists[EnrollStatus.ERROR].length > 0) { - const generalEnrollErrorMessage: string = 'You may check that: ' + - '"Section" and "Comment" are optional while "Team", "Name", and "Email" must be filled. ' + - '"Section", "Team", "Name", and "Comment" should start with an alphabetical character, ' + - 'unless wrapped by curly brackets "{}", and should not contain vertical bar "|" and percentage sign"%". ' + - '"Email" should contain some text followed by one \'@\' sign followed by some more text. ' + - '"Team" should not have same format of email to avoid mis-interpretation. '; - this.statusMessageService.showErrorToast(`Some students failed to be enrolled, see the summary below. - ${generalEnrollErrorMessage}`); + this.enrollErrorMessage = `You may check that: "Section" and "Comment" are optional while "Team", "Name", + and "Email" must be filled. "Section", "Team", "Name", and "Comment" should start with an + alphabetical character, unless wrapped by curly brackets "{}", and should not contain vertical bar "|" and + percentage sign "%". "Email" should contain some text followed by one "@" sign followed by some + more text. "Team" should not have the same format as email to avoid mis-interpretation.`; + this.statusMessageService.showErrorToast('Some students failed to be enrolled, see the summary below.'); } return panels; } @@ -295,17 +304,17 @@ export class InstructorCourseEnrollPageComponent implements OnInit { toggleExistingStudentsPanel(): void { // Has to be done before the API call is made so that HOT is available for data population this.isExistingStudentsPanelCollapsed = !this.isExistingStudentsPanelCollapsed; - this.loading = true; + this.isLoadingExistingStudents = true; const existingStudentsHOTInstance: Handsontable = this.hotRegisterer.getInstance(this.existingStudentsHOT); // Calling REST API only the first time when spreadsheet has no data if (this.getSpreadsheetLength(existingStudentsHOTInstance.getData()) !== 0) { - this.loading = false; + this.isLoadingExistingStudents = false; return; } - this.studentService.getStudentsFromCourse({ courseId: this.courseid }).subscribe( + this.studentService.getStudentsFromCourse({ courseId: this.courseId }).subscribe( (resp: Students) => { if (resp.students.length !== 0) { this.loadExistingStudentsData(existingStudentsHOTInstance, resp.students); @@ -318,8 +327,9 @@ export class InstructorCourseEnrollPageComponent implements OnInit { this.statusMessageService.showErrorToast(resp.error.message); this.isAjaxSuccess = false; this.isExistingStudentsPanelCollapsed = !this.isExistingStudentsPanelCollapsed; // Collapse the panel again + }, () => { + this.isLoadingExistingStudents = false; }); - this.loading = false; } /** @@ -335,39 +345,42 @@ export class InstructorCourseEnrollPageComponent implements OnInit { * Shows modal box when user clicks on the 'paste' option in the * Handsontable context menu */ - showPasteModalBox(pasteModalBox: any): void { - this.ngbModal.open(pasteModalBox); - } - - /** - * Reset page to default view - */ - hideEnrollResults(): void { - this.showEnrollResults = false; - this.statusMessage.pop(); - window.scroll(0, 0); + showPasteModalBox(): void { + const modalContent: string = `Pasting data through the context menu is not supported due to browser restrictions.
                    + Please use Ctrl + V or ⌘ + V to paste your data instead.`; + this.simpleModalService.openInformationModal('Pasting data through the context menu', + SimpleModalType.WARNING, modalContent); } /** * Checks whether the course is present */ getCourseEnrollPageData(courseid: string): void { + this.existingStudents = []; + this.hasLoadingStudentsFailed = false; + this.isLoadingCourseEnrollPage = true; this.courseService.hasResponsesForCourse(courseid).subscribe((resp: HasResponses) => { this.coursePresent = true; - this.courseid = courseid; + this.courseId = courseid; if (resp.hasResponses) { - this.statusMessageService.showWarningModal('Existing feedback responses', - 'There are existing feedback responses for this course.', - 'Modifying records of enrolled students will result in some existing responses ' - + 'from those modified students to be deleted. You may wish to download the data ' - + 'before you make the changes.'); + const modalContent: string = `

                    There are existing feedback responses for this course.

                    + Modifying records of enrolled students will result in some existing responses + from those modified students to be deleted. You may wish to download the data + before you make the changes.`; + this.simpleModalService.openInformationModal( + 'Existing feedback responses', SimpleModalType.WARNING, modalContent); } }, (resp: ErrorMessageOutput) => { this.coursePresent = false; this.statusMessageService.showErrorToast(resp.error.message); + }, () => { + this.isLoadingCourseEnrollPage = false; }); this.studentService.getStudentsFromCourse({ courseId: courseid }).subscribe((resp: Students) => { this.existingStudents = resp.students; + }, (resp: ErrorMessageOutput) => { + this.hasLoadingStudentsFailed = true; + this.statusMessageService.showErrorToast(resp.error.message); }); } @@ -378,5 +391,4 @@ export class InstructorCourseEnrollPageComponent implements OnInit { (this.moreInfo as ElementRef) .nativeElement.scrollIntoView({ behavior: 'auto', block: 'start' }); } - } diff --git a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.module.ts b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.module.ts index 2c9cda1da62..ba8f9def634 100644 --- a/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.module.ts +++ b/src/web/app/pages-instructor/instructor-course-enroll-page/instructor-course-enroll-page.module.ts @@ -1,11 +1,22 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; import { HotTableModule } from '@handsontable/angular'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { AjaxLoadingModule } from '../../components/ajax-loading/ajax-loading.module'; import { AjaxPreloadModule } from '../../components/ajax-preload/ajax-preload.module'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; +import { PanelChevronModule } from '../../components/panel-chevron/panel-chevron.module'; import { StatusMessageModule } from '../../components/status-message/status-message.module'; import { InstructorCourseEnrollPageComponent } from './instructor-course-enroll-page.component'; +const routes: Routes = [ + { + path: '', + component: InstructorCourseEnrollPageComponent, + }, +]; + /** * Module for instructor course enroll page. */ @@ -18,10 +29,14 @@ import { InstructorCourseEnrollPageComponent } from './instructor-course-enroll- ], imports: [ CommonModule, - NgbModule, HotTableModule, StatusMessageModule, AjaxPreloadModule, + RouterModule.forChild(routes), + AjaxLoadingModule, + LoadingRetryModule, + LoadingSpinnerModule, + PanelChevronModule, ], }) export class InstructorCourseEnrollPageModule { } diff --git a/src/web/app/pages-instructor/instructor-course-student-details-page/__snapshots__/instructor-course-student-details-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-course-student-details-page/__snapshots__/instructor-course-student-details-page.component.spec.ts.snap index 6c4f3a17264..4f8b4e311f7 100644 --- a/src/web/app/pages-instructor/instructor-course-student-details-page/__snapshots__/instructor-course-student-details-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-course-student-details-page/__snapshots__/instructor-course-student-details-page.component.spec.ts.snap @@ -2,28 +2,78 @@ exports[`InstructorCourseStudentDetailsPageComponent should snap with default fields 1`] = ` - + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + `; exports[`InstructorCourseStudentDetailsPageComponent should snap with populated student 1`] = ` -

                    - firstName -

                    + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + `; diff --git a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.html b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.html index cfc95bc33fc..ef457bcff83 100644 --- a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.html +++ b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.html @@ -1,6 +1,10 @@ - -

                    {{student?.name}}

                    - - - -
                    + +
                    + +

                    {{student?.name}}

                    + + + +
                    +
                    +
                    diff --git a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.spec.ts b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.spec.ts index 70e9d577137..e217281d47f 100644 --- a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.spec.ts @@ -3,6 +3,8 @@ import { Component, Input } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { Gender, JoinState, Student, StudentProfile } from '../../../types/api-output'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; import { InstructorCourseStudentDetailsPageComponent, } from './instructor-course-student-details-page.component'; @@ -48,6 +50,8 @@ describe('InstructorCourseStudentDetailsPageComponent', () => { imports: [ HttpClientTestingModule, RouterTestingModule, + LoadingSpinnerModule, + LoadingRetryModule, ], }) .compileComponents(); diff --git a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.ts b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.ts index fe6a0074035..bc513f947e5 100644 --- a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.ts +++ b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { finalize } from 'rxjs/operators'; import { environment } from '../../../environments/environment'; import { StatusMessageService } from '../../../services/status-message.service'; import { StudentProfileService } from '../../../services/student-profile.service'; @@ -21,6 +22,14 @@ export class InstructorCourseStudentDetailsPageComponent implements OnInit { studentProfile?: StudentProfile; photoUrl: string = ''; + courseId: string = ''; + studentEmail: string = ''; + + isStudentLoading: boolean = false; + hasStudentLoadingFailed: boolean = false; + isStudentProfileLoading: boolean = false; + hasStudentProfileLoadingFailed: boolean = false; + constructor(private route: ActivatedRoute, private statusMessageService: StatusMessageService, private studentService: StudentService, @@ -28,12 +37,12 @@ export class InstructorCourseStudentDetailsPageComponent implements OnInit { ngOnInit(): void { this.route.queryParams.subscribe((queryParams: any) => { - const courseId: string = queryParams.courseid; - const studentEmail: string = queryParams.studentemail; + this.courseId = queryParams.courseid; + this.studentEmail = queryParams.studentemail; - this.loadStudentDetails(courseId, studentEmail); + this.loadStudentDetails(this.courseId, this.studentEmail); this.photoUrl - = `${environment.backendUrl}/webapi/student/profilePic?courseid=${courseId}&studentemail=${studentEmail}`; + = `${environment.backendUrl}/webapi/student/profilePic?courseid=${this.courseId}&studentemail=${this.studentEmail}`; }); } @@ -41,14 +50,24 @@ export class InstructorCourseStudentDetailsPageComponent implements OnInit { * Loads the student's details based on the given course ID and email. */ loadStudentDetails(courseId: string, studentEmail: string): void { - this.studentProfileService.getStudentProfile(studentEmail, courseId).subscribe((studentProfile: StudentProfile) => { + this.hasStudentLoadingFailed = false; + this.hasStudentProfileLoadingFailed = false; + this.isStudentProfileLoading = true; + this.isStudentLoading = true; + this.studentProfileService.getStudentProfile( + studentEmail, courseId, + ).pipe(finalize(() => this.isStudentProfileLoading = false)).subscribe((studentProfile: StudentProfile) => { this.studentProfile = studentProfile; }, (resp: ErrorMessageOutput) => { + this.hasStudentLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); }); - this.studentService.getStudent(courseId, studentEmail).subscribe((student: Student) => { + this.studentService.getStudent( + courseId, studentEmail, + ).pipe(finalize(() => this.isStudentLoading = false)).subscribe((student: Student) => { this.student = student; }, (resp: ErrorMessageOutput) => { + this.hasStudentProfileLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); }); } diff --git a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.module.ts b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.module.ts index 24515cfa64e..586ac6aca2d 100644 --- a/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.module.ts +++ b/src/web/app/pages-instructor/instructor-course-student-details-page/instructor-course-student-details-page.module.ts @@ -1,9 +1,18 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; import { StudentProfileModule } from '../student-profile/student-profile.module'; import { InstructorCourseStudentDetailsPageComponent } from './instructor-course-student-details-page.component'; +const routes: Routes = [ + { + path: '', + component: InstructorCourseStudentDetailsPageComponent, + }, +]; + /** * Module for instructor course student details page. */ @@ -17,7 +26,9 @@ import { InstructorCourseStudentDetailsPageComponent } from './instructor-course imports: [ CommonModule, StudentProfileModule, - RouterModule, + RouterModule.forChild(routes), + LoadingSpinnerModule, + LoadingRetryModule, ], }) export class InstructorCourseStudentDetailsPageModule { } diff --git a/src/web/app/pages-instructor/instructor-course-student-edit-page/__snapshots__/instructor-course-student-edit-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-course-student-edit-page/__snapshots__/instructor-course-student-edit-page.component.spec.ts.snap index 15d7e2ab661..6eba08bd35f 100644 --- a/src/web/app/pages-instructor/instructor-course-student-edit-page/__snapshots__/instructor-course-student-edit-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-course-student-edit-page/__snapshots__/instructor-course-student-edit-page.component.spec.ts.snap @@ -1,19 +1,84 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`InstructorCourseStudentEditPageComponent should snap when student is still loading 1`] = ` + + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + + +`; + exports[`InstructorCourseStudentEditPageComponent should snap with default fields 1`] = ` - + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + `; @@ -22,146 +87,169 @@ exports[`InstructorCourseStudentEditPageComponent should snap with student detai FormValidator={[Function Object]} courseId="undefined" editForm={[Function FormGroup]} + hasStudentLoadingFailed="false" isEmailFieldChanged="false" isEnabled={[Function Boolean]} + isStudentLoading="false" isTeamnameFieldChanged="false" ngbModal={[Function NgbModal]} route={[Function ActivatedRoute]} router={[Function Router]} + simpleModalService={[Function SimpleModalService]} statusMessageService={[Function StatusMessageService]} student={[Function Object]} + studentEmail="undefined" studentService={[Function StudentService]} > -
                    -
                    + + + +
                    +
                    -
                    -
                    -
                    - - + +
                    + +
                    -
                    -
                    -
                    - - + +
                    + + +
                    -
                    -
                    -
                    - - + +
                    + + +
                    -
                    -
                    -
                    - - + +
                    + + +
                    -
                    -
                    - + +
                    + + +
                    +
                    - + Comments: + +
                    + +
                    -
                    -
                    -
                    - -
                    -
                    -
                    - - - +
                    +
                    + +
                    +
                    +
                    + + +
                    -
                    + + +
                    `; diff --git a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-form.module.ts b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-form.module.ts new file mode 100644 index 00000000000..4a44ee0b548 --- /dev/null +++ b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-form.module.ts @@ -0,0 +1,25 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; +import { InstructorCourseStudentEditPageComponent } from './instructor-course-student-edit-page.component'; + +/** + * Module for course student edit form. + */ +@NgModule({ + declarations: [ + InstructorCourseStudentEditPageComponent, + ], + exports: [ + InstructorCourseStudentEditPageComponent, + ], + imports: [ + CommonModule, + ReactiveFormsModule, + LoadingSpinnerModule, + LoadingRetryModule, + ], +}) +export class InstructorCourseStudentEditFormModule { } diff --git a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.html b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.html index 5332e203212..2fadea1aa93 100644 --- a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.html +++ b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.html @@ -1,168 +1,153 @@ -
                    -
                    -
                    -
                    -
                    - -
                    - + +
                    +
                    +
                    + +
                    + +
                    {{ courseId }}
                    +
                    +
                    + +
                    + +
                    + + + {{ displayEmptyFieldMessage('Student Name') }} + + + {{ displayExceedMaxLengthMessage('Student Name', FormValidator.STUDENT_NAME_MAX_LENGTH) }} + +
                    +
                    +
                    +
                    + +
                    +
                    - - {{ displayEmptyFieldMessage('Student Name') }} + + {{ displayEmptyFieldMessage('Section Name') }} - - {{ displayExceedMaxLengthMessage('Student Name', FormValidator.STUDENT_NAME_MAX_LENGTH) }} + + {{ displayExceedMaxLengthMessage('Section Name', FormValidator.SECTION_NAME_MAX_LENGTH) }}
                    -
                    -
                    -
                    - -
                    - -
                    - - - {{ displayEmptyFieldMessage('Section Name') }} - - - {{ displayExceedMaxLengthMessage('Section Name', FormValidator.SECTION_NAME_MAX_LENGTH) }} -
                    -
                    -
                    - -
                    - -
                    - - - {{ displayEmptyFieldMessage('Team Name') }} - - - {{ displayExceedMaxLengthMessage('Team Name', FormValidator.TEAM_NAME_MAX_LENGTH) }} - -
                    -
                    -
                    -
                    - -
                    - -
                    + +
                    + +
                    - - - {{ displayEmptyFieldMessage('E-mail Address') }} - - - {{ displayExceedMaxLengthMessage('E-mail Address', FormValidator.EMAIL_MAX_LENGTH) }} - + + + {{ displayEmptyFieldMessage('Team Name') }} + + + {{ displayExceedMaxLengthMessage('Team Name', FormValidator.TEAM_NAME_MAX_LENGTH) }} + +
                    -
                    -
                    - -
                    - -
                    -
                    -
                    -
                    - -
                    -
                    -
                    - - - - - - - -
                    + diff --git a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.scss b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.scss index d824fdc5ce0..e32bd1cd132 100644 --- a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.scss +++ b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.scss @@ -10,14 +10,6 @@ label { margin-bottom: 15px; } -::ng-deep.modal-content { - padding: 0 !important; -} - -::ng-deep.close:focus { - outline: 0; -} - .invalid-field { padding-top: 5px; color: #B50000; diff --git a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.spec.ts b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.spec.ts index 382e9b44208..efd443e4ff1 100644 --- a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.spec.ts @@ -3,6 +3,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { JoinState } from '../../../types/api-output'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; import { InstructorCourseStudentEditPageComponent } from './instructor-course-student-edit-page.component'; describe('InstructorCourseStudentEditPageComponent', () => { @@ -16,6 +18,8 @@ describe('InstructorCourseStudentEditPageComponent', () => { RouterTestingModule, ReactiveFormsModule, HttpClientTestingModule, + LoadingSpinnerModule, + LoadingRetryModule, ], }) .compileComponents(); @@ -53,6 +57,13 @@ describe('InstructorCourseStudentEditPageComponent', () => { newstudentemail: new FormControl('jake@gmail.com'), comments: new FormControl('Cool cool cool.'), }); + component.isStudentLoading = false; + fixture.detectChanges(); + expect(fixture).toMatchSnapshot(); + }); + + it('should snap when student is still loading', () => { + component.isStudentLoading = true; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); }); diff --git a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.ts b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.ts index 55f59964818..84c043af7c5 100644 --- a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.ts +++ b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.component.ts @@ -1,15 +1,18 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { Subscription } from 'rxjs'; +import { finalize } from 'rxjs/operators'; import { StatusMessageService } from '../../../services/status-message.service'; import { JoinState, MessageOutput, Student } from '../../../types/api-output'; import { StudentUpdateRequest } from '../../../types/api-request'; import { ErrorMessageOutput } from '../../error-message-output'; +import { SimpleModalService } from '../../../services/simple-modal.service'; import { StudentService } from '../../../services/student.service'; import { FormValidator } from '../../../types/form-validator'; +import { SimpleModalType } from '../../components/simple-modal/simple-modal-type'; /** * Instructor course student edit page. @@ -21,24 +24,28 @@ import { FormValidator } from '../../../types/form-validator'; }) export class InstructorCourseStudentEditPageComponent implements OnInit, OnDestroy { + FormValidator: typeof FormValidator = FormValidator; // enum + @Input() isEnabled: boolean = true; courseId: string = ''; + studentEmail: string = ''; student!: Student; isTeamnameFieldChanged: boolean = false; isEmailFieldChanged: boolean = false; + isStudentLoading: boolean = false; + hasStudentLoadingFailed: boolean = false; editForm!: FormGroup; teamFieldSubscription?: Subscription; emailFieldSubscription?: Subscription; - FormValidator: typeof FormValidator = FormValidator; // enum - constructor(private route: ActivatedRoute, private router: Router, private statusMessageService: StatusMessageService, private studentService: StudentService, - private ngbModal: NgbModal) { } + private ngbModal: NgbModal, + private simpleModalService: SimpleModalService) { } ngOnInit(): void { if (!this.isEnabled) { @@ -58,6 +65,7 @@ export class InstructorCourseStudentEditPageComponent implements OnInit, OnDestr this.route.queryParams.subscribe((queryParams: any) => { this.courseId = queryParams.courseid; + this.studentEmail = queryParams.studentemail; this.loadStudentEditDetails(queryParams.courseid, queryParams.studentemail); }); } @@ -75,10 +83,15 @@ export class InstructorCourseStudentEditPageComponent implements OnInit, OnDestr * Loads student details required for this page. */ loadStudentEditDetails(courseId: string, studentEmail: string): void { - this.studentService.getStudent(courseId, studentEmail).subscribe((student: Student) => { + this.hasStudentLoadingFailed = false; + this.isStudentLoading = true; + this.studentService.getStudent( + courseId, studentEmail, + ).pipe(finalize(() => this.isStudentLoading = false)).subscribe((student: Student) => { this.student = student; this.initEditForm(); }, (resp: ErrorMessageOutput) => { + this.hasStudentLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); }); } @@ -128,13 +141,19 @@ export class InstructorCourseStudentEditPageComponent implements OnInit, OnDestr * Handles logic related to showing the appropriate modal boxes * upon submission of the form. Submits the form otherwise. */ - onSubmit(confirmDelModal: any, resendPastLinksModal: any): void { + onSubmit(resendPastLinksModal: any): void { if (!this.isEnabled) { return; } if (this.isTeamnameFieldChanged) { - this.ngbModal.open(confirmDelModal); + const modalContent: string = `Editing these fields will result in some existing responses from this student to be deleted. + You may download the data before you make the changes.`; + const modalRef: NgbModalRef = this.simpleModalService.openConfirmationModal( + 'Delete existing responses?', SimpleModalType.WARNING, modalContent); + modalRef.result.then(() => { + this.deleteExistingResponses(resendPastLinksModal); + }, () => {}); } else if (this.isEmailFieldChanged) { this.ngbModal.open(resendPastLinksModal); } else { diff --git a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.module.ts b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.module.ts index 0853cf76eb6..fd265ba169f 100644 --- a/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.module.ts +++ b/src/web/app/pages-instructor/instructor-course-student-edit-page/instructor-course-student-edit-page.module.ts @@ -1,23 +1,24 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; +import { InstructorCourseStudentEditFormModule } from './instructor-course-student-edit-form.module'; import { InstructorCourseStudentEditPageComponent } from './instructor-course-student-edit-page.component'; +const routes: Routes = [ + { + path: '', + component: InstructorCourseStudentEditPageComponent, + }, +]; + /** * Module for instructor course student edit page. */ @NgModule({ - declarations: [ - InstructorCourseStudentEditPageComponent, - ], - exports: [ - InstructorCourseStudentEditPageComponent, - ], imports: [ CommonModule, - ReactiveFormsModule, - RouterModule, + InstructorCourseStudentEditFormModule, + RouterModule.forChild(routes), ], }) export class InstructorCourseStudentEditPageModule { } diff --git a/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap index d92e7533e69..d14f7d5a8b3 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-courses-page/__snapshots__/instructor-courses-page.component.spec.ts.snap @@ -1,31 +1,99 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`InstructorCoursesPageComponent should snap when courses are still loading 1`] = ` + +
                    + +
                    + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + + +`; + exports[`InstructorCoursesPageComponent should snap when it is undeletable and unrestorable 1`] = `
                    -
                    -

                    - Active courses -

                    -
                    -
                    Section
                    + + + +
                    + +
                    -
                    - + Active courses + +
                    +
                    - - - - - - - - - - - - - - - - - - - - - - Enroll - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + - - - -
                    - Course ID - - - - - - - - Course Name - - - - - - - - Creation Date - - - - - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                    - CS3281 - - Modifiable Students and Courses - - 5 Nov 2018 - - - - - 1 - - - - - - 1 - - - - - - 1 - - - - - - 1 - - - -
                    - - + Creation Date + - Edit - - + Sections + + Teams + + Total Students + + Total Unregistered + + Action(s) +
                    + CS3281 + + Modifiable Students and Courses + + - Archive - + 5 Nov 2018 + + - + + 1 + + - - -
                    - CS3282 - - Nothing modifiable - - 2 Feb 2019 - - - - - 2 - - - - - - 2 - - - - - - 2 - - - - - - 2 - - - - - - + + + + 1 + + + + + + 1 + + - - - + + +
                    + CS3282 + + Nothing modifiable + + - Archive - + 2 Feb 2019 + + + + + + 2 + + + + + + 2 + + + + + + 2 + + + + + + 2 + + - - -
                    - + + + + + + + +
                    +
                    -
                    -

                    - Archived Courses -

                    + Archived courses +
                    + + Archive +
                    -
                    - - Archive - -
                    -
                    - - - -
                    + +
                    + + + +
                    +
                    @@ -388,60 +474,58 @@ exports[`InstructorCoursesPageComponent should snap when it is undeletable and u
                    -

                    - Deleted Courses -

                    + Deleted courses +
                    + + Recycle Bin +
                    -
                    - - Recycle Bin - -
                    -
                    + Restore All + + + + - - - + +
                    + - Delete All - - - - -
                    + +
                    +
                    @@ -456,27 +540,32 @@ exports[`InstructorCoursesPageComponent should snap with all courses in course s SortBy={[Function Object]} SortOrder={[Function Object]} activeCourses={[Function Array]} + activeTableSortBy={[Function Number]} + activeTableSortOrder={[Function Number]} archivedCourses={[Function Array]} + archivedTableSortBy={[Function Number]} + archivedTableSortOrder={[Function Number]} canDeleteAll={[Function Boolean]} canRestoreAll={[Function Boolean]} courseService={[Function CourseService]} courseStats={[Function Object]} - instructorService={[Function InstructorService]} + deletedTableSortBy={[Function Number]} + deletedTableSortOrder={[Function Number]} + hasLoadingFailed="false" isAddNewCourseFormExpanded="false" isArchivedCourseExpanded="false" + isLoading="false" isRecycleBinExpanded="false" - modalService={[Function NgbModal]} route={[Function ActivatedRoute]} + simpleModalService={[Function SimpleModalService]} softDeletedCourses={[Function Array]} statusMessageService={[Function StatusMessageService]} studentService={[Function StudentService]} tableComparatorService={[Function TableComparatorService]} - tableSortBy="0" - tableSortOrder={[Function Number]} >
                    -
                    -

                    - Active courses -

                    -
                    - + + + +
                    + +
                    -
                    - + Active courses + +
                    +
                    - - - - - - - - - - - - - - - - - - - - - - Enroll - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + - - - -
                    - Course ID - - - - - - - - Course Name - - - - - - - - Creation Date - - - - - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                    - CS3281 - - Modifiable Students and Courses - - 5 Nov 2018 - - - - - 1 - - - - - - 1 - - - - - - 1 - - - - - - 1 - - - -
                    - - + Creation Date + - Edit - - + Sections + + Teams + + Total Students + + Total Unregistered + + Action(s) +
                    + CS3281 + + Modifiable Students and Courses + + - Archive - + 5 Nov 2018 + + - + + 1 + + - - -
                    - CS3282 - - Nothing modifiable - - 2 Feb 2019 - - - - - 2 - - - - - - 2 - - - - - - 2 - - - - - - 2 - - - - - - + + + + 1 + + + + + + 1 + + - - - + + +
                    + CS3282 + + Nothing modifiable + + - Archive - + 2 Feb 2019 + + + + + + 2 + + + + + + 2 + + + + + + 2 + + + + + + 2 + + - - -
                    - + + + + + + + +
                    +
                    -
                    -

                    - Archived Courses -

                    + Archived courses +
                    + + Archive +
                    -
                    - - Archive - -
                    -
                    - - - -
                    + +
                    + + + +
                    +
                    @@ -839,66 +946,64 @@ exports[`InstructorCoursesPageComponent should snap with all courses in course s
                    -

                    - Deleted Courses -

                    + Deleted courses +
                    + + Recycle Bin +
                    -
                    - - Recycle Bin - -
                    -
                    + Restore All + + + + + - - - - + + + +
                    + - Delete All - - - - - - -
                    + +
                    +
                    @@ -913,27 +1018,32 @@ exports[`InstructorCoursesPageComponent should snap with default fields 1`] = ` SortBy={[Function Object]} SortOrder={[Function Object]} activeCourses={[Function Array]} + activeTableSortBy={[Function Number]} + activeTableSortOrder={[Function Number]} archivedCourses={[Function Array]} + archivedTableSortBy={[Function Number]} + archivedTableSortOrder={[Function Number]} canDeleteAll={[Function Boolean]} canRestoreAll={[Function Boolean]} courseService={[Function CourseService]} courseStats={[Function Object]} - instructorService={[Function InstructorService]} + deletedTableSortBy={[Function Number]} + deletedTableSortOrder={[Function Number]} + hasLoadingFailed="false" isAddNewCourseFormExpanded="false" isArchivedCourseExpanded="false" + isLoading={[Function Boolean]} isRecycleBinExpanded="false" - modalService={[Function NgbModal]} route={[Function ActivatedRoute]} + simpleModalService={[Function SimpleModalService]} softDeletedCourses={[Function Array]} statusMessageService={[Function StatusMessageService]} studentService={[Function StudentService]} tableComparatorService={[Function TableComparatorService]} - tableSortBy="0" - tableSortOrder={[Function Number]} >
                    -
                    +
                    + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + `; @@ -960,27 +1081,32 @@ exports[`InstructorCoursesPageComponent should snap with no courses in course st SortBy={[Function Object]} SortOrder={[Function Object]} activeCourses={[Function Array]} + activeTableSortBy={[Function Number]} + activeTableSortOrder={[Function Number]} archivedCourses={[Function Array]} + archivedTableSortBy={[Function Number]} + archivedTableSortOrder={[Function Number]} canDeleteAll={[Function Boolean]} canRestoreAll={[Function Boolean]} courseService={[Function CourseService]} courseStats={[Function Object]} - instructorService={[Function InstructorService]} + deletedTableSortBy={[Function Number]} + deletedTableSortOrder={[Function Number]} + hasLoadingFailed="false" isAddNewCourseFormExpanded="false" isArchivedCourseExpanded="false" + isLoading="false" isRecycleBinExpanded="false" - modalService={[Function NgbModal]} route={[Function ActivatedRoute]} + simpleModalService={[Function SimpleModalService]} softDeletedCourses={[Function Array]} statusMessageService={[Function StatusMessageService]} studentService={[Function StudentService]} tableComparatorService={[Function TableComparatorService]} - tableSortBy="0" - tableSortOrder={[Function Number]} >
                    -
                    -

                    - Active courses -

                    -
                    - + + + +
                    + +
                    -
                    - + Active courses + +
                    +
                    - - - - - - - - - - - - - - - - - + + + + + + + - + + + - - - - - - - - - - + + + + + + + + + + + + + - - - -
                    - Course ID - - - - - - - - Course Name - - - - - - - - Creation Date - - - - - - - - Sections - - Teams - - Total Students - - Total Unregistered - - Action(s) -
                    - CS3281 - - Modifiable Students and Courses - - 5 Nov 2018 - - - - +
                    - Show - - - - - - - - + + + + + + - Show - - - - - - - - + + + + + + - Show - - - - - - - - + + + + + + + + Sections + + Teams + + Total Students + + Total Unregistered + - Show - - - - - - - + Action(s) + +
                    - Other Actions - - + Modifiable Students and Courses + + - View - - - + 5 Nov 2018 + + - + + + + Show + + + - - -
                    - CS3282 - - Nothing modifiable - - 2 Feb 2019 - - - - - Show - - - - - - - - Show - - - - - - - - Show - - - - - - - - Show - - - - - - - - + + + + + Show + + + + + + + + + Show + + + + - - - + + +
                    + CS3282 + + Nothing modifiable + + - Archive - + 2 Feb 2019 + + + + + + + Show + + + + + + + + + Show + + + + + + + + + Show + + + + + + + + + Show + + + + - - -
                    - + + + + + + + +
                    +
                    -
                    + + + `; diff --git a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/__snapshots__/add-course-form.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/__snapshots__/add-course-form.component.spec.ts.snap index f453e871420..086a261076e 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/__snapshots__/add-course-form.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/__snapshots__/add-course-form.component.spec.ts.snap @@ -5,9 +5,9 @@ exports[`AddCourseFormComponent should snap when not enabled 1`] = ` closeCourseFormEvent={[Function EventEmitter]} courseAdded={[Function EventEmitter]} courseService={[Function Object]} + isAddingCourse="false" isEnabled="false" newCourseId="" - newCourseMessageTemplate={[Function TemplateRef_]} newCourseName="" statusMessageService={[Function Object]} timezone={[Function String]} @@ -50,7 +50,6 @@ exports[`AddCourseFormComponent should snap when not enabled 1`] = ` class="form-control ng-untouched ng-pristine ng-valid" id="new-course-id" maxlength="40" - ngbtooltip="Enter the identifier of the course, e.g.CS3215-2013Semester1." placeholder="e.g. CS3215-2013Semester1" type="text" /> @@ -71,7 +70,6 @@ exports[`AddCourseFormComponent should snap when not enabled 1`] = ` class="form-control ng-untouched ng-pristine ng-valid" id="new-course-name" maxlength="64" - ngbtooltip="Enter the name of the course, e.g. Software Engineering." placeholder="e.g. Software Engineering" type="text" /> @@ -81,9 +79,15 @@ exports[`AddCourseFormComponent should snap when not enabled 1`] = ` class="form-group row" >
                    @@ -125,10 +126,11 @@ exports[`AddCourseFormComponent should snap when not enabled 1`] = ` class="col-md-9 offset-md-3 text-md-left" >
                    @@ -142,9 +144,9 @@ exports[`AddCourseFormComponent should snap with default fields 1`] = ` closeCourseFormEvent={[Function EventEmitter]} courseAdded={[Function EventEmitter]} courseService={[Function Object]} + isAddingCourse="false" isEnabled={[Function Boolean]} newCourseId="" - newCourseMessageTemplate={[Function TemplateRef_]} newCourseName="" statusMessageService={[Function Object]} timezone={[Function String]} @@ -187,7 +189,6 @@ exports[`AddCourseFormComponent should snap with default fields 1`] = ` class="form-control ng-untouched ng-pristine ng-valid" id="new-course-id" maxlength="40" - ngbtooltip="Enter the identifier of the course, e.g.CS3215-2013Semester1." placeholder="e.g. CS3215-2013Semester1" type="text" /> @@ -208,7 +209,6 @@ exports[`AddCourseFormComponent should snap with default fields 1`] = ` class="form-control ng-untouched ng-pristine ng-valid" id="new-course-name" maxlength="64" - ngbtooltip="Enter the name of the course, e.g. Software Engineering." placeholder="e.g. Software Engineering" type="text" /> @@ -218,9 +218,15 @@ exports[`AddCourseFormComponent should snap with default fields 1`] = ` class="form-group row" >
                    @@ -262,10 +265,11 @@ exports[`AddCourseFormComponent should snap with default fields 1`] = ` class="col-md-9 offset-md-3 text-md-left" >
                    diff --git a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.html b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.html index 559ac741e6f..9ea2f5ad3cf 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.html +++ b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.html @@ -9,44 +9,39 @@
                    + [maxlength]="40" [disabled]="isAddingCourse" placeholder="e.g. CS3215-2013Semester1"/>
                    + [maxlength]="64" [disabled]="isAddingCourse" placeholder="e.g. Software Engineering"/>
                    - -
                    -
                    - + - +
                    - +
                    - - - The course has been added. Click here - to add students to the course or click here - to add other instructors.
                    If you don't see the course in the list below, - please refresh the page after a few moments. -
                    diff --git a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.spec.ts b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.spec.ts index f92d7c157c1..a2bb6d226f6 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.spec.ts @@ -3,7 +3,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { CourseService } from '../../../../services/course.service'; import { StatusMessageService } from '../../../../services/status-message.service'; import { TimezoneService } from '../../../../services/timezone.service'; -import { Course } from '../../../../types/api-output'; +import { AjaxLoadingModule } from '../../../components/ajax-loading/ajax-loading.module'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -17,29 +17,21 @@ describe('AddCourseFormComponent', () => { let component: AddCourseFormComponent; let fixture: ComponentFixture; - const testDate: Date = new Date('2020-13-05T08:15:30'); const testCourseId: string = 'CS3281'; const testCourseName: string = 'Valid course'; const testTimeZone: string = 'UTC'; - const testCourse: Course = { - courseId: testCourseId, - courseName: testCourseName, - timeZone: testTimeZone, - creationTimestamp: testDate.getTime(), - deletionTimestamp: 0, - }; const timeZoneOffsets1: Record = { GMT: 0 }; const spyStatusMessageService: any = { showErrorToast: jest.fn(), - showSuccessToastTemplate: jest.fn(), + showSuccessToast: jest.fn(), }; const timezoneServiceStub: any = { getTzOffsets: jest.fn(() => timeZoneOffsets1), guessTimezone: jest.fn(() => 'UTC'), }; const spyCourseService: any = { - createCourse: jest.fn(() => of(testCourse)), + createCourse: jest.fn(() => of({})), }; beforeEach(async(() => { @@ -51,6 +43,7 @@ describe('AddCourseFormComponent', () => { ReactiveFormsModule, RouterTestingModule, NgbModule, + AjaxLoadingModule, ], providers: [ { provide: StatusMessageService, useValue: spyStatusMessageService }, @@ -99,7 +92,6 @@ describe('AddCourseFormComponent', () => { component.newCourseName = testCourseName; component.onSubmit(); fixture.detectChanges(); - expect(spyStatusMessageService.showSuccessToastTemplate).toHaveBeenCalled(); - expect(component.course).toEqual(testCourse); + expect(spyStatusMessageService.showSuccessToast).toHaveBeenCalled(); }); }); diff --git a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.ts b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.ts index 89e1c92fd6a..adb928c01e4 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.ts +++ b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.component.ts @@ -1,10 +1,22 @@ -import { Component, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { finalize } from 'rxjs/operators'; import { CourseService } from '../../../../services/course.service'; import { StatusMessageService } from '../../../../services/status-message.service'; import { TimezoneService } from '../../../../services/timezone.service'; -import { Course } from '../../../../types/api-output'; import { ErrorMessageOutput } from '../../../error-message-output'; +interface Timezone { + id: string; + offset: string; +} + +const formatTwoDigits: Function = (n: number): string => { + if (n < 10) { + return `0${n}`; + } + return String(n); +}; + /** * Instructor add new course form */ @@ -18,25 +30,28 @@ export class AddCourseFormComponent implements OnInit { @Input() isEnabled: boolean = true; @Output() courseAdded: EventEmitter = new EventEmitter(); @Output() closeCourseFormEvent: EventEmitter = new EventEmitter(); - @ViewChild('newCourseMessageTemplate') newCourseMessageTemplate!: TemplateRef; - timezones: string[] = []; + timezones: Timezone[] = []; timezone: string = ''; newCourseId: string = ''; newCourseName: string = ''; - course!: Course; + isAddingCourse: boolean = false; constructor(private statusMessageService: StatusMessageService, private courseService: CourseService, private timezoneService: TimezoneService) { } ngOnInit(): void { - if (!this.isEnabled) { - this.timezones = ['UTC', 'Other options omitted...']; - this.timezone = 'UTC'; - return; + for (const [id, offset] of Object.entries(this.timezoneService.getTzOffsets())) { + const hourOffset: number = Math.floor(Math.abs(offset) / 60); + const minOffset: number = Math.abs(offset) % 60; + const sign: string = offset < 0 ? '-' : '+'; + this.timezones.push({ + id, + offset: offset === 0 ? 'UTC' : `UTC ${sign}${formatTwoDigits(hourOffset)}:${formatTwoDigits(minOffset)}`, + }); } - this.timezones = Object.keys(this.timezoneService.getTzOffsets()); + this.timezone = this.timezoneService.guessTimezone(); } @@ -62,14 +77,15 @@ export class AddCourseFormComponent implements OnInit { 'Please make sure you have filled in both Course ID and Name before adding the course!'); return; } + + this.isAddingCourse = true; this.courseService.createCourse({ courseName: this.newCourseName, timeZone: this.timezone, courseId: this.newCourseId, - }).subscribe((course: Course) => { + }).pipe(finalize(() => this.isAddingCourse = false)).subscribe(() => { this.courseAdded.emit(); - this.course = course; - this.statusMessageService.showSuccessToastTemplate(this.newCourseMessageTemplate); + this.statusMessageService.showSuccessToast('The course has been added.'); }, (resp: ErrorMessageOutput) => { this.statusMessageService.showErrorToast(resp.error.message); }); diff --git a/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.module.ts b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.module.ts new file mode 100644 index 00000000000..1d06626345c --- /dev/null +++ b/src/web/app/pages-instructor/instructor-courses-page/add-course-form/add-course-form.module.ts @@ -0,0 +1,23 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; +import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { AjaxLoadingModule } from '../../../components/ajax-loading/ajax-loading.module'; +import { AddCourseFormComponent } from './add-course-form.component'; + +/** + * Module for form for adding courses. + */ +@NgModule({ + declarations: [AddCourseFormComponent], + exports: [AddCourseFormComponent], + imports: [ + CommonModule, + FormsModule, + RouterModule, + AjaxLoadingModule, + NgbTooltipModule, + ], +}) +export class AddCourseFormModule { } diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.html b/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.html deleted file mode 100644 index 621a15914db..00000000000 --- a/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.scss b/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.scss deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.spec.ts b/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.spec.ts deleted file mode 100644 index ab3d678223e..00000000000 --- a/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { CoursePermanentDeletionConfirmModalComponent } from './course-permanent-deletion-confirm-modal.component'; - -describe('CoursePermanentDeletionConfirmModalComponent', () => { - let component: CoursePermanentDeletionConfirmModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [CoursePermanentDeletionConfirmModalComponent], - providers: [NgbActiveModal], - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CoursePermanentDeletionConfirmModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.ts b/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.ts deleted file mode 100644 index e2b9535a1d8..00000000000 --- a/src/web/app/pages-instructor/instructor-courses-page/course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component, Input, OnInit } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; - -/** - * Modal to confirm permanent deletion of one course or all courses in the Recycle Bin. - */ -@Component({ - selector: 'tm-course-permanent-deletion-confirm-modal', - templateUrl: './course-permanent-deletion-confirm-modal.component.html', - styleUrls: ['./course-permanent-deletion-confirm-modal.component.scss'], -}) -export class CoursePermanentDeletionConfirmModalComponent implements OnInit { - - @Input() - courseId: string = ''; - - @Input() - isDeleteAll: boolean = false; - - constructor(public activeModal: NgbActiveModal) { } - - ngOnInit(): void { - } - -} diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.html b/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.html deleted file mode 100644 index 63dfdde2701..00000000000 --- a/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.scss b/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.scss deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.spec.ts b/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.spec.ts deleted file mode 100644 index 37151160c1a..00000000000 --- a/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.spec.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { CourseSoftDeletionConfirmModalComponent } from './course-soft-deletion-confirm-modal.component'; - -describe('CourseSoftDeletionConfirmModalComponent', () => { - let component: CourseSoftDeletionConfirmModalComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [CourseSoftDeletionConfirmModalComponent], - providers: [NgbActiveModal], - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CourseSoftDeletionConfirmModalComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.ts b/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.ts deleted file mode 100644 index 52d35c50fc8..00000000000 --- a/src/web/app/pages-instructor/instructor-courses-page/course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; - -/** - * Modal to confirm soft deletion of a course. - */ -@Component({ - selector: 'tm-course-soft-deletion-confirm-modal', - templateUrl: './course-soft-deletion-confirm-modal.component.html', - styleUrls: ['./course-soft-deletion-confirm-modal.component.scss'], -}) -export class CourseSoftDeletionConfirmModalComponent implements OnInit { - - constructor(public activeModal: NgbActiveModal) { } - - ngOnInit(): void { - } - -} diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html index b62c1e891e0..ad9be85ecc5 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.html @@ -1,130 +1,140 @@
                    -
                    -
                    +
                    - - - - -
                    -

                    Active courses

                    -
                    - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + +
                    - Course ID - - - - - Course Name - - - - - Creation Date - - - - SectionsTeamsTotal StudentsTotal UnregisteredAction(s)
                    {{course.course.courseId}}{{course.course.courseName}} - {{course.course.creationTimestamp | date:'d MMM yyyy'}} - - - - Show - - - - {{ courseStats[course.course.courseId].sections }} - - - - - Show - - - - {{ courseStats[course.course.courseId].teams }} - - - - - Show - - - - {{ courseStats[course.course.courseId].students }} - - - - - Show - - - - {{ courseStats[course.course.courseId].unregistered }} - - -
                    +

                    No records found.

                    +
                    +
                    -
                    +
                    -

                    - Archived Courses -

                    +

                    + Archived courses +

                    -
                    -
                    -
                    - Archive -
                    -
                    - - -
                    +
                    + Archive +
                    +
                    -
                    +
                    - - - + + + @@ -180,10 +208,10 @@

                    - - + + +
                    Course IDCourse NameCreation Date + Course ID + + + + + + + Course Name + + + + + + + Creation Date + + + + + + Action(s)
                    {{course.course.courseId}} {{course.course.courseName}} - {{course.course.creationTimestamp | date:'d MMM yyyy'}} + + {{course.course.creationTimestamp | date:'d MMM yyyy'}} + @@ -204,43 +232,66 @@

                    -

                    - Deleted Courses -

                    +

                    + Deleted courses +

                    -
                    -
                    -
                    - Recycle Bin -
                    -
                    - - - - - - -
                    +
                    + Recycle Bin +
                    + + + + +
                    -
                    +
                    - - - - + + + + @@ -248,11 +299,15 @@

                    - - diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss index 69bb5b56764..0c20342cadc 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.scss @@ -14,25 +14,10 @@ padding: 0; } -.recycle-bin-header { - background-color: var(--secondary); - cursor: pointer; -} - -.margin-left-10px { - margin-left: 10px; -} - .background-color-medium-gray { background-color: #E5E5E6; } -.archive-course-header { - cursor: pointer; - padding-top: .7rem; - padding-bottom: .7rem; -} - .text-color-black { color: #000; } @@ -67,12 +52,8 @@ margin-top: 30px; } -.bin-header-button button { - margin-right: .6em; -} - -.actions-cell button { - margin: 2px; +.actions-cell button:not(.dropdown-item) { + margin-left: var(--btn-margin); } .dropdown-menu { diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts index 6f9ff994b01..cb6beed507a 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.spec.ts @@ -1,13 +1,15 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { Component } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { AjaxLoadingModule } from '../../components/ajax-loading/ajax-loading.module'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; +import { PanelChevronModule } from '../../components/panel-chevron/panel-chevron.module'; +import { AddCourseFormModule } from './add-course-form/add-course-form.module'; import { InstructorCoursesPageComponent } from './instructor-courses-page.component'; -@Component({ selector: 'tm-add-course-form', template: '' }) -class AddCourseFormStubComponent {} - describe('InstructorCoursesPageComponent', () => { let component: InstructorCoursesPageComponent; let fixture: ComponentFixture; @@ -106,12 +108,17 @@ describe('InstructorCoursesPageComponent', () => { TestBed.configureTestingModule({ declarations: [ InstructorCoursesPageComponent, - AddCourseFormStubComponent, ], imports: [ HttpClientTestingModule, RouterTestingModule, NgbModule, + BrowserAnimationsModule, + LoadingSpinnerModule, + AjaxLoadingModule, + AddCourseFormModule, + LoadingRetryModule, + PanelChevronModule, ], }) .compileComponents(); @@ -136,6 +143,7 @@ describe('InstructorCoursesPageComponent', () => { component.archivedCourses = archivedCourses; component.softDeletedCourses = deletedCourses; component.courseStats = courseStats; + component.isLoading = false; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); }); @@ -147,12 +155,20 @@ describe('InstructorCoursesPageComponent', () => { component.courseStats = courseStats; component.canDeleteAll = false; component.canRestoreAll = false; + component.isLoading = false; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); }); it('should snap with no courses in course stats', () => { component.activeCourses = activeCourses; + component.isLoading = false; + fixture.detectChanges(); + expect(fixture).toMatchSnapshot(); + }); + + it('should snap when courses are still loading', () => { + component.isLoading = true; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); }); diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts index a7a195da642..416c2deb939 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.component.ts @@ -1,9 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { forkJoin, Observable } from 'rxjs'; +import { finalize } from 'rxjs/operators'; import { CourseService } from '../../../services/course.service'; -import { InstructorService } from '../../../services/instructor.service'; +import { SimpleModalService } from '../../../services/simple-modal.service'; import { StatusMessageService } from '../../../services/status-message.service'; import { StudentService } from '../../../services/student.service'; import { TableComparatorService } from '../../../services/table-comparator.service'; @@ -11,25 +12,21 @@ import { Course, CourseArchive, Courses, - InstructorPrivilege, JoinState, MessageOutput, Student, Students, } from '../../../types/api-output'; import { SortBy, SortOrder } from '../../../types/sort-properties'; +import { SimpleModalType } from '../../components/simple-modal/simple-modal-type'; +import { collapseAnim } from '../../components/teammates-common/collapse-anim'; import { ErrorMessageOutput } from '../../error-message-output'; -import { - CoursePermanentDeletionConfirmModalComponent, -} from './course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component'; -import { - CourseSoftDeletionConfirmModalComponent, -} from './course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component'; interface CourseModel { course: Course; canModifyCourse: boolean; canModifyStudent: boolean; + isLoadingCourseStats: boolean; } /** @@ -39,6 +36,7 @@ interface CourseModel { selector: 'tm-instructor-courses-page', templateUrl: './instructor-courses-page.component.html', styleUrls: ['./instructor-courses-page.component.scss'], + animations: [collapseAnim], }) export class InstructorCoursesPageComponent implements OnInit { @@ -47,13 +45,19 @@ export class InstructorCoursesPageComponent implements OnInit { softDeletedCourses: CourseModel[] = []; courseStats: Record> = {}; - tableSortOrder: SortOrder = SortOrder.ASC; - tableSortBy: SortBy = SortBy.NONE; + activeTableSortOrder: SortOrder = SortOrder.ASC; + activeTableSortBy: SortBy = SortBy.COURSE_CREATION_DATE; + archivedTableSortOrder: SortOrder = SortOrder.ASC; + archivedTableSortBy: SortBy = SortBy.COURSE_NAME; + deletedTableSortOrder: SortOrder = SortOrder.ASC; + deletedTableSortBy: SortBy = SortBy.COURSE_NAME; // enum SortBy: typeof SortBy = SortBy; SortOrder: typeof SortOrder = SortOrder; + isLoading: boolean = false; + hasLoadingFailed: boolean = false; isRecycleBinExpanded: boolean = false; canDeleteAll: boolean = true; canRestoreAll: boolean = true; @@ -64,8 +68,7 @@ export class InstructorCoursesPageComponent implements OnInit { private statusMessageService: StatusMessageService, private courseService: CourseService, private studentService: StudentService, - private instructorService: InstructorService, - private modalService: NgbModal, + private simpleModalService: SimpleModalService, private tableComparatorService: TableComparatorService) { } ngOnInit(): void { @@ -81,59 +84,71 @@ export class InstructorCoursesPageComponent implements OnInit { * Loads instructor courses required for this page. */ loadInstructorCourses(): void { + this.hasLoadingFailed = false; + this.isLoading = true; this.activeCourses = []; this.archivedCourses = []; this.softDeletedCourses = []; this.courseService.getAllCoursesAsInstructor('active').subscribe((resp: Courses) => { - for (const course of resp.courses) { - this.instructorService.loadInstructorPrivilege({ courseId: course.courseId }) - .subscribe((instructorPrivilege: InstructorPrivilege) => { - const canModifyCourse: boolean = instructorPrivilege.canModifyCourse; - const canModifyStudent: boolean = instructorPrivilege.canModifyStudent; - const activeCourse: CourseModel = Object.assign({}, { course, canModifyCourse, canModifyStudent }); - this.activeCourses.push(activeCourse); - }, (error: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(error.error.message); - }); - } + resp.courses.forEach((course: Course) => { + let canModifyCourse: boolean = false; + let canModifyStudent: boolean = false; + if (course.privileges) { + canModifyCourse = course.privileges.canModifyCourse; + canModifyStudent = course.privileges.canModifyStudent; + } + const isLoadingCourseStats: boolean = false; + const activeCourse: CourseModel = Object.assign({}, + { course, canModifyCourse, canModifyStudent, isLoadingCourseStats }); + this.activeCourses.push(activeCourse); + }); + this.activeCoursesDefaultSort(); + this.isLoading = false; }, (resp: ErrorMessageOutput) => { + this.isLoading = false; + this.hasLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); }); this.courseService.getAllCoursesAsInstructor('archived').subscribe((resp: Courses) => { for (const course of resp.courses) { - this.instructorService.loadInstructorPrivilege({ - courseId: course.courseId, - }).subscribe((instructorPrivilege: InstructorPrivilege) => { - const canModifyCourse: boolean = instructorPrivilege.canModifyCourse; - const canModifyStudent: boolean = instructorPrivilege.canModifyStudent; - const archivedCourse: CourseModel = Object.assign({}, { course, canModifyCourse, canModifyStudent }); - this.archivedCourses.push(archivedCourse); - }, (error: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(error.error.message); - }); + let canModifyCourse: boolean = false; + let canModifyStudent: boolean = false; + if (course.privileges) { + canModifyCourse = course.privileges.canModifyCourse; + canModifyStudent = course.privileges.canModifyStudent; + } + const isLoadingCourseStats: boolean = false; + const archivedCourse: CourseModel = Object.assign({}, + { course, canModifyCourse, canModifyStudent, isLoadingCourseStats }); + this.archivedCourses.push(archivedCourse); + this.archivedCoursesDefaultSort(); } }, (resp: ErrorMessageOutput) => { + this.hasLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); }); this.courseService.getAllCoursesAsInstructor('softDeleted').subscribe((resp: Courses) => { for (const course of resp.courses) { - this.instructorService.loadInstructorPrivilege({ courseId: course.courseId }) - .subscribe((instructorPrivilege: InstructorPrivilege) => { - const canModifyCourse: boolean = instructorPrivilege.canModifyCourse; - const canModifyStudent: boolean = instructorPrivilege.canModifyStudent; - const softDeletedCourse: CourseModel = Object.assign({}, { course, canModifyCourse, canModifyStudent }); - this.softDeletedCourses.push(softDeletedCourse); - if (!softDeletedCourse.canModifyCourse) { - this.canDeleteAll = false; - this.canRestoreAll = false; - } - }, (error: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(error.error.message); - }); + let canModifyCourse: boolean = false; + let canModifyStudent: boolean = false; + if (course.privileges) { + canModifyCourse = course.privileges.canModifyCourse; + canModifyStudent = course.privileges.canModifyStudent; + } + const isLoadingCourseStats: boolean = false; + const softDeletedCourse: CourseModel = Object.assign({}, + { course, canModifyCourse, canModifyStudent, isLoadingCourseStats }); + this.softDeletedCourses.push(softDeletedCourse); + this.deletedCoursesDefaultSort(); + if (!softDeletedCourse.canModifyCourse) { + this.canDeleteAll = false; + this.canRestoreAll = false; + } } }, (resp: ErrorMessageOutput) => { + this.hasLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); }); } @@ -141,22 +156,26 @@ export class InstructorCoursesPageComponent implements OnInit { /** * Constructs the url for course stats from the given course id. */ - getCourseStats(courseId: string): void { + getCourseStats(idx: number): void { + const course: CourseModel = this.activeCourses[idx]; + const courseId: string = course.course.courseId; if (!courseId) { this.statusMessageService.showErrorToast(`Course ${courseId} is not found!`); return; } - this.studentService.getStudentsFromCourse({ courseId }).subscribe((students: Students) => { - this.courseStats[courseId] = { - sections: (new Set(students.students.map((value: Student) => value.sectionName))).size, - teams: (new Set(students.students.map((value: Student) => value.teamName))).size, - students: students.students.length, - unregistered: students.students.filter((value: Student) => value.joinState === JoinState.NOT_JOINED) - .length, - }; - }, (resp: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(resp.error.message); - }); + course.isLoadingCourseStats = true; + this.studentService.getStudentsFromCourse({ courseId }) + .pipe(finalize(() => course.isLoadingCourseStats = false)) + .subscribe((students: Students) => { + this.courseStats[courseId] = { + sections: (new Set(students.students.map((value: Student) => value.sectionName))).size, + teams: (new Set(students.students.map((value: Student) => value.teamName))).size, + students: students.students.length, + unregistered: students.students.filter((value: Student) => value.joinState === JoinState.NOT_JOINED).length, + }; + }, (resp: ErrorMessageOutput) => { + this.statusMessageService.showErrorToast(resp.error.message); + }); } /** @@ -192,6 +211,7 @@ export class InstructorCoursesPageComponent implements OnInit { this.activeCourses = this.removeCourse(this.activeCourses, courseId); if (courseToBeRemoved !== undefined) { this.archivedCourses.push(courseToBeRemoved); + this.archivedCourses.sort(this.sortBy(this.archivedTableSortBy, this.archivedTableSortOrder)); } } @@ -204,7 +224,7 @@ export class InstructorCoursesPageComponent implements OnInit { this.archivedCourses = this.removeCourse(this.archivedCourses, courseId); if (courseToBeRemoved !== undefined) { this.activeCourses.push(courseToBeRemoved); - this.activeCourses.sort(this.sortBy(this.tableSortBy)); + this.activeCourses.sort(this.sortBy(this.activeTableSortBy, this.activeTableSortOrder)); } } @@ -234,7 +254,8 @@ export class InstructorCoursesPageComponent implements OnInit { this.statusMessageService.showErrorToast(`Course ${courseId} is not found!`); return; } - const modalRef: NgbModalRef = this.modalService.open(CourseSoftDeletionConfirmModalComponent); + const modalRef: NgbModalRef = this.simpleModalService.openConfirmationModal('Warning: The course will be moved to the recycle bin.', + SimpleModalType.WARNING, 'Are you sure you want to continue?'); modalRef.result.then(() => { this.courseService.binCourse(courseId).subscribe((course: Course) => { this.moveCourseToRecycleBin(courseId, course.deletionTimestamp); @@ -243,7 +264,7 @@ export class InstructorCoursesPageComponent implements OnInit { }, (resp: ErrorMessageOutput) => { this.statusMessageService.showErrorToast(resp.error.message); }); - }, () => {}); + }); } /** @@ -256,12 +277,14 @@ export class InstructorCoursesPageComponent implements OnInit { if (activeCourseToBeRemoved !== undefined) { activeCourseToBeRemoved.course.deletionTimestamp = deletionTimeStamp; this.softDeletedCourses.push(activeCourseToBeRemoved); + this.softDeletedCourses.sort(this.sortBy(this.deletedTableSortBy, this.deletedTableSortOrder)); } else { const archivedCourseToBeRemoved: CourseModel | undefined = this.findCourse(this.archivedCourses, courseId); this.archivedCourses = this.removeCourse(this.archivedCourses, courseId); if (archivedCourseToBeRemoved !== undefined) { archivedCourseToBeRemoved.course.deletionTimestamp = deletionTimeStamp; this.softDeletedCourses.push(archivedCourseToBeRemoved); + this.softDeletedCourses.sort(this.sortBy(this.deletedTableSortBy, this.deletedTableSortOrder)); } } } @@ -274,7 +297,12 @@ export class InstructorCoursesPageComponent implements OnInit { this.statusMessageService.showErrorToast(`Course ${courseId} is not found!`); return; } - const modalRef: NgbModalRef = this.modalService.open(CoursePermanentDeletionConfirmModalComponent); + const modalContent: string = `Are you sure you want to permanently delete ${courseId}?
                    + This operation will delete all students and sessions in these courses. + All instructors of these courses will not be able to access them hereafter as well.`; + + const modalRef: NgbModalRef = this.simpleModalService.openConfirmationModal( + `Delete course ${ courseId } permanently?`, SimpleModalType.DANGER, modalContent); modalRef.componentInstance.courseId = courseId; modalRef.result.then(() => { this.courseService.deleteCourse(courseId).subscribe(() => { @@ -283,7 +311,7 @@ export class InstructorCoursesPageComponent implements OnInit { }, (resp: ErrorMessageOutput) => { this.statusMessageService.showErrorToast(resp.error.message); }); - }, () => {}); + }); } /** @@ -307,8 +335,12 @@ export class InstructorCoursesPageComponent implements OnInit { * Permanently deletes all soft-deleted courses in Recycle Bin. */ onDeleteAll(): void { - const modalRef: NgbModalRef = this.modalService.open(CoursePermanentDeletionConfirmModalComponent); - modalRef.componentInstance.isDeleteAll = true; + const modalContent: string = `Are you sure you want to permanently delete all the courses in the Recycle Bin?
                    + This operation will delete all students and sessions in these courses. + All instructors of these courses will not be able to access them hereafter as well.`; + + const modalRef: NgbModalRef = this.simpleModalService.openConfirmationModal( + 'Deleting all courses permanently?', SimpleModalType.DANGER, modalContent); modalRef.result.then(() => { const deleteRequests: Observable[] = []; this.softDeletedCourses.forEach((courseToDelete: CourseModel) => { @@ -322,7 +354,7 @@ export class InstructorCoursesPageComponent implements OnInit { this.statusMessageService.showErrorToast(resp.error.message); }); - }, () => {}); + }); } /** @@ -343,19 +375,75 @@ export class InstructorCoursesPageComponent implements OnInit { } /** - * Sorts the courses table + * Sorts the active courses table */ sortCoursesEvent(by: SortBy): void { - this.tableSortBy = by; - this.tableSortOrder = - this.tableSortOrder === SortOrder.DESC ? SortOrder.ASC : SortOrder.DESC; - this.activeCourses.sort(this.sortBy(by)); + this.activeTableSortOrder = (this.activeTableSortBy === by) ? + this.activeTableSortOrder === SortOrder.ASC ? + SortOrder.DESC : + SortOrder.ASC : + SortOrder.ASC; + this.activeTableSortBy = by; + this.activeCourses.sort(this.sortBy(by, this.activeTableSortOrder)); + } + + /** + * Active courses default sort on page load + */ + activeCoursesDefaultSort(): void { + this.activeTableSortBy = SortBy.COURSE_CREATION_DATE; + this.activeTableSortOrder = SortOrder.DESC; + this.activeCourses.sort(this.sortBy(this.activeTableSortBy, this.activeTableSortOrder)); + } + + /** + * Sorts the archived courses table + */ + sortArchivedCoursesEvent(by: SortBy): void { + this.archivedTableSortOrder = (this.archivedTableSortBy === by) ? + this.archivedTableSortOrder === SortOrder.ASC ? + SortOrder.DESC : + SortOrder.ASC : + SortOrder.ASC; + this.archivedTableSortBy = by; + this.archivedCourses.sort(this.sortBy(by, this.archivedTableSortOrder)); + } + + /** + * Archived courses default sort on page load + */ + archivedCoursesDefaultSort(): void { + this.archivedTableSortBy = SortBy.COURSE_CREATION_DATE; + this.archivedTableSortOrder = SortOrder.DESC; + this.archivedCourses.sort(this.sortBy(this.archivedTableSortBy, this.archivedTableSortOrder)); + } + + /** + * Sorts the soft-deleted courses table + */ + sortDeletedCoursesEvent(by: SortBy): void { + this.deletedTableSortOrder = (this.deletedTableSortBy === by) ? + this.deletedTableSortOrder === SortOrder.ASC ? + SortOrder.DESC : + SortOrder.ASC : + SortOrder.ASC; + this.deletedTableSortBy = by; + this.softDeletedCourses.sort(this.sortBy(by, this.deletedTableSortOrder)); + } + + /** + * Deleted courses default sort on page load + */ + deletedCoursesDefaultSort(): void { + this.deletedTableSortBy = SortBy.COURSE_DELETION_DATE; + this.deletedTableSortOrder = SortOrder.DESC; + this.softDeletedCourses.sort(this.sortBy(this.deletedTableSortBy, this.deletedTableSortOrder)); } /** * Returns a function to determine the order of sort */ - sortBy(by: SortBy): + sortBy(by: SortBy, order: SortOrder): ((a: CourseModel , b: CourseModel) => number) { return (a: CourseModel, b: CourseModel): number => { let strA: string; @@ -369,7 +457,7 @@ export class InstructorCoursesPageComponent implements OnInit { strA = a.course.courseName; strB = b.course.courseName; break; - case SortBy.SESSION_CREATION_DATE: + case SortBy.COURSE_CREATION_DATE: strA = a.course.creationTimestamp.toString(); strB = b.course.creationTimestamp.toString(); break; @@ -377,7 +465,7 @@ export class InstructorCoursesPageComponent implements OnInit { strA = ''; strB = ''; } - return this.tableComparatorService.compare(by, this.tableSortOrder, strA, strB); + return this.tableComparatorService.compare(by, order, strA, strB); }; } } diff --git a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.module.ts b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.module.ts index 1a305569019..67bf9fc5218 100644 --- a/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.module.ts +++ b/src/web/app/pages-instructor/instructor-courses-page/instructor-courses-page.module.ts @@ -1,41 +1,44 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { AddCourseFormComponent } from './add-course-form/add-course-form.component'; -import { - CoursePermanentDeletionConfirmModalComponent, -} from './course-permanent-deletion-confirm-modal/course-permanent-deletion-confirm-modal.component'; -import { - CourseSoftDeletionConfirmModalComponent, -} from './course-soft-deletion-confirm-modal/course-soft-deletion-confirm-modal.component'; +import { RouterModule, Routes } from '@angular/router'; +import { NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { AjaxLoadingModule } from '../../components/ajax-loading/ajax-loading.module'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; +import { PanelChevronModule } from '../../components/panel-chevron/panel-chevron.module'; +import { AddCourseFormModule } from './add-course-form/add-course-form.module'; import { InstructorCoursesPageComponent } from './instructor-courses-page.component'; +const routes: Routes = [ + { + path: '', + component: InstructorCoursesPageComponent, + }, +]; + /** * Module for instructor courses page. */ @NgModule({ declarations: [ - AddCourseFormComponent, InstructorCoursesPageComponent, - CourseSoftDeletionConfirmModalComponent, - CoursePermanentDeletionConfirmModalComponent, ], exports: [ InstructorCoursesPageComponent, - AddCourseFormComponent, ], imports: [ CommonModule, FormsModule, ReactiveFormsModule, - RouterModule, - NgbModule, - ], - entryComponents: [ - CourseSoftDeletionConfirmModalComponent, - CoursePermanentDeletionConfirmModalComponent, + RouterModule.forChild(routes), + NgbDropdownModule, + NgbTooltipModule, + AddCourseFormModule, + LoadingSpinnerModule, + AjaxLoadingModule, + LoadingRetryModule, + PanelChevronModule, ], }) export class InstructorCoursesPageModule { } diff --git a/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap index 563d7836159..549f2407ae1 100644 --- a/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-home-page/__snapshots__/instructor-home-page.component.spec.ts.snap @@ -1,23 +1,25 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`InstructorHomePageComponent should snap with default fields 1`] = ` +exports[`InstructorHomePageComponent should snap when courses are still loading 1`] = ` Home
                    @@ -47,6 +50,7 @@ exports[`InstructorHomePageComponent should snap with default fields 1`] = ` > @@ -54,22 +58,137 @@ exports[`InstructorHomePageComponent should snap with default fields 1`] = `
                    -
                    +
                    +
                    +
                    + Loading... +
                    +
                    + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + + +`; + +exports[`InstructorHomePageComponent should snap with default fields 1`] = ` + +

                    + Home +

                    - - Add New Course - +
                    + +
                    + +
                    +
                    +
                    +
                    +
                    +
                    +
                    +
                    + Loading... +
                    + + -
                    + +
                    +
                    +
                    + Loading... +
                    +
                    + + + + `; @@ -80,17 +199,19 @@ exports[`InstructorHomePageComponent should snap with one course with error load SortBy={[Function Object]} courseService={[Function CourseService]} courseTabModels={[Function Array]} + failedToCopySessions={[Function Object]} feedbackQuestionsService={[Function FeedbackQuestionsService]} feedbackSessionsService={[Function FeedbackSessionsService]} - hasCoursesLoaded="false" + hasCoursesLoaded={[Function Boolean]} + hasCoursesLoadingFailed="false" instructorCoursesSortBy={[Function Number]} instructorService={[Function InstructorService]} isNewUser="false" - loadingBarService={[Function LoadingBarService]} - modalService={[Function NgbModal]} navigationService={[Function NavigationService]} ngbModal={[Function NgbModal]} + publishUnpublishRetryAttempts={[Function Number]} router={[Function Router]} + simpleModalService={[Function SimpleModalService]} statusMessageService={[Function StatusMessageService]} studentSearchkey="" studentService={[Function StudentService]} @@ -99,7 +220,7 @@ exports[`InstructorHomePageComponent should snap with one course with error load

                    Home

                    @@ -120,6 +242,7 @@ exports[`InstructorHomePageComponent should snap with one course with error load > @@ -134,11 +257,14 @@ exports[`InstructorHomePageComponent should snap with one course with error load class="col-4" > - Add New Course + + Add New Course
                    @@ -159,69 +285,93 @@ exports[`InstructorHomePageComponent should snap with one course with error load >
                    -
                    +
                    -
                    -
                    + +
                    + +
                    +
                    - + [CS3281]: Thematic Systems -
                    -
                    - Error loading feedback sessions. Click here to retry. - - Error loading feedback sessions. Click here to retry. + +
                    + + + +
                    +
                    -
                    -
                    - - - -
                    -
                    - There are no feedback sessions in this course. + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + +
                    - - +
                    -
                    + + + `; @@ -232,17 +382,19 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba SortBy={[Function Object]} courseService={[Function CourseService]} courseTabModels={[Function Array]} + failedToCopySessions={[Function Object]} feedbackQuestionsService={[Function FeedbackQuestionsService]} feedbackSessionsService={[Function FeedbackSessionsService]} - hasCoursesLoaded="false" + hasCoursesLoaded={[Function Boolean]} + hasCoursesLoadingFailed="false" instructorCoursesSortBy={[Function Number]} instructorService={[Function InstructorService]} isNewUser="false" - loadingBarService={[Function LoadingBarService]} - modalService={[Function NgbModal]} navigationService={[Function NavigationService]} ngbModal={[Function NgbModal]} + publishUnpublishRetryAttempts={[Function Number]} router={[Function Router]} + simpleModalService={[Function SimpleModalService]} statusMessageService={[Function StatusMessageService]} studentSearchkey="" studentService={[Function StudentService]} @@ -251,7 +403,7 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba

                    Home

                    @@ -272,6 +425,7 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba > @@ -286,11 +440,14 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba class="col-4" > - Add New Course + + Add New Course
                    @@ -311,56 +468,57 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba >
                    -
                    +
                    - - - - - -
                    -
                    -
                    -
                    Course IDCourse NameCreation DateDeletion Date + Course ID + + + + + + + Course Name + + + + + + + Creation Date + + + + + + + Deletion Date + + + + + + Action(s)
                    {{course.course.courseId}} {{course.course.courseName}} - {{course.course.creationTimestamp | date:'d MMM yyyy'}} + + + {{course.course.creationTimestamp | date:'d MMM yyyy'}} + - {{course.course.deletionTimestamp | date:'d MMM yyyy'}} + + + {{course.course.deletionTimestamp | date:'d MMM yyyy'}} + - -
                    + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
                    - Session Name - - - - - - - - Start Date - - - - - - - - End Date - - - - - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                    - Feedback - - - 19 Jan 6:43 AM - - - - 19 Jan 6:46 AM - - - - Awaiting - - - - Not Published - - - - -
                    - 0 / 6 -
                    - -
                    +
                    + - - - - - + + - + + + + + + + + + + + - + + + - - -
                    - View Results - + Session Name + + + + + + + End Date + + + + + + + Submissions + + Responses + - Publish Results - + + Response Rate + + + Action(s) +
                    + Feedback + + + 19 Jan 6:43 AM + + + + Awaiting + + + + Not Published + + + + +
                    + 0 / 6 +
                    + +
                    - Download Results - - - -
                    - -
                    -
                    -
                    + + + + + + + + + + + + + +
                    + +
                    +
                    +
                    +
                    + + + + +
                    - - +
                    -
                    + + + `; @@ -755,17 +926,19 @@ exports[`InstructorHomePageComponent should snap with one course with two feedba SortBy={[Function Object]} courseService={[Function CourseService]} courseTabModels={[Function Array]} + failedToCopySessions={[Function Object]} feedbackQuestionsService={[Function FeedbackQuestionsService]} feedbackSessionsService={[Function FeedbackSessionsService]} - hasCoursesLoaded="false" + hasCoursesLoaded={[Function Boolean]} + hasCoursesLoadingFailed="false" instructorCoursesSortBy={[Function Number]} instructorService={[Function InstructorService]} isNewUser="false" - loadingBarService={[Function LoadingBarService]} - modalService={[Function NgbModal]} navigationService={[Function NavigationService]} ngbModal={[Function NgbModal]} + publishUnpublishRetryAttempts={[Function Number]} router={[Function Router]} + simpleModalService={[Function SimpleModalService]} statusMessageService={[Function StatusMessageService]} studentSearchkey="" studentService={[Function StudentService]} @@ -774,7 +947,7 @@ exports[`InstructorHomePageComponent should snap with one course with two feedba

                    Home

                    -
                    +
                    - - - - - -
                    -
                    -
                    - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
                    - Session Name - - - - - - - - Start Date - - - - - - - - End Date - - - - - - - - Submissions - - Responses - - - Response Rate - - - Action(s) -
                    - Feedback 1 - - - 1 Jan 7:30 AM - - - - 1 Jan 7:30 AM - - - - Closed - - - - Published - - - - -
                    - 0 / 6 -
                    - -
                    +
                    + - - - - - + - - + Session Name + + + + + + + - - + + - - - - - - - - - - - - - + + + + + - + + + + + + + + + + - + + + - - -
                    + Start Date + + + + + + + Submissions + + Responses + - Download Results - - - -
                    - -
                    - -
                    - Feedback 2 - - - 1 Jan 7:30 AM - - - - 1 Jan 7:30 AM - - - - Open - - - - Not Published - - - - -
                    - 5 / 6 -
                    - -
                    - - - - - - View Results - + Action(s) +
                    + + 1 Jan 7:30 AM + + + + 1 Jan 7:30 AM + + + + Closed + + + + Published + + + + +
                    + 0 / 6 +
                    + +
                    - Publish Results - + + + + + + + + + + +
                    + +
                    +
                    + Feedback 2 + + + 1 Jan 7:30 AM + + + + Open + + + + Not Published + + + + +
                    + 5 / 6 +
                    + +
                    - Download Results - - - -
                    - -
                    -
                    -
                    + + + + + + + + + + +
                    + +
                    +
                    +
                    +
                    + +
                    + + +
                    - - + - + + +
                    `; @@ -1412,17 +1602,19 @@ exports[`InstructorHomePageComponent should snap with one course with unexpanded SortBy={[Function Object]} courseService={[Function CourseService]} courseTabModels={[Function Array]} + failedToCopySessions={[Function Object]} feedbackQuestionsService={[Function FeedbackQuestionsService]} feedbackSessionsService={[Function FeedbackSessionsService]} - hasCoursesLoaded="false" + hasCoursesLoaded={[Function Boolean]} + hasCoursesLoadingFailed="false" instructorCoursesSortBy={[Function Number]} instructorService={[Function InstructorService]} isNewUser="false" - loadingBarService={[Function LoadingBarService]} - modalService={[Function NgbModal]} navigationService={[Function NavigationService]} ngbModal={[Function NgbModal]} + publishUnpublishRetryAttempts={[Function Number]} router={[Function Router]} + simpleModalService={[Function SimpleModalService]} statusMessageService={[Function StatusMessageService]} studentSearchkey="" studentService={[Function StudentService]} @@ -1431,7 +1623,7 @@ exports[`InstructorHomePageComponent should snap with one course with unexpanded

                    Home

                    -
                    +
                    - - - - - -
                    - - -
                    - There are no feedback sessions in this course. + +
                    + + + +
                    +
                    -
                    +
                    - + + +
                    `; @@ -1709,17 +1892,19 @@ exports[`InstructorHomePageComponent should snap with one course with unpopulate SortBy={[Function Object]} courseService={[Function CourseService]} courseTabModels={[Function Array]} + failedToCopySessions={[Function Object]} feedbackQuestionsService={[Function FeedbackQuestionsService]} feedbackSessionsService={[Function FeedbackSessionsService]} - hasCoursesLoaded="false" + hasCoursesLoaded={[Function Boolean]} + hasCoursesLoadingFailed="false" instructorCoursesSortBy={[Function Number]} instructorService={[Function InstructorService]} isNewUser="false" - loadingBarService={[Function LoadingBarService]} - modalService={[Function NgbModal]} navigationService={[Function NavigationService]} ngbModal={[Function NgbModal]} + publishUnpublishRetryAttempts={[Function Number]} router={[Function Router]} + simpleModalService={[Function SimpleModalService]} statusMessageService={[Function StatusMessageService]} studentSearchkey="" studentService={[Function StudentService]} @@ -1728,7 +1913,7 @@ exports[`InstructorHomePageComponent should snap with one course with unpopulate

                    Home

                    -
                    +
                    - - - - - -
                    -
                    - There are no feedback sessions in this course. + + + + +
                    +
                    +
                    + Loading... +
                    +
                    + + + +
                    - - +
                    - + + +
                    `; @@ -2006,17 +2210,19 @@ exports[`InstructorHomePageComponent should snap with one course without feedbac SortBy={[Function Object]} courseService={[Function CourseService]} courseTabModels={[Function Array]} + failedToCopySessions={[Function Object]} feedbackQuestionsService={[Function FeedbackQuestionsService]} feedbackSessionsService={[Function FeedbackSessionsService]} - hasCoursesLoaded="false" + hasCoursesLoaded={[Function Boolean]} + hasCoursesLoadingFailed="false" instructorCoursesSortBy={[Function Number]} instructorService={[Function InstructorService]} isNewUser="false" - loadingBarService={[Function LoadingBarService]} - modalService={[Function NgbModal]} navigationService={[Function NavigationService]} ngbModal={[Function NgbModal]} + publishUnpublishRetryAttempts={[Function Number]} router={[Function Router]} + simpleModalService={[Function SimpleModalService]} statusMessageService={[Function StatusMessageService]} studentSearchkey="" studentService={[Function StudentService]} @@ -2025,7 +2231,7 @@ exports[`InstructorHomePageComponent should snap with one course without feedbac

                    Home

                    -
                    +
                    - - - - - -
                    -
                    - There are no feedback sessions in this course. + + + + + +
                    + There are no feedback sessions in this course. +
                    + +
                    + + +
                    - -
                    +
                    - + + +
                    `; diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html index daa8b0543ef..bdc53a9d67b 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.html @@ -1,12 +1,12 @@

                    Home

                    -
                    +
                    -
                    - +
                    @@ -20,141 +20,99 @@

                    Home

                    -
                    +
                    Sort By:
                    - - - + + +
                    -
                    -
                    -
                    -
                    -
                    - [{{ courseTabModel.course.courseId }}]: {{ courseTabModel.course.courseName }} -
                    -
                    -
                    - - -
                    + +
                    +
                    +
                    +
                    + [{{ courseTabModel.course.courseId }}]: {{ courseTabModel.course.courseName }} + - - - Error loading feedback sessions. Click here to retry. - - - - - - - - - - - - -
                    - -
                    -
                    + diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.scss b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.scss index c2a71646ffb..221fc65f744 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.scss +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.scss @@ -2,19 +2,6 @@ padding: 0; } -.course-tab-header { - padding: .3rem 1rem; - cursor: pointer; -} - -.margin-bottom-15px { - margin-bottom: 15px; -} - -.padding-right-10px { - padding-right: 10px; -} - .btn-toolbar { white-space: nowrap; margin-top: 5px; @@ -28,3 +15,11 @@ align-items: center; white-space: nowrap; } + +.dropdown-item { + border: none; +} + +.no-border { + border: none; +} diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts index f671d1312c0..ea4d83765bb 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.spec.ts @@ -1,5 +1,6 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { Course, FeedbackSession, FeedbackSessionPublishStatus, @@ -60,6 +61,7 @@ describe('InstructorHomePageComponent', () => { InstructorHomePageModule, HttpClientTestingModule, RouterTestingModule, + BrowserAnimationsModule, ], }) .compileComponents(); @@ -95,6 +97,7 @@ describe('InstructorHomePageComponent', () => { isAjaxSuccess: true, isTabExpanded: true, }; + component.hasCoursesLoaded = true; component.courseTabModels = [courseTabModels]; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); @@ -111,6 +114,7 @@ describe('InstructorHomePageComponent', () => { isAjaxSuccess: true, isTabExpanded: true, }; + component.hasCoursesLoaded = true; component.courseTabModels = [courseTabModels]; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); @@ -127,6 +131,7 @@ describe('InstructorHomePageComponent', () => { isAjaxSuccess: false, isTabExpanded: true, }; + component.hasCoursesLoaded = true; component.courseTabModels = [courseTabModels]; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); @@ -143,6 +148,7 @@ describe('InstructorHomePageComponent', () => { isAjaxSuccess: true, isTabExpanded: false, }; + component.hasCoursesLoaded = true; component.courseTabModels = [courseTabModels]; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); @@ -165,6 +171,7 @@ describe('InstructorHomePageComponent', () => { isAjaxSuccess: true, isTabExpanded: true, }; + component.hasCoursesLoaded = true; component.courseTabModels = [courseTabModels]; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); @@ -235,6 +242,24 @@ describe('InstructorHomePageComponent', () => { isAjaxSuccess: true, isTabExpanded: true, }; + component.hasCoursesLoaded = true; + component.courseTabModels = [courseTabModels]; + fixture.detectChanges(); + expect(fixture).toMatchSnapshot(); + }); + + it('should snap when courses are still loading', () => { + const courseTabModels: any = { + instructorPrivilege, + course: defaultCourse, + sessionsTableRowModels: [], + sessionsTableRowModelsSortBy: SortBy.NONE, + sessionsTableRowModelsSortOrder: SortOrder.ASC, + hasPopulated: true, + isAjaxSuccess: true, + isTabExpanded: true, + }; + component.hasCoursesLoaded = false; component.courseTabModels = [courseTabModels]; fixture.detectChanges(); expect(fixture).toMatchSnapshot(); diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts index f6e01a5b6e6..e9d2cb511b6 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.component.ts @@ -1,13 +1,14 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { forkJoin, Observable } from 'rxjs'; import { finalize } from 'rxjs/operators'; import { CourseService } from '../../../services/course.service'; import { FeedbackQuestionsService } from '../../../services/feedback-questions.service'; import { FeedbackSessionsService } from '../../../services/feedback-sessions.service'; import { InstructorService } from '../../../services/instructor.service'; -import { LoadingBarService } from '../../../services/loading-bar.service'; import { NavigationService } from '../../../services/navigation.service'; +import { SimpleModalService } from '../../../services/simple-modal.service'; import { StatusMessageService } from '../../../services/status-message.service'; import { StudentService } from '../../../services/student.service'; import { TableComparatorService } from '../../../services/table-comparator.service'; @@ -27,6 +28,8 @@ import { SessionsTableHeaderColorScheme, SessionsTableRowModel, } from '../../components/sessions-table/sessions-table-model'; +import { SimpleModalType } from '../../components/simple-modal/simple-modal-type'; +import { collapseAnim } from '../../components/teammates-common/collapse-anim'; import { ErrorMessageOutput } from '../../error-message-output'; import { InstructorSessionModalPageComponent } from '../instructor-session-modal-page.component'; @@ -40,6 +43,7 @@ interface CourseTabModel { hasPopulated: boolean; isAjaxSuccess: boolean; isTabExpanded: boolean; + hasLoadingFailed: boolean; } /** @@ -49,6 +53,7 @@ interface CourseTabModel { selector: 'tm-instructor-home-page', templateUrl: './instructor-home-page.component.html', styleUrls: ['./instructor-home-page.component.scss'], + animations: [collapseAnim], }) export class InstructorHomePageComponent extends InstructorSessionModalPageComponent implements OnInit { @@ -65,6 +70,7 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo courseTabModels: CourseTabModel[] = []; hasCoursesLoaded: boolean = false; + hasCoursesLoadingFailed: boolean = false; isNewUser: boolean = false; constructor(router: Router, @@ -72,15 +78,14 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo navigationService: NavigationService, feedbackSessionsService: FeedbackSessionsService, feedbackQuestionsService: FeedbackQuestionsService, - modalService: NgbModal, + ngbModal: NgbModal, studentService: StudentService, instructorService: InstructorService, tableComparatorService: TableComparatorService, - private courseService: CourseService, - private ngbModal: NgbModal, - private loadingBarService: LoadingBarService) { - super(router, instructorService, statusMessageService, navigationService, - feedbackSessionsService, feedbackQuestionsService, tableComparatorService, modalService, studentService); + private simpleModalService: SimpleModalService, + private courseService: CourseService) { + super(router, instructorService, statusMessageService, navigationService, feedbackSessionsService, + feedbackQuestionsService, tableComparatorService, ngbModal, studentService); } ngOnInit(): void { @@ -114,91 +119,91 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo }); } - /** - * Open the modal for different buttons and link. - */ - openModal(content: any): void { - this.ngbModal.open(content); - } - /** * Archives the entire course from the instructor */ archiveCourse(courseId: string): void { - this.courseService.changeArchiveStatus(courseId, { - archiveStatus: true, - }).subscribe((courseArchive: CourseArchive) => { - this.courseTabModels = this.courseTabModels.filter((model: CourseTabModel) => { - return model.course.courseId !== courseId; + const modalContent: string = 'This action can be reverted by going to the "Courses" tab and unarchiving the desired course(s).'; + + const modalRef: NgbModalRef = + this.simpleModalService.openConfirmationModal( + `Archive course ${courseId}?`, SimpleModalType.INFO, modalContent); + modalRef.result.then(() => { + this.courseService.changeArchiveStatus(courseId, { + archiveStatus: true, + }).subscribe((courseArchive: CourseArchive) => { + this.courseTabModels = this.courseTabModels.filter((model: CourseTabModel) => { + return model.course.courseId !== courseId; + }); + this.statusMessageService.showSuccessToast(`The course ${courseArchive.courseId} has been archived. + You can retrieve it from the Courses page.`); + }, (resp: ErrorMessageOutput) => { + this.statusMessageService.showErrorToast(resp.error.message); }); - this.statusMessageService.showSuccessToast(`The course ${courseArchive.courseId} has been archived. - You can retrieve it from the Courses page.`); - }, (resp: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(resp.error.message); - }); + }, () => {}); } /** * Deletes the entire course from the instructor */ deleteCourse(courseId: string): void { - this.courseService.binCourse(courseId).subscribe((course: Course) => { - this.courseTabModels = this.courseTabModels.filter((model: CourseTabModel) => { - return model.course.courseId !== courseId; + const modalContent: string = 'This action can be reverted by going to the "Courses" tab and restoring the desired course(s).'; + + const modalRef: NgbModalRef = this.simpleModalService.openConfirmationModal( + `Move course ${courseId} to Recycle Bin`, SimpleModalType.WARNING, modalContent); + modalRef.result.then(() => { + this.courseService.binCourse(courseId).subscribe((course: Course) => { + this.courseTabModels = this.courseTabModels.filter((model: CourseTabModel) => { + return model.course.courseId !== courseId; + }); + this.statusMessageService.showSuccessToast( + `The course ${course.courseId} has been deleted. You can restore it from the Recycle Bin manually.`); + }, (resp: ErrorMessageOutput) => { + this.statusMessageService.showErrorToast(resp.error.message); }); - this.statusMessageService.showSuccessToast( - `The course ${course.courseId} has been deleted. You can restore it from the Recycle Bin manually.`); - }, (resp: ErrorMessageOutput) => { - this.statusMessageService.showErrorToast(resp.error.message); - }); + }, () => {}); } /** * Loads courses of current instructor. */ loadCourses(): void { + this.hasCoursesLoaded = false; + this.hasCoursesLoadingFailed = false; this.courseTabModels = []; - this.loadingBarService.showLoadingBar(); this.courseService.getInstructorCoursesThatAreActive() .pipe(finalize(() => { - this.loadingBarService.hideLoadingBar(); this.hasCoursesLoaded = true; })).subscribe((courses: Courses) => { courses.courses.forEach((course: Course) => { const model: CourseTabModel = { course, - instructorPrivilege: DEFAULT_INSTRUCTOR_PRIVILEGE, + instructorPrivilege: course.privileges || DEFAULT_INSTRUCTOR_PRIVILEGE, sessionsTableRowModels: [], isTabExpanded: false, isAjaxSuccess: true, hasPopulated: false, + hasLoadingFailed: false, sessionsTableRowModelsSortBy: SortBy.NONE, sessionsTableRowModelsSortOrder: SortOrder.ASC, }; this.courseTabModels.push(model); - this.updateCourseInstructorPrivilege(model); }); this.isNewUser = !courses.courses.some((course: Course) => !/-demo\d*$/.test(course.courseId)); this.sortCoursesBy(this.instructorCoursesSortBy); - }, (resp: ErrorMessageOutput) => { this.statusMessageService.showErrorToast(resp.error.message); }); - } - - /** - * Updates the instructor privilege in {@code CourseTabModel}. - */ - updateCourseInstructorPrivilege(model: CourseTabModel): void { - this.instructorService.loadInstructorPrivilege({ courseId: model.course.courseId }) - .subscribe((instructorPrivilege: InstructorPrivilege) => { - model.instructorPrivilege = instructorPrivilege; }, (resp: ErrorMessageOutput) => { + this.hasCoursesLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); + }); } /** - * Loads the feedback session in the course. + * Loads the feedback session in the course and sorts them according to end date. */ - loadFeedbackSessions(model: CourseTabModel): void { + loadFeedbackSessions(index: number): void { + const model: CourseTabModel = this.courseTabModels[index]; + model.hasLoadingFailed = false; if (!model.hasPopulated) { this.feedbackSessionsService.getFeedbackSessionsForInstructor(model.course.courseId) .subscribe((response: FeedbackSessions) => { @@ -207,19 +212,18 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo feedbackSession, responseRate: '', isLoadingResponseRate: false, - instructorPrivilege: DEFAULT_INSTRUCTOR_PRIVILEGE, + instructorPrivilege: feedbackSession.privileges || DEFAULT_INSTRUCTOR_PRIVILEGE, }; model.sessionsTableRowModels.push(m); - this.updateInstructorPrivilege(m); }); model.hasPopulated = true; if (!model.isAjaxSuccess) { model.isAjaxSuccess = true; } }, (resp: ErrorMessageOutput) => { - model.isAjaxSuccess = false; + model.hasLoadingFailed = true; this.statusMessageService.showErrorToast(resp.error.message); - }); + }, () => this.sortSessionsTableRowModelsEvent(index, SortBy.SESSION_END_DATE)); } } @@ -237,7 +241,9 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo this.instructorCoursesSortBy = by; if (this.courseTabModels.length > 1) { - this.courseTabModels.sort(this.sortPanelsBy(by)); + const modelCopy: CourseTabModel[] = JSON.parse(JSON.stringify(this.courseTabModels)); + modelCopy.sort(this.sortPanelsBy(by)); + this.courseTabModels = modelCopy; } this.loadLatestCourses(); } @@ -251,7 +257,7 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo break; } this.courseTabModels[i].isTabExpanded = true; - this.loadFeedbackSessions(this.courseTabModels[i]); + this.loadFeedbackSessions(i); } } @@ -263,24 +269,29 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo return ((a: { course: Course }, b: { course: Course }): number => { let strA: string; let strB: string; + let order: SortOrder; switch (by) { case SortBy.COURSE_NAME: strA = a.course.courseName; strB = b.course.courseName; + order = SortOrder.ASC; break; case SortBy.COURSE_ID: strA = a.course.courseId; strB = b.course.courseId; + order = SortOrder.ASC; break; case SortBy.COURSE_CREATION_DATE: strA = String(a.course.creationTimestamp); strB = String(b.course.creationTimestamp); + order = SortOrder.DESC; break; default: strA = ''; strB = ''; + order = SortOrder.ASC; } - return this.tableComparatorService.compare(by, SortOrder.ASC, strA, strB); + return this.tableComparatorService.compare(by, order, strA, strB); }); } @@ -330,10 +341,35 @@ export class InstructorHomePageComponent extends InstructorSessionModalPageCompo } /** - * Edits the feedback session. + * Copies the feedback session. */ copySessionEventHandler(tabIndex: number, result: CopySessionResult): void { - this.copySession(this.courseTabModels[tabIndex].sessionsTableRowModels[result.sessionToCopyRowIndex], result); + this.failedToCopySessions = {}; + const requestList: Observable[] = this.createSessionCopyRequestsFromRowModel( + this.courseTabModels[tabIndex].sessionsTableRowModels[result.sessionToCopyRowIndex], result); + if (requestList.length === 1) { + this.copySingleSession(requestList[0]); + } + if (requestList.length > 1) { + forkJoin(requestList).subscribe((newSessions: FeedbackSession[]) => { + if (newSessions.length > 0) { + newSessions.forEach((session: FeedbackSession) => { + const model: SessionsTableRowModel = { + feedbackSession: session, + responseRate: '', + isLoadingResponseRate: false, + instructorPrivilege: session.privileges || DEFAULT_INSTRUCTOR_PRIVILEGE, + }; + const courseModel: CourseTabModel | undefined = this.courseTabModels.find((tabModel: CourseTabModel) => + tabModel.course.courseId === session.courseId); + if (courseModel) { + courseModel.sessionsTableRowModels.push(model); + } + }); + } + this.showCopyStatusMessage(); + }); + } } /** diff --git a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.module.ts b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.module.ts index 50a83dc580d..48d9261ba21 100644 --- a/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.module.ts +++ b/src/web/app/pages-instructor/instructor-home-page/instructor-home-page.module.ts @@ -1,11 +1,21 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { RouterModule, Routes } from '@angular/router'; +import { NgbCollapseModule, NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; +import { LoadingRetryModule } from '../../components/loading-retry/loading-retry.module'; +import { LoadingSpinnerModule } from '../../components/loading-spinner/loading-spinner.module'; +import { PanelChevronModule } from '../../components/panel-chevron/panel-chevron.module'; import { SessionsTableModule } from '../../components/sessions-table/sessions-table.module'; import { InstructorHomePageComponent } from './instructor-home-page.component'; +const routes: Routes = [ + { + path: '', + component: InstructorHomePageComponent, + }, +]; + /** * Module for instructor home page. */ @@ -17,8 +27,13 @@ import { InstructorHomePageComponent } from './instructor-home-page.component'; CommonModule, SessionsTableModule, FormsModule, - RouterModule, - NgbModule, + RouterModule.forChild(routes), + NgbCollapseModule, + NgbDropdownModule, + NgbTooltipModule, + LoadingSpinnerModule, + LoadingRetryModule, + PanelChevronModule, ], exports: [ InstructorHomePageComponent, diff --git a/src/web/app/pages-instructor/instructor-page.component.spec.ts b/src/web/app/pages-instructor/instructor-page.component.spec.ts index cb31998e6bc..966ef7b58ed 100644 --- a/src/web/app/pages-instructor/instructor-page.component.spec.ts +++ b/src/web/app/pages-instructor/instructor-page.component.spec.ts @@ -3,7 +3,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { LoaderBarModule } from '../components/loader-bar/loader-bar.module'; -import { LoadingSpinnerComponent } from '../components/loading-spinner/loading-spinner.component'; +import { LoadingSpinnerModule } from '../components/loading-spinner/loading-spinner.module'; import { StatusMessageModule } from '../components/status-message/status-message.module'; import { ToastModule } from '../components/toast/toast.module'; import { PageComponent } from '../page.component'; @@ -18,12 +18,12 @@ describe('InstructorPageComponent', () => { declarations: [ PageComponent, InstructorPageComponent, - LoadingSpinnerComponent, ], imports: [ NgbModule, HttpClientTestingModule, LoaderBarModule, + LoadingSpinnerModule, RouterTestingModule, StatusMessageModule, ToastModule, diff --git a/src/web/app/pages-instructor/instructor-pages.module.ts b/src/web/app/pages-instructor/instructor-pages.module.ts index 7775423f610..23d4184235d 100644 --- a/src/web/app/pages-instructor/instructor-pages.module.ts +++ b/src/web/app/pages-instructor/instructor-pages.module.ts @@ -1,80 +1,15 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ActivatedRouteSnapshot, RouterModule, RouterStateSnapshot, Routes } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { Intent } from '../../types/api-request'; import { PageNotFoundComponent } from '../page-not-found/page-not-found.component'; import { PageNotFoundModule } from '../page-not-found/page-not-found.module'; -import { - InstructorHelpGettingStartedComponent, -} from '../pages-help/instructor-help-page/instructor-help-getting-started/instructor-help-getting-started.component'; -import { InstructorHelpPageComponent } from '../pages-help/instructor-help-page/instructor-help-page.component'; -import { InstructorHelpPageModule } from '../pages-help/instructor-help-page/instructor-help-page.module'; -import { - SessionSubmissionPageComponent, -} from '../pages-session/session-submission-page/session-submission-page.component'; -import { SessionSubmissionPageModule } from '../pages-session/session-submission-page/session-submission-page.module'; -import { - InstructorCourseDetailsPageComponent, -} from './instructor-course-details-page/instructor-course-details-page.component'; -import { - InstructorCourseDetailsPageModule, -} from './instructor-course-details-page/instructor-course-details-page.module'; -import { InstructorCourseEditPageComponent } from './instructor-course-edit-page/instructor-course-edit-page.component'; -import { InstructorCourseEditPageModule } from './instructor-course-edit-page/instructor-course-edit-page.module'; -import { - InstructorCourseEnrollPageComponent, -} from './instructor-course-enroll-page/instructor-course-enroll-page.component'; -import { - InstructorCourseEnrollPageModule, -} from './instructor-course-enroll-page/instructor-course-enroll-page.module'; -import { - InstructorCourseStudentDetailsPageComponent, -} from './instructor-course-student-details-page/instructor-course-student-details-page.component'; -import { - InstructorCourseStudentDetailsPageModule, -} from './instructor-course-student-details-page/instructor-course-student-details-page.module'; -import { - InstructorCourseStudentEditPageComponent, -} from './instructor-course-student-edit-page/instructor-course-student-edit-page.component'; -import { - InstructorCourseStudentEditPageModule, -} from './instructor-course-student-edit-page/instructor-course-student-edit-page.module'; -import { InstructorCoursesPageComponent } from './instructor-courses-page/instructor-courses-page.component'; -import { InstructorCoursesPageModule } from './instructor-courses-page/instructor-courses-page.module'; -import { InstructorHomePageComponent } from './instructor-home-page/instructor-home-page.component'; -import { InstructorHomePageModule } from './instructor-home-page/instructor-home-page.module'; -import { InstructorSearchPageComponent } from './instructor-search-page/instructor-search-page.component'; -import { InstructorSearchPageModule } from './instructor-search-page/instructor-search-page.module'; -import { - InstructorSessionEditPageComponent, -} from './instructor-session-edit-page/instructor-session-edit-page.component'; -import { InstructorSessionEditPageModule } from './instructor-session-edit-page/instructor-session-edit-page.module'; -import { - InstructorSessionResultPageComponent, -} from './instructor-session-result-page/instructor-session-result-page.component'; -import { - InstructorSessionResultPageModule, -} from './instructor-session-result-page/instructor-session-result-page.module'; -import { InstructorSessionsPageComponent } from './instructor-sessions-page/instructor-sessions-page.component'; -import { InstructorSessionsPageModule } from './instructor-sessions-page/instructor-sessions-page.module'; -import { - InstructorStudentListPageComponent, -} from './instructor-student-list-page/instructor-student-list-page.component'; -import { - InstructorStudentListPageModule, -} from './instructor-student-list-page/instructor-student-list-page.module'; -import { - InstructorStudentRecordsPageComponent, -} from './instructor-student-records-page/instructor-student-records-page.component'; -import { - InstructorStudentRecordsPageModule, -} from './instructor-student-records-page/instructor-student-records-page.module'; - const routes: Routes = [ { path: 'home', - component: InstructorHomePageComponent, + loadChildren: () => import('./instructor-home-page/instructor-home-page.module') + .then((m: any) => m.InstructorHomePageModule), }, { path: 'courses', @@ -84,33 +19,39 @@ const routes: Routes = [ data: { pageTitle: 'Courses', }, - component: InstructorCoursesPageComponent, + loadChildren: () => import('./instructor-courses-page/instructor-courses-page.module') + .then((m: any) => m.InstructorCoursesPageModule), }, { path: 'edit', - component: InstructorCourseEditPageComponent, + loadChildren: () => import('./instructor-course-edit-page/instructor-course-edit-page.module') + .then((m: any) => m.InstructorCourseEditPageModule), data: { pageTitle: 'Edit Course Details', }, }, { path: 'details', - component: InstructorCourseDetailsPageComponent, + loadChildren: () => import('./instructor-course-details-page/instructor-course-details-page.module') + .then((m: any) => m.InstructorCourseDetailsPageModule), }, { path: 'enroll', - component: InstructorCourseEnrollPageComponent, + loadChildren: () => import('./instructor-course-enroll-page/instructor-course-enroll-page.module') + .then((m: any) => m.InstructorCourseEnrollPageModule), }, { path: 'student', children: [ { path: 'details', - component: InstructorCourseStudentDetailsPageComponent, + loadChildren: () => import('./instructor-course-student-details-page/instructor-course-student-details-page.module') + .then((m: any) => m.InstructorCourseStudentDetailsPageModule), }, { path: 'edit', - component: InstructorCourseStudentEditPageComponent, + loadChildren: () => import('./instructor-course-student-edit-page/instructor-course-student-edit-page.module') + .then((m: any) => m.InstructorCourseStudentEditPageModule), data: { pageTitle: 'Edit Student Details', }, @@ -124,21 +65,24 @@ const routes: Routes = [ children: [ { path: '', - component: InstructorSessionsPageComponent, + loadChildren: () => import('./instructor-sessions-page/instructor-sessions-page.module') + .then((m: any) => m.InstructorSessionsPageModule), data: { pageTitle: 'Feedback Sessions', }, }, { path: 'edit', - component: InstructorSessionEditPageComponent, + loadChildren: () => import('./instructor-session-edit-page/instructor-session-edit-page.module') + .then((m: any) => m.InstructorSessionEditPageModule), data: { pageTitle: 'Edit Feedback Session', }, }, { path: 'submission', - component: SessionSubmissionPageComponent, + loadChildren: () => import('../pages-session/session-submission-page/session-submission-page.module') + .then((m: any) => m.SessionSubmissionPageModule), data: { pageTitle: 'Submit Feedback', intent: Intent.INSTRUCTOR_SUBMISSION, @@ -146,7 +90,8 @@ const routes: Routes = [ }, { path: 'result', - component: InstructorSessionResultPageComponent, + loadChildren: () => import('./instructor-session-result-page/instructor-session-result-page.module') + .then((m: any) => m.InstructorSessionResultPageModule), }, ], }, @@ -155,29 +100,36 @@ const routes: Routes = [ children: [ { path: '', - component: InstructorStudentListPageComponent, + loadChildren: () => import('./instructor-student-list-page/instructor-student-list-page.module') + .then((m: any) => m.InstructorStudentListPageModule), }, { path: 'records', - component: InstructorStudentRecordsPageComponent, + loadChildren: () => import('./instructor-student-records-page/instructor-student-records-page.module') + .then((m: any) => m.InstructorStudentRecordsPageModule), }, ], }, { path: 'search', - component: InstructorSearchPageComponent, + loadChildren: () => import('./instructor-search-page/instructor-search-page.module') + .then((m: any) => m.InstructorSearchPageModule), data: { pageTitle: 'Search', }, }, { path: 'help', - component: InstructorHelpPageComponent, - canDeactivate: ['canDeactivateHelp'], + loadChildren: () => import('../pages-help/instructor-help-page/instructor-help-page.module') + .then((m: any) => m.InstructorHelpPageModule), + data: { + instructorGettingStartedPath: '/web/instructor/getting-started', + }, }, { path: 'getting-started', - component: InstructorHelpGettingStartedComponent, + loadChildren: () => import('../pages-help/instructor-help-page/instructor-help-getting-started-page.module') + .then((m: any) => m.InstructorHelpGettingStartedPageModule), data: { instructorHelpPath: '/web/instructor/help', }, @@ -201,30 +153,7 @@ const routes: Routes = [ imports: [ CommonModule, PageNotFoundModule, - InstructorCoursesPageModule, - InstructorCourseDetailsPageModule, - InstructorCourseEditPageModule, - InstructorCourseEnrollPageModule, - InstructorCourseStudentDetailsPageModule, - InstructorCourseStudentEditPageModule, - InstructorHomePageModule, - InstructorSessionEditPageModule, - InstructorSessionsPageModule, - InstructorSearchPageModule, - InstructorHelpPageModule, - InstructorStudentListPageModule, - InstructorStudentRecordsPageModule, - InstructorSessionResultPageModule, - SessionSubmissionPageModule, RouterModule.forChild(routes), ], - providers: [ - { - provide: 'canDeactivateHelp', - useValue: (_component: InstructorHelpPageComponent, _currentRoute: ActivatedRouteSnapshot, - _currentState: RouterStateSnapshot, nextState: RouterStateSnapshot): boolean => - /^\/web\/instructor\/(home|courses|sessions|students|search|getting-started)$/.test(nextState.url), - }, - ], }) export class InstructorPagesModule {} diff --git a/src/web/app/pages-instructor/instructor-search-page/__snapshots__/instructor-search-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-search-page/__snapshots__/instructor-search-page.component.spec.ts.snap index 26b1eb11d39..23b1d1227c8 100644 --- a/src/web/app/pages-instructor/instructor-search-page/__snapshots__/instructor-search-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-search-page/__snapshots__/instructor-search-page.component.spec.ts.snap @@ -3,7 +3,8 @@ exports[`InstructorSearchPageComponent should snap with a search key 1`] = ` @@ -51,70 +53,75 @@ exports[`InstructorSearchPageComponent should snap with a search key 1`] = ` >
                    +
                    +
                    -
                    +
                    -
                    - - -
                    - +
                    + +

                    +
                    + +
                    -
                    - + + + `; exports[`InstructorSearchPageComponent should snap with default fields 1`] = ` @@ -730,62 +746,66 @@ exports[`InstructorSearchPageComponent should snap with default fields 1`] = ` + +
                    -
                    +
                    -
                    - - -
                    - +
                    + +