Skip to content

Commit bc1cab4

Browse files
authored
Merge branch 'main' into sysadmin-note-http2
2 parents 3642103 + 2e9fcf4 commit bc1cab4

File tree

283 files changed

+1477
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

283 files changed

+1477
-399
lines changed

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.0.4.2)
4+
activesupport (7.0.7)
55
concurrent-ruby (~> 1.0, >= 1.0.2)
66
i18n (>= 1.6, < 2)
77
minitest (>= 5.1)
@@ -14,7 +14,7 @@ GEM
1414
coffee-script-source (1.11.1)
1515
colorator (1.1.0)
1616
commonmarker (0.23.8)
17-
concurrent-ruby (1.2.0)
17+
concurrent-ruby (1.2.2)
1818
dnsruby (1.61.9)
1919
simpleidn (~> 0.1)
2020
em-websocket (0.5.3)
@@ -96,7 +96,7 @@ GEM
9696
typhoeus (~> 1.3)
9797
yell (~> 2.0)
9898
http_parser.rb (0.8.0)
99-
i18n (1.12.0)
99+
i18n (1.14.1)
100100
concurrent-ruby (~> 1.0)
101101
jekyll (3.9.3)
102102
addressable (~> 2.4)
@@ -220,7 +220,7 @@ GEM
220220
jekyll (>= 3.5, < 5.0)
221221
jekyll-feed (~> 0.9)
222222
jekyll-seo-tag (~> 2.1)
223-
minitest (5.17.0)
223+
minitest (5.19.0)
224224
nokogiri (1.14.1)
225225
mini_portile2 (~> 2.8.0)
226226
racc (~> 1.4)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ by running:
4141
```
4242

4343
* _NOTE: During the install, it may hang up when installing the
44-
dependency ``nokogiri``. Don't worry: press enter and it should
45-
continue.
44+
dependency ``nokogiri``. Don't worry: continue waiting. If it still is stalling
45+
here, press enter and it should continue._
4646

4747

4848
* _NOTE: If an error is thrown during the installation process you

_docs/developer/development_instructions/index.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ Please also see [Installation Version Notes](/sysadmin/installation/version_note
5555
## Website and Bin Script Changes
5656

5757
* If you have only made minor or modest visual changes to website
58-
(e.g., the html, css, twig, or php files), or other files in the
59-
`site` folder, you can apply those changes by running this shortcut:
58+
(e.g., the html, css, twig, or php files), other files in the `site`
59+
folder, or translation files in the Localization repository, you can
60+
apply those changes by running this shortcut:
6061

6162
```
6263
submitty_install_site
@@ -124,9 +125,7 @@ be able to reload the website and see the update.
124125
See also: [PhpStorm configuration instructions](/developer/getting_started/phpstorm)
125126

126127

127-
---
128-
129-
## Clearing Your Browser Cache
128+
### Clearing Your Browser Cache
130129

131130

132131
* If the JavaScript files have changed and there are errors or you do not see the
@@ -162,6 +161,9 @@ include more significant Submitty source code changes, it will likely
162161
be necessary to conduct a more complete update and reset re-set of all
163162
of the Submitty source code.
164163

164+
165+
166+
165167
* In these cases, run this shortcut in the vagrant terminal:
166168

167169
```
@@ -186,9 +188,12 @@ of the Submitty source code.
186188
sudo /usr/local/submitty/.setup/INSTALL_SUBMITTY.sh clean
187189
```
188190

189-
---
190191

191-
## Autograding Development
192+
Note: The above commands will also apply any necessary system and
193+
database [Migrations](/developer/development_instructions/migrations).
194+
195+
196+
### Autograding Development
192197

193198
In addition to the `submitty_install` command above, if you modify an
194199
autograding configuration, you'll probably need to:
@@ -197,7 +202,6 @@ autograding configuration, you'll probably need to:
197202

198203
* [Batch Regrade Homeworks](/instructor/batch_regrade_submissions) already submitted to those gradeables.
199204

200-
201205
---
202206

203207
## System Clock Testing & Troubleshooting
@@ -264,7 +268,8 @@ these changes.
264268
* If you've changed the script to create a new course
265269
(`create_course.sh`), or the schema for the master database
266270
(`submitty_db.sql`), or the schema for the course databases
267-
(`course_tables.sql`), we need to delete all courses, and recreate
271+
(`course_tables.sql`), or you changed student/gradeable data
272+
we need to delete all courses and recreate
268273
the course databases, users, and sample submission uploads.
269274

270275
_NOTE: Make sure you are not be connected to any DBs (e.g., through
@@ -283,9 +288,12 @@ these changes.
283288
missing the hundreds of sample student submissions present in the
284289
full installation.
285290

286-
See also: [Database Migrations](/developer/development_instructions/migrations)
291+
292+
NOTE: This command will also have to be run twice a year on July 1st and January 1st when the test semester will change from fall to spring or vice versa.
287293

288294

295+
See also: [Sample Course Data](/developer/development_instructions/sample_data)
296+
289297
---
290298

291299
## Complete System Re-Installation
@@ -322,3 +330,21 @@ these changes.
322330
also destroy the databases, and any grading configuration or grading
323331
work that has been done._
324332

333+
---
334+
335+
## Virtual Machine Recovery using Snapshots
336+
337+
In the event of a non-recoverable error while working on Submitty the last resort is to, perform a fresh `vagrant up`. However, this process can be time-consuming. To avoid such situations and save time, it is highly recommended to take a snapshot when you first set up your Vagrant environment by following the tutorial links provided below:
338+
339+
* [Virtual Box](https://www.youtube.com/watch?v=Kl-Qc6N9znw)
340+
341+
* [VMWare](https://www.youtube.com/watch?v=DQutP_-2j3g)
342+
343+
* [Vagrant](https://developer.hashicorp.com/vagrant/docs/cli/snapshot)
344+
345+
By taking a snapshot at this initial stage, you can later revert to this saved state if needed, ensuring a quick recovery. Once you have restored the snapshot, you can then proceed with the following steps:
346+
347+
1. Launch the virtual machine using `vagrant up`.
348+
2. Access the virtual machine with `vagrant ssh`.
349+
3. Run `submitty_install` command to conduct a more complete update and reset of all of the Submitty source code.
350+
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Localization / Language Support
3+
category: Developer > Development Instructions
4+
redirect_from:
5+
- /developer/migrations
6+
---
7+
8+
9+
The goals of localization or internationalization include the
10+
translation of the website into multiple languages, to increase the
11+
accessibility of Submitty to users in all locales or regions.
12+
13+
To contribute to Submitty's localization and translation efforts,
14+
follow these steps to update Twig templated files and provide
15+
translations for various text elements on the website.
16+
17+
---
18+
19+
## Server Language Specification
20+
21+
By default, all Submitty pages will display in English based on the
22+
`en_US` locale. To modify the server default setting, the system
23+
administrator should edit the
24+
`/usr/local/submitty/config/submitty.json` file and add this line, e.g.:
25+
26+
```
27+
"default_locale": "fr_FR",
28+
```
29+
30+
to specify an alternate locale.
31+
See also [Php Locale class](https://www.php.net/manual/en/class.locale.php).
32+
33+
---
34+
35+
## Individual Language Specification
36+
37+
Each individual user can specify their own preferred locale if they do
38+
not wish to use the server default. Navigate to "My Profile" and
39+
choose the desired language and region settings.
40+
41+
![](/images/student/user_profile_specify_locale.png)
42+
43+
The dropdown menu will include all locales for which any translation
44+
is available in the
45+
[Localization](https://github.com/Submitty/Localization/tree/main/lang)
46+
repository. Where translation to the requested language is
47+
incomplete, the `en_US` locale will be used.
48+
49+
---
50+
51+
## Prepare a Website Page for Translation
52+
53+
Submitty uses the Twig template engine to manage html source code with
54+
Php. Checkout the [Submitty source
55+
code](https://github.com/Submitty/Submitty) and locate the specific
56+
`.twig` template file(s) associated with the webpage that you would
57+
like to update.
58+
59+
60+
Identify an untranslated English plain text string in the Twig source
61+
code, for example:
62+
63+
```
64+
<p>Text in the page I will translate</p>
65+
```
66+
67+
68+
And replace that text string with the following syntax:
69+
70+
```
71+
<p> { { localize("Page_Description.Text_To_Translate", "Text in the page I will translate") } } </p>
72+
```
73+
74+
The `localize` function requires two arguments:
75+
76+
* The first argument is the hierarchical tag or label, separated by
77+
one or more dots. The hierarchy should begin with the name of the
78+
page, and intuitively name and organize/group all phrases that
79+
appear on that page. The first part represents the role or purpose
80+
of the page, while the second (and later) parts describes the text
81+
you're translating. Use underscores to replace spaces in this part.
82+
Avoid using apostrophes, quotes, accents, and other special
83+
characters.
84+
85+
* The second argument is the original English text that will be
86+
displayed on the website if a translation in the user's language is
87+
not available.
88+
89+
90+
Make a [pull request](/developer/getting_started/make_a_pull_request)
91+
with your proposed changes.
92+
93+
---
94+
95+
## Updating the en_US.json Phrase File
96+
97+
When Twig files are edited to prepare or update one or more pages for
98+
translation, these pages will be reviewed and merged.
99+
100+
When a new release/version of the Submitty source code is published
101+
with changes to one or more `.twig` files, **[TODO]** the
102+
[`en_US.json` file in the Localization repository](https://github.com/Submitty/Localization/blob/main/lang/en_US.json)
103+
will be automatically updated.
104+
105+
---
106+
107+
## Adding Translations to the Localization Repository
108+
109+
Once the pull request is merged and a new version of Submitty is
110+
released, checkout the [Localization](https://github.com/Submitty/Localization/tree/main/lang)
111+
repository and navigate to the `Localization/lang` directory.
112+
113+
If a JSON file for the language you're translating to isn't available,
114+
create one. The file name format is as follows:
115+
```
116+
<language_code>_<country_code>.json
117+
```
118+
119+
Copy the content of the en_US.json file and paste it into the newly
120+
created or existing JSON file.
121+
122+
Edit the JSON file by translating the "Text in the page I will
123+
translate" text within the "Page_Description" section. The JSON file
124+
format should resemble the following:
125+
126+
```
127+
{
128+
"Page_Description": {
129+
"Text_To_Translate": "Translated text for the page"
130+
}
131+
}
132+
```
133+
134+
You should test your translation by following the
135+
[Development Instructions](/developer/development_instructions/index#incremental-development-updates).
136+
137+
When you are finished, submit a pull request to the Localization
138+
repository with your new and/or modified JSON files.
139+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Sample Courses Data
3+
category: Developer > Development Instructions
4+
redirect_from:
5+
- /developer/development_instructions/sample_data
6+
---
7+
8+
As a developer, there are 5 sample courses:
9+
- **BLANK**
10+
- Empty course.
11+
- **DEVELOPMENT**
12+
- All files from `/more_autograding_examples/`, which mostly tests autograding.
13+
- Most new features that need gradeables to test them will be put here.
14+
- **SAMPLE**
15+
- A simultation of a "live" course mid-semester with lots of students and lots of submissions. Tests features such as ta grading, due dates, categories, etc.
16+
- For manual & automated website testing.
17+
- **TUTORIAL**
18+
- All tutorial gradeables are in sequence, emphasizing one new feature as they grow in complexity.
19+
- **PLAGIARISM**
20+
- Used to test Lichen plagiarism detection.
21+
- This is not available by default. You must clone the [Lichen Test Data](https://github.com/Submitty/LichenTestData) repository locally to see this.
22+
23+
---
24+
25+
## Predefined Data
26+
27+
Predefined data is set using files in `/.setup/data/` and the script `/.setup/bin/setup_sample_courses.py`.
28+
29+
| Data | Location |
30+
|------|----------|
31+
| Course Gradeables | `/.setup/data/courses` |
32+
| Forum Threads | `/.setup/data/forum` |
33+
| Polls | `/.setup/data/polls` |
34+
| Office Hours Queue | `/.setup/data/queue` |
35+
| Team Assignment | `/.setup/data/teams` |
36+
| Predefined Users | `/.setup/data/users` |
37+
38+
---
39+
40+
## Sample Courses Student Data
41+
42+
Sample Courses Student Data is set using `.yml` files and the script `/.setup/bin/setup_sample_courses.py`.
43+
44+
#### Predefined Users
45+
46+
`setup_sample_courses.py` parses the yaml files in `.setup/data/users/`. If you want to know more about how to write the user yaml files, read `.setup/data/users.yml`, which explains all the options.
47+
48+
#### Random Users
49+
50+
`setup_sample_courses.py` also generates random users. Randomly generated users generate random family and given names, user ids based on the names chosen, random anonymous user ids, numeric ids, and pronouns. For more information, read the `generate_random_users` function in `setup_sample_courses.py`.
51+
52+
Randomly generated students are the same in every build, unless you make changes to `setup_sample_courses.py` or related files. This is because the random seed is set to a specific value. This decision was to keep test cases consistent. However, if you make changes that utilize randomness, it may change the randomly generated students, thus making the test cases obsolete.
53+
54+
If you make changes that use/alter random number generation, you may need to
55+
edit the following files:
56+
- Peer Review:
57+
- `.setup/data/random/students.txt`
58+
- `.setup/data/random/graders.txt`
59+
- Office Hours Queue:
60+
- `.setup/data/queue/queue_data.json`
61+
- Discussion Forum:
62+
- `.setup/data/forum/threads.txt`
63+
- `.setup/data/forum/posts.txt`
64+
- Teams:
65+
- `.setup/data/teams/sample_open_team_homework_teams.csv`
66+
67+
These files are manually written for a given set of users (the set is predetermined due to
68+
the random's seed staying the same). If you make any changes that affects the contents of the
69+
set these files will be outdated and result in failure of recreate_sample_courses.
70+
71+
You may also need to edit test cases in Cypress, Selenium, etc.
72+
73+
---
74+
75+
See also: [Re-Creating All Sample Course Data](/developer/development_instructions/index#re-creating-all-sample-course-data)
76+

0 commit comments

Comments
 (0)