Skip to content

Commit 81008bc

Browse files
committed
Merge branch 'master' into 16691_restrict_ip
# Conflicts: # package.json
2 parents f56365d + ab3ca37 commit 81008bc

4 files changed

Lines changed: 351 additions & 149 deletions

File tree

Lines changed: 73 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,75 @@
11
{
2-
"type": "fill-in-the-blanks",
3-
"taskId": "fill-in-the-blanks-3168852053",
4-
"source": {
5-
"name": "Python Basics",
6-
"showName": true,
7-
"instructions": "Fill in the blanks to complete the Python code snippets correctly.",
8-
"showValues": true,
9-
"text": "# Print \"Hello, World!\"\nprint(<<<\"Hello, World!\">>>)\n\n# Assign the value 5 to variable x\nx = <<<5>>>\n\n# Create a list of numbers 1 through 5\nnumbers = <<<[1, 2, 3, 4, 5]>>>\n\n# Define a function that returns the square of a number\ndef square(n):\n return <<<n * n>>>\n\n# Use a for loop to iterate over a range from 0 to 4\nfor i in <<<range(5)>>>:\n print(i)",
10-
"distractors": "\"Hello World\"\n\"Hello world!\"\n4\n6\n(1, 2, 3, 4, 5)\n{1, 2, 3, 4, 5}\nn ** 2\nn + n\nrange(4)\nrange(1, 5)",
11-
"guidance": "1. The correct string for printing \"Hello, World!\" includes proper capitalization and punctuation.\n2. To assign 5 to x, we simply use '5'.\n3. A list in Python is created using square brackets [].\n4. The square of a number is calculated by multiplying it by itself (n * n).\n5. range(5) generates numbers from 0 to 4, which is what we want for a loop that iterates 5 times starting from 0.",
12-
"showGuidanceAfterResponseOption": {
13-
"type": "Attempts",
14-
"passedFrom": 1
15-
},
16-
"maxAttemptsCount": 1,
17-
"showExpectedAnswer": true,
18-
"points": 20,
19-
"arePartialPointsAllowed": false,
20-
"useMaximumScore": false,
21-
"metadata": {
22-
"tags": [
23-
{
24-
"name": "Assessment Type",
25-
"value": "Fill in the Blanks"
26-
},
27-
{
28-
"name": "Programming Language",
29-
"value": "python"
30-
},
31-
{
32-
"name": "Content",
33-
"value": "python tests"
34-
}
35-
],
36-
"files": [],
37-
"opened": []
38-
},
39-
"bloomsObjectiveLevel": "1",
40-
"learningObjectives": "python tests",
41-
"tokens": {
42-
"blank": [
43-
"\"Hello, World!\"",
44-
"5",
45-
"[1, 2, 3, 4, 5]",
46-
"n * n",
47-
"range(5)"
48-
],
49-
"text": [
50-
"# Print \"Hello, World!\"\nprint(",
51-
0,
52-
")\n\n# Assign the value 5 to variable x\nx = ",
53-
0,
54-
"\n\n# Create a list of numbers 1 through 5\nnumbers = ",
55-
0,
56-
"\n\n# Define a function that returns the square of a number\ndef square(n):\n return ",
57-
0,
58-
"\n\n# Use a for loop to iterate over a range from 0 to 4\nfor i in ",
59-
0,
60-
":\n print(i)"
61-
],
62-
"regexPositions": []
63-
}
64-
}
2+
"type": "fill-in-the-blanks",
3+
"taskId": "fill-in-the-blanks-3168852053",
4+
"source": {
5+
"name": "Python Basics",
6+
"showName": true,
7+
"instructions": "Fill in the blanks to complete the Python code snippets correctly.",
8+
"showValues": true,
9+
"text": "# Print \"Hello, World!\"\nprint(<<<\"Hello, World!\">>>)\n\n# Assign the value 5 to variable x\nx = <<<5>>>\n\n# Create a list of numbers 1 through 5\nnumbers = <<<[1, 2, 3, 4, 5]>>>\n\n# Define a function that returns the square of a number\ndef square(n):\n return <<<n * n>>>\n\n# Use a for loop to iterate over a range from 0 to 4\nfor i in <<<range(5)>>>:\n print(i)",
10+
"distractors": "\"Hello World\"\n\"Hello world!\"\n4\n6\n(1, 2, 3, 4, 5)\n{1, 2, 3, 4, 5}\nn ** 2\nn + n\nrange(4)\nrange(1, 5)",
11+
"guidance": "1. The correct string for printing \"Hello, World!\" includes proper capitalization and punctuation.\n2. To assign 5 to x, we simply use '5'.\n3. A list in Python is created using square brackets [].\n4. The square of a number is calculated by multiplying it by itself (n * n).\n5. range(5) generates numbers from 0 to 4, which is what we want for a loop that iterates 5 times starting from 0.",
12+
"showGuidanceAfterResponseOption": {
13+
"type": "Attempts",
14+
"passedFrom": 1
15+
},
16+
"maxAttemptsCount": 1,
17+
"showExpectedAnswerOption": {
18+
"type": "WhenGradesReleased"
19+
},
20+
"points": 20,
21+
"arePartialPointsAllowed": false,
22+
"useMaximumScore": false,
23+
"metadata": {
24+
"tags": [
25+
{
26+
"name": "Assessment Type",
27+
"value": "Fill in the Blanks"
28+
},
29+
{
30+
"name": "Programming Language",
31+
"value": "python"
32+
},
33+
{
34+
"name": "Content",
35+
"value": "python tests"
36+
},
37+
{
38+
"name": "CODIO_API_ID",
39+
"value": "29b05e2f-0304-4914-bff7-a936c9a09f95"
40+
},
41+
{
42+
"name": "CODIO_API_HASH",
43+
"value": "da670dc1476a0035505505477c1ff34483d892e4"
44+
}
45+
],
46+
"files": [],
47+
"opened": []
48+
},
49+
"bloomsObjectiveLevel": "1",
50+
"learningObjectives": "python tests",
51+
"tokens": {
52+
"blank": [
53+
"\"Hello, World!\"",
54+
"5",
55+
"[1, 2, 3, 4, 5]",
56+
"n * n",
57+
"range(5)"
58+
],
59+
"text": [
60+
"# Print \"Hello, World!\"\nprint(",
61+
0,
62+
")\n\n# Assign the value 5 to variable x\nx = ",
63+
0,
64+
"\n\n# Create a list of numbers 1 through 5\nnumbers = ",
65+
0,
66+
"\n\n# Define a function that returns the square of a number\ndef square(n):\n return ",
67+
0,
68+
"\n\n# Use a for loop to iterate over a range from 0 to 4\nfor i in ",
69+
0,
70+
":\n print(i)"
71+
],
72+
"regexPositions": []
73+
}
74+
}
6575
}
Lines changed: 72 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,74 @@
11
{
2-
"type": "multiple-choice",
3-
"taskId": "multiple-choice-1081906419",
4-
"source": {
5-
"name": "Python Style Assessment",
6-
"showName": true,
7-
"instructions": "**Which of the following Python code snippets best adheres to PEP 8 style guidelines?**",
8-
"multipleResponse": false,
9-
"isRandomized": false,
10-
"answers": [
11-
{
12-
"_id": "ae469b56-e6b0-fc46-64ea-dce960846d2c",
13-
"correct": false,
14-
"answer": "```python-hide-clipboard\ndef calculate_area(length,width):\n return length*width\n```"
15-
},
16-
{
17-
"_id": "02bdb411-682d-ed2d-7aae-3e78d0769c56",
18-
"correct": true,
19-
"answer": "```python-hide-clipboard\ndef calculate_area(length, width):\n return length * width\n```"
20-
},
21-
{
22-
"_id": "8101b5a1-2666-e4c5-0c89-1d3b8a0a7810",
23-
"correct": false,
24-
"answer": "```python-hide-clipboard\ndef calculateArea(length, width):\n return length * width\n```"
25-
},
26-
{
27-
"_id": "a1c995a0-cf66-4fc1-e01c-e0223f185c28",
28-
"correct": false,
29-
"answer": "```python-hide-clipboard\ndef Calculate_Area(Length, Width):\n return Length * Width\n```"
30-
}
31-
],
32-
"guidance": "The correct option follows PEP 8 guidelines:\n1. Use lowercase letters and underscores for function names (snake_case)\n2. Include spaces after commas in function parameters\n3. Use spaces around operators\n4. No spaces immediately inside parentheses\nThe other options violate one or more of these guidelines.",
33-
"showGuidanceAfterResponseOption": {
34-
"type": "Attempts",
35-
"passedFrom": 1
36-
},
37-
"maxAttemptsCount": 1,
38-
"showExpectedAnswer": true,
39-
"points": 20,
40-
"incorrectPoints": 0,
41-
"arePartialPointsAllowed": false,
42-
"useMaximumScore": false,
43-
"metadata": {
44-
"tags": [
45-
{
46-
"name": "Assessment Type",
47-
"value": "Multiple Choice"
48-
},
49-
{
50-
"name": "Programming Language",
51-
"value": "python"
52-
},
53-
{
54-
"name": "Content",
55-
"value": "python style"
56-
}
57-
],
58-
"files": [],
59-
"opened": []
60-
},
61-
"bloomsObjectiveLevel": "3",
62-
"learningObjectives": "SWBAT identify Python code that adheres to PEP 8 style guidelines"
63-
}
2+
"type": "multiple-choice",
3+
"taskId": "multiple-choice-1081906419",
4+
"source": {
5+
"name": "Python Style Assessment",
6+
"showName": true,
7+
"instructions": "**Which of the following Python code snippets best adheres to PEP 8 style guidelines?**",
8+
"multipleResponse": false,
9+
"isRandomized": false,
10+
"answers": [
11+
{
12+
"_id": "ae469b56-e6b0-fc46-64ea-dce960846d2c",
13+
"correct": false,
14+
"answer": "```python-hide-clipboard\ndef calculate_area(length,width):\n return length*width\n```"
15+
},
16+
{
17+
"_id": "02bdb411-682d-ed2d-7aae-3e78d0769c56",
18+
"correct": true,
19+
"answer": "```python-hide-clipboard\ndef calculate_area(length, width):\n return length * width\n```"
20+
},
21+
{
22+
"_id": "8101b5a1-2666-e4c5-0c89-1d3b8a0a7810",
23+
"correct": false,
24+
"answer": "```python-hide-clipboard\ndef calculateArea(length, width):\n return length * width\n```"
25+
},
26+
{
27+
"_id": "a1c995a0-cf66-4fc1-e01c-e0223f185c28",
28+
"correct": false,
29+
"answer": "```python-hide-clipboard\ndef Calculate_Area(Length, Width):\n return Length * Width\n```"
30+
}
31+
],
32+
"guidance": "The correct option follows PEP 8 guidelines:\n1. Use lowercase letters and underscores for function names (snake_case)\n2. Include spaces after commas in function parameters\n3. Use spaces around operators\n4. No spaces immediately inside parentheses\nThe other options violate one or more of these guidelines.",
33+
"showGuidanceAfterResponseOption": {
34+
"type": "Attempts",
35+
"passedFrom": 1
36+
},
37+
"maxAttemptsCount": 1,
38+
"showExpectedAnswerOption": {
39+
"type": "WhenGradesReleased"
40+
},
41+
"points": 20,
42+
"incorrectPoints": 0,
43+
"arePartialPointsAllowed": false,
44+
"useMaximumScore": false,
45+
"metadata": {
46+
"tags": [
47+
{
48+
"name": "Assessment Type",
49+
"value": "Multiple Choice"
50+
},
51+
{
52+
"name": "Programming Language",
53+
"value": "python"
54+
},
55+
{
56+
"name": "Content",
57+
"value": "python style"
58+
},
59+
{
60+
"name": "CODIO_API_ID",
61+
"value": "488294eb-e2a8-487b-a055-17017e9e3f2f"
62+
},
63+
{
64+
"name": "CODIO_API_HASH",
65+
"value": "f22f511fa0ab1964b64314203d0806f79fea487e"
66+
}
67+
],
68+
"files": [],
69+
"opened": []
70+
},
71+
"bloomsObjectiveLevel": "3",
72+
"learningObjectives": "SWBAT identify Python code that adheres to PEP 8 style guidelines"
73+
}
6474
}

src/lib/assessment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async function _publishAssessment(libraryId: string, assessment: Assessment, isN
9494
const api = bent(getApiV1Url(), isNew ? 'POST': 'PUT', 200)
9595

9696
const postData = new FormData()
97-
postData.append('assessment', assessment.export())
97+
postData.append('assessment', assessment.export(false, true))
9898
const archivePath = await assessment.getBundle(base)
9999
if (!_.isUndefined(archivePath)) {
100100
const { size } = await fs.promises.stat(archivePath)

0 commit comments

Comments
 (0)