Skip to content

Commit 116a429

Browse files
authored
Merge pull request #250 from donny-wong/release_2.9.0
Release 2.9.0
2 parents 5891223 + fb8e15f commit 116a429

10 files changed

+321
-12
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Developer Guide: Configure VSCode
2+
3+
To configure your development environment on VSCode the following steps are required:
4+
5+
## Setup
6+
7+
Install the dev containers [extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) inside VSCode.
8+
9+
### Create a `devcontainer` Configuration
10+
11+
Devcontainer files define the vscode environment inside a docker container. It allows us to configure VSCode extensions, environment definitions, etc when running VSCode inside the docker container.
12+
13+
Place the following file: `devcontainer.json` at the root of your project inside a `.devcontainer` folder.
14+
15+
```json
16+
{
17+
"name": "MarkUs Dev",
18+
"dockerComposeFile": ["../compose.yaml"],
19+
"service": "rails",
20+
"workspaceFolder": "/app",
21+
"remoteUser": "markus",
22+
"overrideCommand": true,
23+
"forwardPorts": [3000],
24+
"mounts": ["source=${localWorkspaceFolder}/.ruby-lsp,target=/home/vscode/.ruby-lsp,type=bind"],
25+
"customizations": {
26+
"vscode": {"extensions": ["Shopify.ruby-lsp", "eamodio.gitlens", "koichisasada.vscode-rdbg"]},
27+
"settings": {
28+
"terminal.integrated.defaultProfile.linux": "bash",
29+
"rubyLsp.useBundler": true,
30+
"rubyLsp.rubyVersionManager": "none",
31+
"rubyLsp.bundleGemfile": "/app/Gemfile",
32+
"rubyLsp.exclude": [
33+
"**/.git/**",
34+
"node_modules/**",
35+
"vendor/**",
36+
"log/**",
37+
"tmp/**",
38+
".bundle/**"
39+
],
40+
"git.openRepositoryInParentFolders": "always",
41+
"git.detectSubmodules": false,
42+
43+
"[ruby]": {
44+
"editor.defaultFormatter": "Shopify.ruby-lsp",
45+
"editor.formatOnSave": true
46+
}
47+
}
48+
},
49+
"containerEnv": {
50+
"HOME": "/home/markus",
51+
"LISTEN_POLLING": "1"
52+
}
53+
}
54+
```
55+
56+
Brief explanation of what is happening above:
57+
58+
- On startup, let's open up VSCode inside the `/app` folder of our appplication by defining our workspace folder `workspaceFolder` to point to the `/app` directory of our container.
59+
- We are installing `ruby-lsp` and `gitlens`, both VSCode extensions inside the dev container and specifying their configuration, such as ignoring certain folders from indexing specific paths. Notice that when we open up markus outside the dev container, these extensions will be absent.
60+
- Force the `listen` gem to poll for changes by setting the `LISTEN_POLLING` flag. This removes flakyness in our autoreloading.
61+
62+
### Enable the `ruby-lsp` Gem
63+
64+
To enable modern programming features such as `go-to`, `code completion`, etc, an LSP server is required, which the default RubyMine IDE already comes preconfigured with. To work eficiently in VSCode we must enable the optionally defined `ruby-lsp` gem.
65+
66+
To install optional gem groups, we must pass in the `BUNDLE_WITH` enviroment variable with the optional groups we wish to install.
67+
68+
Inside the `docker-compose.override.yml`, we must define the following environment variable:
69+
70+
```yaml
71+
deps-updater:
72+
environment:
73+
- BUNDLE_WITH=development_extra
74+
```
75+
76+
When must then run: `docker compose run --rm deps-updater` to install the dependency.
77+
78+
## Execution
79+
80+
To run your code inside the dev container extension open up the command palette, either by pressing down `cmd + Shift + P` (on MAC OS) or by going to `view > Command Palette` and typing in `Dev Containers: Reopen in Container`

Developer-Guide--Set-Up-With-Docker.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Hooray! You have MarkUs up and running. Please keep reading for our recommended
102102

103103
## Installing and Configuring RubyMine
104104

105-
We strongly recommend RubyMine (a JetBrains IDE) for all MarkUs development.
105+
We strongly recommend RubyMine (a JetBrains IDE) for all MarkUs development. If you prefer to use VSCode, please follow the guide outlined [here](https://github.com/MarkUsProject/Wiki/blob/master/Developer-Guide--Configure-Environment-to-use-VSCode.md).
106106

107107
1. First, install RubyMine from [here](https://www.jetbrains.com/ruby/download). Note that if you are a current university student, you can obtain a [free license](https://www.jetbrains.com/student/) for all JetBrains software.
108108

@@ -359,3 +359,58 @@ rm -rf ~/.docker
359359
```
360360

361361
Finally, install Docker Engine by following the instructions on [this page](https://docs.docker.com/engine/install/).
362+
363+
### Q7
364+
365+
When setting up the autotester, the script might often fail to find the required information to populate the schema required to run the automated tests.
366+
367+
```plaintext
368+
Set up testing environment for autotest
369+
Creating sample autotesting assignment autotest_custom
370+
bin/rails aborted!
371+
NoMethodError: undefined method `[]' for nil (NoMethodError)
372+
373+
schema_data['definitions']['files_list']['enum'] = files
374+
^^^^^^^^^^^^^^
375+
/app/app/helpers/automated_tests_helper.rb:34:in `fill_in_schema_data!'
376+
```
377+
378+
This often happens when running the last step (#10) during the autotester [setup](https://github.com/MarkUsProject/Wiki/blob/master/Developer-Guide--Set-Up-With-Docker.md#setting-up-the-autotester) process, as a result of missing or corrupted database entries. The easiest and simplest solution is to restart the setup process with a clean docker environment.
379+
380+
Save the following functions to your `.bashrc`, `.zshrc` or other shell configuration file and execute the `nuke_docker` command.
381+
382+
```bash
383+
# Docker functions
384+
# *****************************************************************************
385+
function stop_containers() {
386+
docker stop $(docker ps -a -q)
387+
}
388+
389+
function remove_containers() {
390+
docker rm $(docker ps -a -q)
391+
}
392+
393+
function remove_volumes() {
394+
docker volume rm $(docker volume ls -qf dangling=true)
395+
}
396+
397+
function remove_buildx_cache() {
398+
docker builder prune -af
399+
docker buildx prune -af
400+
}
401+
402+
function clean_containers() {
403+
echo "Cleaning existing containers"
404+
stop_containers
405+
remove_containers
406+
remove_volumes
407+
remove_buildx_cache
408+
}
409+
410+
function nuke_docker() {
411+
clean_containers
412+
docker system prune -a --volumes
413+
}
414+
```
415+
416+
We can now restart the setup process with a clean docker environment.

Home.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
- [Starter Files](Instructor-Guide--Assignments--Starter-Files.md)
2020
- [Peer Review](Instructor-Guide--Assignments--Peer-Review.md)
2121
- [Assigning Graders](Instructor-Guide--Assignments--Assigning-Graders.md)
22-
- [Summary](Instructor-Guide--Assignments--Summary.md)
22+
- [Summary](Instructor-Guide--Assignments--Grades.md)
2323
- [Timed Assessments](Instructor-Guide--Timed-Assessments.md)
2424
- [Scanned Exams](Instructor-Guide--Scanned-Exams.md)
2525
- Marks Spreadsheets
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Summary
1+
# Grades
22

33
## Table of Contents
44

5-
- [Summary Tab](#summary-tab)
5+
- [Grades Tab](#grades-tab)
66
- [Summary Table](#summary-table)
77
- [Summary Statistics](#summary-statistics)
88

9-
## Summary Tab
9+
## Grades Tab
1010

11-
The summary tab can be used to view/visualize a variety of general statistics for a particular assignment. In addition, you may also view a summary of the grade breakdown for each submission. These are highlighted below.
11+
The grades tab can be used to view/visualize a variety of general statistics for a particular assignment. In addition, you may also view a summary of the grade breakdown for each submission. These are highlighted below.
1212

1313
### Summary Table
1414

Instructor-Guide--Assignments--Late-Submission-Policies.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,41 @@ For group work, *all* members of the group must have enough grace credits availa
2929

3030
## Use Penalty Decay Formula
3131

32-
This option will allow you to use a built-in function that deducts X grade percentage every Y hours for a duration of Z hours. You are able to create multiple time periods in case you want to deduct 5% every hour for the first four hours and then 10% every 6 hours for 12 more hours:
32+
This option will allow you to use a built-in function that deducts X amount of penalty every Y hours for a duration of Z hours. You are able to create multiple time periods in case you want to deduct 5%/marks every hour for the first four hours and then 10%/marks every 6 hours for 12 more hours.
33+
34+
### Penalty Type
35+
36+
You must select a **Penalty Type** to determine how penalties are calculated (default is Percentage of assignment total):
37+
38+
- **Percentage of assignment total**: Deduct a percentage of the total possible marks for the assignment (e.g., 5%)
39+
- **Percentage of earned mark**: Deduct a percentage of the student's earned mark (e.g., 5% of student's earned mark)
40+
- **Marks**: Deduct a fixed number of marks (e.g., 5 marks)
41+
42+
The deduction unit displayed next to the input field will automatically update based on your selection (% for percentage types, marks for the marks option).
43+
3344
![Website Penalty Decay Formula](images/late-submission-policy-penalty-decay-formula.png)
3445
Additional time periods are added by clicking the "Add late period" button and removed by using the delete link. MarkUs will automatically adjust the real time periods for you when adding and deleting.
3546

3647
When grading a late submission, the penalty will be automatically applied to the group's mark, but will not decrease the mark below 0. This penalty will appear in the "Summary" tab of the grading view.
3748

38-
Penalties are applied as a percentage of the total mark. For example, a 10% penalty for an assignment out of 90 total marks will reduce a groups's overall score by 9 marks. If a group would have received 55/90 before the penalty is deducted, they will receive 46/90 after the penalty is deducted.
49+
Penalties are applied as a percentage of the total mark. For example, a 10% penalty for an assignment out of 90 total marks will reduce a group's overall score by 9 marks. If a group would have received 55/90 before the penalty is deducted, they will receive 46/90 after the penalty is deducted.
3950

4051
## Set Manual Penalty Periods
4152

42-
This option allows you to set percentage penalty amounts for specified time periods.
53+
This option allows you to set percentage/marks penalty amounts for specified time periods.
54+
55+
### Penalty Type
56+
57+
You must select a **Penalty Type** to determine how penalties are calculated (default is Percentage of assignment total):
58+
59+
- **Percentage of assignment total**: Deduct a percentage of the total possible marks for the assignment (e.g., 5%)
60+
- **Marks**: Deduct a fixed number of marks (e.g., 5 marks)
61+
- **Percentage of earned mark**: Deduct a percentage of the student's earned mark (e.g., 5% of their score)
62+
63+
The deduction unit displayed next to the input field will automatically update based on your selection (% for percentage types, marks for the marks option).
64+
4365
![Website Manual Penalty Periods](images/late-submission-policy-penalty-period.png)
44-
Additional time periods are added by clicking the "Add late period" button and removed by using the delete link. MarkUs will automatically adjust the "From" and "To" times depending on the number of hours you specify in the "After" column.
66+
Additional time periods are added by clicking the "Add late period" button and removed by using the delete link. MarkUs will automatically adjust the "From" and "To" times depending on the number of hours you specify in the "Period" column.
4567

4668
Note that for each late submission method, in order for the "From" and "To" times to be calculated, a due date must be specified in the "Properties" section. If a date is not specified then the "From" and "To" sections will be empty or read "Invalid Date"
4769

Instructor-Guide--Assignments--Setting-Up.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ This section allows you to set the name and due date for the assignment as well
3333
**2. Assignment description**: This is the longer, more descriptive name of the assignment used as its full title.
3434
**3. Message**: This section allows you to include any additional information the students may need to know about the assignment.
3535
**4. Due Date**: This section lets you set the due date for the assignment. You are able to configure the time (down to the minute) at which you would like the assignment to be due. The due date will be visible to students when they view the assignment. Note that the due date may be changed later on (ex/ to accommodate class-wide extensions). Changing the due date after submissions have been collected will not affect submitted assignments.
36-
**5. Section Due Dates:** Checking the "Enable section due dates" box will allow you to set different due dates for different lecture sections. Note that if a due date is not specified the time in the "Due Date" section will be used by default.
36+
37+
**5. Visibility:** Controls when students can see the assignment:
38+
39+
- **Hidden**: Students cannot see this assignment
40+
- **Visible**: Students can always see this assignment
41+
- **Visible on/until**: Assignment is only visible between specified start and end datetimes
42+
43+
**6. Section-Specific Settings:** Checking the "Enable section specific settings" box will allow you to set different due dates and visibility settings for different lecture sections. Each section can override the default due date and visibility settings.
3744
> :spiral_notepad: **NOTE:** Students not assigned to any section will only be allowed to form groups with other students not assigned to any section.
3845
39-
**6. Check boxes:** The rest of this section includes check boxes that may be selected or deselected depending on your preferences. Note that in order for students to submit online, the "Allow students to submit through the web interface" box must be checked. If you prefer students to submit through a version control system, then uncheck the "web interface" box and select "version control system".
46+
**7. Check boxes:** The rest of this section includes check boxes that may be selected or deselected depending on your preferences. Note that in order for students to submit online, the "Allow students to submit through the web interface" box must be checked. If you prefer students to submit through a version control system, then uncheck the "web interface" box and select "version control system".
4047

4148
If you wish to allow students to submit URLs check the "Allow students to submit URLs" box. This is especially useful if you plan on requiring students to submit videos or large files since preview support is available for content from YouTube and Google Drive/Docs.
4249
> :spiral_notepad: **NOTE:**

RESTful-API.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,151 @@ NOTE: collect_current value meanings:
10581058
- true: collect most recent files submitted, regardless of assignment due date or late period.
10591059
- false: collect most recent files submitted before the due date, including any late period.
10601060

1061+
### POST /api/courses/:course_id/assignments/:assignment_id/groups/:group_id/add_test_results
1062+
1063+
- description: Submit automated test results for the given group for the given assignment. This endpoint is used by the autotesting service to report test execution results.
1064+
- required parameters:
1065+
- test_results (object)
1066+
- status (string: test execution status, e.g., "pass", "fail", "finished")
1067+
- error (string or null: error message if test execution failed)
1068+
- test_groups (array of objects)
1069+
- time (integer or null: execution time in milliseconds)
1070+
- tests (array of objects)
1071+
- name (string: test name)
1072+
- status (string: one of "pass", "partial", "fail", "error", "error_all")
1073+
- marks_earned (integer: points earned)
1074+
- marks_total (integer: maximum points)
1075+
- output (string: test output/feedback)
1076+
- time (integer or null: execution time in milliseconds)
1077+
- extra_info (object)
1078+
- name (string: test group name)
1079+
- test_group_id (integer: ID of the test group)
1080+
- display_output (integer: 0=instructors, 1=instructors_and_student_tests, 2=instructors_and_students)
1081+
- criterion (string or null: associated criterion name)
1082+
- optional parameters (within test_groups):
1083+
- timeout (integer: timeout value if test timed out)
1084+
- stderr (string: standard error output)
1085+
- malformed (string: malformed output information)
1086+
- annotations (array of objects: code annotations to add)
1087+
- content (string: annotation content)
1088+
- filename (string: file to annotate)
1089+
- type (string: "TextAnnotation", "ImageAnnotation", etc.)
1090+
- line_start, line_end, column_start, column_end (integers: for text annotations)
1091+
- x1, x2, y1, y2 (integers: for image/PDF annotations)
1092+
- feedback (array of objects: feedback files to attach)
1093+
- filename (string)
1094+
- mime_type (string)
1095+
- content (string: file content, may be base64 encoded)
1096+
- compression (string: "gzip" if content is compressed)
1097+
- tags (array of objects: tags to apply to the grouping)
1098+
- name (string: tag name)
1099+
- description (string: tag description)
1100+
- overall_comment (string: overall comment to add to the result)
1101+
- example request body (json):
1102+
1103+
```json
1104+
{
1105+
"test_results": {
1106+
"status": "finished",
1107+
"error": null,
1108+
"test_groups": [
1109+
{
1110+
"time": 1250,
1111+
"extra_info": {
1112+
"name": "Correctness Tests",
1113+
"test_group_id": 42,
1114+
"display_output": 2,
1115+
"criterion": "Correctness"
1116+
},
1117+
"tests": [
1118+
{
1119+
"name": "test_addition",
1120+
"status": "pass",
1121+
"marks_earned": 2,
1122+
"marks_total": 2,
1123+
"time": 125,
1124+
"output": "All test cases passed"
1125+
},
1126+
{
1127+
"name": "test_subtraction",
1128+
"status": "fail",
1129+
"marks_earned": 0,
1130+
"marks_total": 2,
1131+
"time": 98,
1132+
"output": "Expected 5, got 3"
1133+
}
1134+
],
1135+
"annotations": [
1136+
{
1137+
"content": "Consider edge cases for negative numbers",
1138+
"filename": "calculator.py",
1139+
"line_start": 10,
1140+
"line_end": 12,
1141+
"column_start": 0,
1142+
"column_end": 20
1143+
}
1144+
],
1145+
"tags": [
1146+
{
1147+
"name": "needs_review",
1148+
"description": "Requires manual review"
1149+
}
1150+
],
1151+
"overall_comment": "Good attempt, but edge cases need work"
1152+
}
1153+
]
1154+
}
1155+
}
1156+
```
1157+
1158+
- example success response (json):
1159+
1160+
```json
1161+
{
1162+
"status": "success",
1163+
"test_run_id": 1234
1164+
}
1165+
```
1166+
1167+
NOTE: This endpoint creates a TestRun record with associated test results, annotations, feedback files, and tags. All operations are performed atomically within a transaction.
1168+
1169+
NOTE: The request body is validated against a schema and must not exceed 10MB in size.
1170+
1171+
NOTE: Authentication is required via API key. The authenticated user's role is used as the creator of the test run.
1172+
1173+
### GET /api/courses/:course_id/assignments/:assignment_id/groups/:id/test_results
1174+
1175+
- description: Get automated test results for the given group for the given assignment. Returns only the latest test run, grouped by test group name. Matches the UI download format.
1176+
- supported content types: `application/json`, `application/xml`
1177+
- example response (json):
1178+
1179+
```json
1180+
{
1181+
"Test Group 1": [
1182+
{
1183+
"name": "Test Group 1",
1184+
"test_groups_id": 7,
1185+
"group_name": "group1",
1186+
"test_result_name": "test_addition",
1187+
"status": "pass",
1188+
"marks_earned": 3.0,
1189+
"marks_total": 5.0,
1190+
"output": "All test cases passed",
1191+
"extra_info": null,
1192+
"error_type": null
1193+
}
1194+
]
1195+
}
1196+
```
1197+
1198+
NOTE: This endpoint returns only the most recent test run results for the group, not historical test runs.
1199+
1200+
NOTE: Results are grouped by test group name (the keys in the JSON object are test group names).
1201+
1202+
NOTE: Supports XML responses by setting the `Accept` header to `application/xml` or using the `.xml` extension.
1203+
1204+
NOTE: Returns 404 if the group has no test results.
1205+
10611206
### POST /api/courses/:course_id/assignments/:assignment_id/groups/:group_id/extension
10621207

10631208
- description: Create an extension for the given group for the given assignment
-61.8 KB
Loading
41.7 KB
Loading
36.3 KB
Loading

0 commit comments

Comments
 (0)