👀 Reading hidden code
import Pluto
👀 Reading hidden code
import UUIDs : UUID
👀 Reading hidden code
import Distributed
👀 Reading hidden code
using PlutoUI
👀 Reading hidden code
using DataFrames
👀 Reading hidden code
import CSV
Part 1: autograding
👀 Reading hidden code
Step 1: Select submission files
👀 Reading hidden code
IOError: readdir("/home/fons/disorganised-mess/autograding/submissions/"): no such file or directory (ENOENT)
Here is what happened, the most recent locations are first:
- uv_errorfrom libuv.jl:97
- readdir
(dir::String; join::Bool, sort::Bool) from file.jl:851 - from This cell: line 1
submission_files = readdir("/home/fons/disorganised-mess/autograding/submissions/"; join=true)
submission_files = readdir("/home/fons/disorganised-mess/autograding/submissions/"; join=true)
👀 Reading hidden code
Another cell defining submission_files contains errors.
if !all(isabspath, submission_files)
md"""
!!! warning
Submission paths need to be _absolute_
"""
end
👀 Reading hidden code
Step 2: autograde actions
👀 Reading hidden code
"name"
:(student.name)
"email"
:(student.email)
"number"
:(student.number)
"big number"
5
quote #= /home/runner/work/disorganised-mess/disorganised-mess/autograding/autograde.jl#==#eaa49370-e6da-11ea-21d9-ddf11a7df51f:7 =# big_number > 100 end
"ispositive"
10
quote #= /home/runner/work/disorganised-mess/disorganised-mess/autograding/autograde.jl#==#eaa49370-e6da-11ea-21d9-ddf11a7df51f:11 =# ispositive(20) && !(ispositive(0)) end
actions = [
GetValue("name", :(student.name)),
GetValue("email", :(student.email)),
GetValue("number", :(student.number)),
Assignment("big number", 5, quote
big_number > 100
end),
Assignment("ispositive", 10, quote
ispositive(20) && !ispositive(0)
end),
]
👀 Reading hidden code
naming_function (generic function with 1 method)
function naming_function(notebook::Pluto.Notebook, action_results::Vector)
action_results[3]
end
👀 Reading hidden code
Step 3: autograde all notebooks
👀 Reading hidden code
Another cell defining submission_files contains errors.
uhmmmmmm??!
md"**Click to start autograding:**
$(@bind run_notebooks CheckBox()) run $(length(submission_files)) notebooks
---"
👀 Reading hidden code
"2saozyhF"
nothing
nothing
"/"
"127.0.0.1"
nothing
1234
true
false
true
"/home/runner/work/disorganised-mess/disorganised-mess/autograding/"
false
false
0.4
false
nothing
false
0.0
0.0
"data:text/javascript;base64,"
#1 (generic function with 1 method)
true
true
true
true
true
nothing
false
true
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
nothing
"no"
"no"
2
pluto_session = Pluto.ServerSession()
👀 Reading hidden code
submission_files_to_run = run_notebooks ? Pluto.tamepath.(submission_files) : String[]
👀 Reading hidden code
👀 Reading hidden code
👀 Reading hidden code
👀 Reading hidden code
⌀ (This table has no columns) | ||
⌀ (This table has no rows) |
👀 Reading hidden code
👀 Reading hidden code
Part 2: manual review
👀 Reading hidden code
Step 1: start notebook server
👀 Reading hidden code
Click to start notebook server:
👀 Reading hidden code
if run_server
@async Pluto.run(2468; session=pluto_session)
md"> Server is running at [https://localhost:2468](https://localhost:2468)"
end
👀 Reading hidden code
Step 2: select notebook
👀 Reading hidden code
BoundsError: attempt to access 0-element Vector{Pair} at index [1]
Here is what happened, the most recent locations are first:
- getindexfrom array.jl:861
- first
(a::Vector{Pair}) from abstractarray.jl:398 - get
(select::PlutoUI.BuiltinsNotebook.Select) from Builtins.jl:667 - macro expansionfrom This cell: line 126
- Show more...
@bind inspected_notebook_index_str Select([string(i) => nb.path for (i,nb) in enumerate(notebooks)])
👀 Reading hidden code
Another cell defining inspected_notebook_index_str contains errors.
Oh no! 🙀
autograde_results_df[inspected_notebook_index, :]
👀 Reading hidden code
👀 Reading hidden code
a
asdff
@bind manual_results let
boxes = map(manual) do name
"""<p><input type='checkbox' id='$(name)' $(rand(Bool) ? "checked" : "")> $(name)</p>"""
end
"""
<div id="hello">
$(join(boxes))
</div>
<script>
const div = this.querySelector("#hello")
const boxes = div.querySelectorAll("input")
boxes.forEach(el => {
el.oninput = () => {
div.value = Object.fromEntries(Array.from(boxes).map((b) => [b.id, b.checked]))
}
})
</script>
""" |> HTML
end
👀 Reading hidden code
"a"
"asdff"
manual = ["a", "asdff"]
👀 Reading hidden code
h (generic function with 1 method)
h(x) = repr(MIME"text/html"(), x)
👀 Reading hidden code
"<input type=\"checkbox\" checked>"
h(CheckBox(;default=true))
👀 Reading hidden code
missing
manual_results
👀 Reading hidden code
DownloadButton(sprint(CSV.write, autograde_results_df), "manual_results.csv")
👀 Reading hidden code
Another cell defining inspected_notebook_index_str contains errors.
inspected_notebook_index = parse(Int, inspected_notebook_index_str)
👀 Reading hidden code
Another cell defining inspected_notebook_index_str contains errors.
beep boop CRASH 🤖
inspected_notebook = notebooks[inspected_notebook_index]
👀 Reading hidden code
Appendix
👀 Reading hidden code
Grading actions
👀 Reading hidden code
abstract type GradingAction end
👀 Reading hidden code
struct Assignment <: GradingAction
name
points_value::Number
test::Expr
end
👀 Reading hidden code
struct GetValue <: GradingAction
name
getter::Expr
end
👀 Reading hidden code
do_action (generic function with 2 methods)
begin
function do_action(notebook::Pluto.Notebook, action::Assignment)
tester = quote
try
$(action.test)
catch
false
end
end
if eval_in_notebook(notebook, tester)
action.points_value
else
zero(action.points_value)
end
end
function do_action(notebook::Pluto.Notebook, action::GetValue)
eval_in_notebook(notebook, action.getter)
end
end
👀 Reading hidden code
displayname (generic function with 1 method)
begin
# default
displayname(action::GradingAction) = action.name
end
👀 Reading hidden code
Misc
👀 Reading hidden code
eval_in_notebook (generic function with 1 method)
function eval_in_notebook(notebook::Pluto.Notebook, expr)
withenv("PLUTO_WORKSPACE_USE_DISTRIBUTED" => "no thanks") do
ws = Pluto.WorkspaceManager.get_workspace(notebook)
fetcher = :(Core.eval($(ws.module_name), $(expr |> QuoteNode)))
Distributed.remotecall_eval(Main, ws.pid, fetcher)
end
end
👀 Reading hidden code
Not used
(because it can't export to CSV)
👀 Reading hidden code
struct PointsOutOf
value
max_value
end
👀 Reading hidden code
+ (generic function with 219 methods)
👀 Reading hidden code
👀 Reading hidden code