Skip to content

Commit

Permalink
Changed implementation of provided tests so that it detects how many …
Browse files Browse the repository at this point in the history
…tests were written instead of having to type it
  • Loading branch information
facundoy committed Nov 11, 2024
1 parent ae33a8b commit a09ceb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
29 changes: 5 additions & 24 deletions src/haz3lweb/Grading.re
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ module TestValidationReport = {
report: t,
max_points: int,
max_tests: int,
prov_tests: int,
settings: Settings.t,
) => {
Cell.report_footer_view([
Expand Down Expand Up @@ -103,21 +102,6 @@ module TestValidationReport = {
),
],
),
div(
~attrs=[Attr.class_("input-field")],
[
label([text("Tests provided:")]),
input(
~attrs=[
Attr.type_("number"),
Attr.class_("point-num-input"),
Attr.id("test-provided-input"),
Attr.value(string_of_int(prov_tests)),
],
(),
),
],
),
div(
~attrs=[Attr.class_("edit-icon")],
[
Expand All @@ -139,21 +123,18 @@ module TestValidationReport = {
),
)##.value;
let new_prov_test =
Obj.magic(
Js_of_ocaml.Js.some(
JsUtil.get_elem_by_id(
"test-provided-input",
),
),
)##.value;
switch (report.test_results) {
| Some(test_results) => test_results.total
| None => 0
};

let update_events = [
inject(Set(EditingTestValRep)),
inject(
UpdateTestValRep(
int_of_string(new_test_num),
int_of_string(new_dist),
int_of_string(new_prov_test),
new_prov_test,
),
),
];
Expand Down
1 change: 0 additions & 1 deletion src/haz3lweb/view/ExerciseMode.re
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ let view =
grading_report.test_validation_report,
grading_report.point_distribution.test_validation,
eds.your_tests.required,
eds.your_tests.provided,
settings,
),
],
Expand Down

0 comments on commit a09ceb2

Please sign in to comment.