Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/problem_bank_scripts/problem_bank_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ def process_question_md(
instructor (bool, optional): Flag to determine if the output is for an instructor or not. Defaults to False.
This determines if the solutions are included in the output or not.
"""
import random
import numpy
try:
source_filepath = pathlib.Path(source_filepath).resolve(strict=True)
except:
Expand Down Expand Up @@ -687,6 +689,8 @@ def str_presenter(dumper, data2):
with tempfile.TemporaryDirectory(suffix=f"_{output_path.stem}", ignore_cleanup_errors=True) as dirpath:
file = pathlib.Path(dirpath).joinpath("server.py")
file.write_text(server_py, encoding="utf8")
random.seed(111)
numpy.random.seed(111) # noqa: NPY002
try:
code = compile(server_py, file.as_posix(), "exec")
exec(code, server)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ assets:
- test2.png
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import numpy as np
import pandas as pd
import problem_bank_helpers as pbh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import numpy as np
import pandas as pd
import problem_bank_helpers as pbh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import sympy as sp
import prairielearn as pl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import sympy as sp
import prairielearn as pl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ assets:
- test2.png
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ externalGradingOptions:
entrypoint: /python_autograder/run.sh
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import math
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tags:
- unknown
assets: null
server:
imports: "import random; random.seed(111) \nimport problem_bank_helpers as pbh\n"
imports: "import random \nimport problem_bank_helpers as pbh\n"
generate: |
data2 = pbh.create_data2()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import numpy as np; np.random.seed(111)
import numpy as np
import problem_bank_helpers as pbh
import prairielearn as pl
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
assets: null
server:
imports: |
import random; random.seed(111)
import random
from statistics import median
import problem_bank_helpers as pbh
generate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-19T07:09:41-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2024-08-09T06:48:09-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"topic": "000.Template",
"tags": [
"multi_part",
"number-input",
"dropdown",
"number-input",
"DEV"
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2024-06-20T16:22:06-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import numpy as np
import pandas as pd
import problem_bank_helpers as pbh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2024-06-20T16:22:06-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import numpy as np
import pandas as pd
import problem_bank_helpers as pbh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import sympy as sp
import prairielearn as pl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import sympy as sp
import prairielearn as pl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"gradingMethod": "Manual",
"comment": {
"lastModified": "2023-06-14T19:23:57-0700"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import pandas as pd
import problem_bank_helpers as pbh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
],
"type": "v3",
"partialCredit": true,
"singleVariant": false,
"showCorrectAnswer": false,
"singleVariant": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"DEV"
],
"type": "v3",
"showCorrectAnswer": false,
"gradingMethod": "External",
"singleVariant": true,
"partialCredit": true,
"externalGradingOptions": {
"enabled": true,
"image": "prairielearn/grader-python",
"entrypoint": "/python_autograder/run.sh"
},
"gradingMethod": "External",
"partialCredit": true,
"showCorrectAnswer": false,
"comment": {
"lastModified": "2023-06-14T21:02:26-0700"
"lastModified": "2024-08-29T11:22:51-0700"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import random as rd; rd.seed(111)
import random as rd
import math
import problem_bank_helpers as pbh

Expand Down
Loading