501 Commits

Author SHA1 Message Date
092487344a Replace obsolete HTTP status code :unprocessable_entity
The new naming is :unprocessable_content and required by Rack 3.1+
2024-06-17 15:07:04 +02:00
fad9ee0202 Remove redundant url_helpers in spec 2024-06-17 14:45:39 +02:00
dc21c31f9d Reorder includes for spec_helper and rails_helper 2024-06-17 14:45:07 +02:00
d0fcb6d695 Explicitly state permissions for CommunitySolutionPolicy 2024-05-24 15:21:11 +02:00
336519b21d Refactor CodeOcean::Config class
The new architecture memorizes settings (which we mostly did after reading the config so far) and also exposes the resulting file path as well as further settings.

This change is a prerequisite to define a dependency with Sprockets.
2024-05-21 21:56:31 +02:00
f6041af4c3 Add i18n-tasks with adapted config from CodeHarbor 2024-05-21 19:42:26 +02:00
029efd7904 Fix JavaScript error for ExternalUserStatistics
Previously, an exercise without visible files was used. While this worked for the test, it was semantically problematic, since the resulting submissions also lacked files.
2024-05-21 11:56:54 +02:00
96f5f1f8d7 Enforce valid lis_outcome_service_url
Recently, a new institution joined CodeOcean and used a relative URL. This won't work, so that we are rejecting non-absolute URLs by now.
2024-04-26 10:21:53 +02:00
7cc4fb00c6 RfCs: Allow filtering for any states
We want to differentiate between those RfCs explicitly marked as solved, those potentially solved since the author reached the maximum score, and those being unsolved where the author has not yet reached the full score yet.
2024-04-24 12:18:47 +02:00
a934767049 Specs: Prevent Rake task from being executed twice
Otherwise, invoking a Rake task could lead to multiple executions, which is unexpected.
2024-04-18 08:36:28 +02:00
4f8d313da4 Use webpack to deliver newest ACE editor
With this commit, we change the delivery method for the ACE editor from manually copied files to using yarn and webpack. As a side-change, we also modify how the mode is selected through JavaScript instead of Ruby.

Through webpack, the `modePath`, `themePath`, and `workerPath` are automatically determined and working as expected.

Closes #250
2024-03-25 10:00:04 +01:00
7356136203 Resolve fixture_path deprecation warning in Rails 7.1 2024-02-26 14:34:42 +01:00
04863f1f25 Update Ruby to 3.3 2024-01-19 12:49:00 +01:00
17dd8b1267 Change syntax for routes with filename
Previously, the filename was URL-encoded, thus each / was replaced with %2F. This caused issues with some Apache2 configuration, smartly mingling with the URL to either encode it a second time (resulting in %252F) or decoding it (generating a real /). However, for authenticated file downloads with the JWT, we hardly require a byte-by-byte matching. With these changes, the URL parameter is no longer URL-encoded, so that Apache2 won't break our implementation any longer.

Further, we use this opportunity to get rid of the unnecessary .json extension for those filename routes, simplifying the routes generated and doing some further cleanup.
2024-01-19 11:06:40 +01:00
a230618724 Fix Rubocop offenses 2024-01-09 01:27:58 +01:00
bcb6409126 Bump rubocop from 1.57.2 to 1.58.0 and fix offenses
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.57.2 to 1.58.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.57.2...v1.58.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-07 11:02:00 +01:00
dccfe5cbc8 Reduce SQL queries for exercise batch update
Fixes CODEOCEAN-10D
2023-12-05 22:12:42 +01:00
5ddc5a8ca5 Redirect users after sign in to their desired page 2023-12-01 00:06:31 +01:00
e9f099d59f Properly nest UserExerciseFeedback
Fixes CODEOCEAN-108
2023-11-23 14:42:10 +01:00
fe26378387 Extract ScoringChecks and rework RemoteEvaluations 2023-11-23 14:42:10 +01:00
175c8933f3 Automatically submit LTI grade on each score run
With this commit, we refactor the overall score handling of CodeOcean. Previously, "Score" and "Submit" were two distinct actions, requiring users to confirm the LTI transmission of their score (after assessing their submission). This yielded many questions and was unnecessary, since LTI parameters are no longer expiring after each use. Therefore, we can now transmit the current grade on each score run with the very same LTI parameters. As a consequence, the LTI consumer gets a more detailed history of the scores, enabling further analytical insights.

For users, the previous "Submit" button got replaced with a notification that is shown as soon as the full score got reached. Then, learners can decide to "finalize" their work on the given exercise, which will initiate a redirect to a follow-up action (as defined in the RedirectBehavior). This RedirectBehavior has also been unified and simplified for better readability.

As part of this refactoring, we rephrased the notifications and UX workflow of a) the LTI transmission, b) the finalization of an exercise (measured by reaching the full score) and c) the deadline handling (on time, within grace period, too late). Those information are now separately shown, potentially resulting in multiple notifications. As a side effect, they are much better maintainable, and the LTI transmission is more decoupled from this notification handling.
2023-11-23 14:42:10 +01:00
988aefdbf9 Add tests for Exercise#needs_more_feedback? 2023-11-23 14:42:10 +01:00
347af23f98 Remove duplicated render_views for SubmissionsController spec 2023-11-23 14:42:10 +01:00
8b37242a58 RSpec redirect: Fix erroneous test cases for DELETE 2023-11-23 14:42:10 +01:00
740fc85bce RSpec redirect: Allow specifying a location through a block 2023-11-23 14:42:10 +01:00
7f30fbe221 RSpec: Ensure that locales are present for i18n-js 2023-11-23 14:42:10 +01:00
1e08f2cc9c add hidden_feedback to custom CodeOcean test-attributes 2023-11-17 00:56:49 +01:00
3f8f4cee5b update converters and im-/exporters to accommodate for changes in proforma gem 2023-11-17 00:56:49 +01:00
bcbb2d2eb6 Generate truly random email addresses in factory
Previously, it could happen under some (random) circumstances that a series of users got the same user name. This is caused by the usage of Forgery for generating a name. Forgery itself picks a random name from a list, and there is no check that two calls would indeed deliver two different names.

In order to solve the issue, we generate a truly unique email address for specs, so that the problem won't arise again.
2023-11-11 13:40:28 +01:00
ae013ba027 Prevent the creation of new accounts during mailer preview 2023-11-01 19:41:16 +01:00
411eb0b165 Specs: Use Runner factory and provide strategy class 2023-10-31 12:35:24 +01:00
8fc5123bae Exclusively lock Runners during code executions
Previously, the same runner could be used multiple times with different submissions simultaneously. This, however, yielded errors, for example when one submission time oud (causing the running to be deleted) while another submission was still executed.

Admin actions, such as the shell, can be still executed regardless of any other code execution.

Fixes CODEOCEAN-HG
Fixes openHPI/poseidon#423
2023-10-31 12:35:24 +01:00
28d9e38fe5 Upgrade to Rails 7.1 and apply new framework defaults
* Remove deprecated options from environments
* Remove deprecation warnings for upcoming Rails 7.2
* Dump schema with new defaults
* Remove outdated (and erroneous) data attribute in view
* Resolve a `NoMethodError` for seeds_spec.rb
2023-10-27 16:50:27 +02:00
79ce069f68 Add CRUD operations for Programming Groups
* Correct sorting in table
* Modify page when nested in exercises
* Fix links between pages
* Link from statistics page to programming_groups/index
* Link from submission page to programming_groups/<id>
* Allow filtering for exercise ID on ProgrammingGroup#index
* Add search fields for internal and external user id on pg/index
2023-10-23 18:17:42 +02:00
b91a2b7ce0 Remove PairProgramming23Study and instead use LTI parameter 2023-10-22 12:07:41 +02:00
99bd46af1a Align project files with CodeHarbor
Since both projects are developed together and by the same team, we also want to have the same code structure and utility methods available in both projects. Therefore, this commit changes many files, but without a functional change.
2023-10-11 00:18:33 +02:00
f150c793d5 Add regression spec for message validation 2023-09-19 12:52:53 +02:00
e767cff309 Fix flaky tests dependent on exercise.reload for files 2023-09-16 16:57:59 +02:00
c29256aa81 Fix Rubocop offenses 2023-09-11 14:10:16 +02:00
97764bd02e Limit programming groups to two people
* adapt text on programming_groups/new site
* in German change from 'Sie' to 'du'
2023-09-05 22:56:51 +02:00
235bf771fe Always use user object instead of ID and Type 2023-08-26 00:39:47 +02:00
89afb599e4 Apply changes from team members in own editor 2023-08-26 00:38:58 +02:00
c2995c96f0 Remove clear_lti_session_data as it is no longer needed
* no lti session data anymore included in the function
* decided not to delete the pg_id here as it is handled in create_through_lti and implement
* the function is only called once without an exercise id so the values are now directly deleted there
2023-08-24 19:32:06 +02:00
01accdae58 Use author_in_programming_group? policy for files & RfCs
* Allow all members of a programming group to list and solve RfCs
* Also adjust policy specs to respect programming groups
2023-08-24 19:32:06 +02:00
a1941336d9 Fix Runner access for programming groups
* We also rename the corresponding columns in the Runner model, so that for polymorphic association gets clear.
2023-08-24 19:32:06 +02:00
be4f2b790d Add user to testrun
* We want to identify a user that has triggered a testrun. Previously (in regular operation), only submission author who were regular users were able to start a testrun. Now, we want to prepare a future where submission authors are programming groups. Still, a testrun is triggered by an individual user and not a group.
* Further, this commit fixes some missing foreign key constrains.
2023-08-24 19:32:06 +02:00
e3603758ef Refactor LTI parameters and add study group
* This change also requires that submissions in our test need to have a valid study group.
2023-08-24 19:32:06 +02:00
e2baa2ee55 Send score for all members of a programming group 2023-08-24 19:32:06 +02:00
319c3ab3b4 Add ProgrammingGroup & ProgrammingGroupMembership
* User can create programming group with other users for exercise
* Submission is shared in a group
* Also adjust specs
2023-08-24 19:32:06 +02:00
0234414bae Rename user to contributor in submission 2023-08-24 19:32:06 +02:00