Skip to content

Commit

Permalink
puts captions and subcaptions from perspective of instructor when in …
Browse files Browse the repository at this point in the history
…instructor mode
  • Loading branch information
russell-rozenbaum committed Dec 21, 2024
1 parent 4a24b21 commit e4626cd
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 26 deletions.
33 changes: 18 additions & 15 deletions src/haz3lweb/exercises/Grading.re
Original file line number Diff line number Diff line change
Expand Up @@ -655,24 +655,25 @@ module MutationTestingReport = {

let view =
(
~globals,
~globals: Globals.t,
~editing_mut_test_rep,
~inject_editing_mut_test_rep,
~inject_update_mut_test_rep,
~select_textbox,
report: t,
max_points: int,
) =>
) => {
let subcaption =
globals.settings.instructor_mode
? ": Student Tests vs. Mutant Implementations"
: ": Your Tests vs. Mutant Implementations (hidden)";
if (max_points < 0) {
Node.div([]);
} else {
CellCommon.panel(
~classes=["test-panel"],
[
CellCommon.caption(
"Mutation Testing",
~rest=": Your Tests vs. Buggy Implementations (hidden)",
),
CellCommon.caption("Mutation Testing", ~rest=subcaption),
individual_reports(
report.results,
~editing_mut_test_rep,
Expand All @@ -694,6 +695,7 @@ module MutationTestingReport = {
),
);
};
};
};

module SyntaxReport = {
Expand Down Expand Up @@ -802,14 +804,14 @@ module SyntaxReport = {
~select_textbox,
syntax_report: t,
) => {
let subcaption =
globals.settings.instructor_mode
? ": Does student's implementation satisfy the syntactic requirements?"
: ": Does your implementation satisfy the syntactic requirements?";
CellCommon.panel(
~classes=["test-panel"],
[
CellCommon.caption(
"Syntax Validation",
~rest=
": Does your implementation satisfy the syntactic requirements?",
),
CellCommon.caption("Syntax Validation", ~rest=subcaption),
individual_reports(
syntax_report.hinted_results,
~editing_syntax_rep,
Expand Down Expand Up @@ -1115,13 +1117,14 @@ module ImplGradingReport = {
~syntax_report: SyntaxReport.t,
~max_points: int,
) => {
let subcaption =
globals.settings.instructor_mode
? ": Hidden Tests vs. Student's Implementation"
: ": Hidden Tests vs. Your Implementation";
CellCommon.panel(
~classes=["test-panel"],
[
CellCommon.caption(
"Implementation Grading",
~rest=": Hidden Tests vs. Your Implementation",
),
CellCommon.caption("Implementation Grading", ~rest=subcaption),
individual_reports(
~signal_jump,
~report,
Expand Down
29 changes: 18 additions & 11 deletions src/haz3lweb/view/ExerciseMode.re
Original file line number Diff line number Diff line change
Expand Up @@ -872,13 +872,17 @@ module View = {
},
);

let your_tests_view =
let your_tests_view = {
let subcaption =
globals.settings.instructor_mode
? ": Student Tests vs. Correct Implementation"
: ": Your Tests vs. Correct Implementation";
Always(
editor_view(
YourTestsValidation,
test_validation,
~caption="Test Validation",
~subcaption=": Your Tests vs. Correct Implementation",
~subcaption,
~result_kind=
Custom(
Grading.TestValidationReport.view(
Expand All @@ -904,6 +908,7 @@ module View = {
),
),
);
};

let wrong_impl_views =
List.mapi(
Expand Down Expand Up @@ -967,13 +972,11 @@ module View = {
);

let your_impl_view = {
let caption =
globals.settings.instructor_mode
? "Student's Implementation" : "Your Implementation";
Always(
editor_view(
YourImpl,
user_impl,
~caption="Your Implementation",
~result_kind=EvalResults,
),
editor_view(YourImpl, user_impl, ~caption, ~result_kind=EvalResults),
);
};

Expand All @@ -991,17 +994,21 @@ module View = {
),
);

let impl_validation_view =
let impl_validation_view = {
let subcaption =
globals.settings.instructor_mode
? ": Student's Tests vs. Student's Implementation"
: ": Your Tests (code synchronized with Test Validation cell above) vs. Your Implementation";
Always(
editor_view(
YourTestsTesting,
user_tests,
~caption="Implementation Validation",
~subcaption=
": Your Tests (code synchronized with Test Validation cell above) vs. Your Implementation",
~subcaption,
~result_kind=TestResults,
),
);
};

let hidden_tests_view =
InstructorOnly(
Expand Down

0 comments on commit e4626cd

Please sign in to comment.