Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
9989097
init
russell-rozenbaum Jun 13, 2024
1c53e11
title-box added
russell-rozenbaum Jun 22, 2024
63ccab7
added ability to change display between div/text-box depending on ins…
russell-rozenbaum Jun 22, 2024
c52269e
added functionality to switch between an edit state and finalized sta…
russell-rozenbaum Jun 24, 2024
52bbf77
added functionality to disable (set to read only) any editors while u…
russell-rozenbaum Jun 24, 2024
bde06c2
added disabling of editing_title when switching between exercise slid…
russell-rozenbaum Jun 24, 2024
80ec611
updating module name as well now
russell-rozenbaum Jun 24, 2024
5edf1c9
added an edit symbol
russell-rozenbaum Jun 24, 2024
294f669
updated UI with pencil icon wobble and positioning
russell-rozenbaum Jun 25, 2024
968fe1c
fixed bug with resetting code in editors; fixed bug with not saving w…
russell-rozenbaum Jun 26, 2024
6ffc5cf
added UI for creating and deleting buggy implementations (the buttons…
russell-rozenbaum Jun 27, 2024
a1e82bf
added functionality for creating and deleting buggy implementations; …
russell-rozenbaum Jun 27, 2024
7ea356a
added functionality for creating and deleting buggy implementations; …
russell-rozenbaum Jul 10, 2024
69fea7f
fixed bug with refreshing page while editing title causes code editor…
russell-rozenbaum Jul 23, 2024
45c783a
replaced local storage key system with Uuidm.t types rather than (key…
russell-rozenbaum Aug 3, 2024
fbd81a0
Mutant Add Delete and Title Editor (#1352)
russell-rozenbaum Aug 3, 2024
8374866
changed some string displays for mutation testing; still need to save…
russell-rozenbaum Aug 3, 2024
a2494c9
changed some string displays for mutation testing; still need to save…
russell-rozenbaum Aug 3, 2024
0ab1240
changed some string displays for mutation testing; still need to save…
russell-rozenbaum Aug 3, 2024
4c56ad5
Init
facundoy Aug 5, 2024
30c1035
fixed bugs with some editors not being disabled when editing title
russell-rozenbaum Aug 5, 2024
0488b01
Added a prompt_action type and added a placeholder for UpdatePrompt i…
facundoy Aug 5, 2024
e892a55
Changed implementation of narrative_cell
facundoy Aug 5, 2024
ebdaefb
reverted changes to exclusively title-editor w/ bugs resolved
russell-rozenbaum Aug 6, 2024
b487d0f
Merge branch 'dev' into title-editor
russell-rozenbaum Aug 6, 2024
612009a
merging to use UUIDs and title-editing properties
russell-rozenbaum Aug 7, 2024
73d7a5e
CHanged implementation of how prompt cell is viewed
facundoy Aug 11, 2024
a576e7a
Added functionality to toggle between edit and finalized state
facundoy Aug 11, 2024
b0a6a1c
Style fix
facundoy Aug 11, 2024
1a5e7a4
Changed type of prompt to string
facundoy Aug 17, 2024
b76d628
Changed implementation of prompt_view so that it changed string to ma…
facundoy Aug 17, 2024
887fa6c
resolved merge conflicts with dev
russell-rozenbaum Aug 17, 2024
229b969
fixed build failure
russell-rozenbaum Aug 17, 2024
d31a338
build and runs locally
russell-rozenbaum Aug 17, 2024
ac146e5
merge conflicts resolved; css still outdated
russell-rozenbaum Aug 17, 2024
f630de6
css updated
russell-rozenbaum Aug 17, 2024
e272d4f
Merge remote-tracking branch 'origin/mutant-add-delete' into title-ed…
russell-rozenbaum Aug 18, 2024
8da0866
Solved a bug where editing mode persisted when changing between exerc…
facundoy Aug 25, 2024
0d75c71
Added an edit button
facundoy Aug 25, 2024
757ef6b
Implemented initial animation for edit button
facundoy Aug 25, 2024
6a040f5
Added more icons and initial attempts to solve saving issues
facundoy Aug 26, 2024
52b5342
Changes done are now saved during page refreshes
facundoy Aug 27, 2024
93056b4
Increased size of textbox
facundoy Aug 30, 2024
bc305e6
Fixed a bug where the prompt would not display correctly after editin…
facundoy Aug 30, 2024
1c92865
Improved icons animations and code display, and improved code to allo…
facundoy Aug 30, 2024
7398692
Deleted print_endline statements
facundoy Aug 30, 2024
431da05
Style changes
facundoy Aug 30, 2024
de89550
Changed files to solve conflicts with dev
facundoy Sep 16, 2024
5adc764
Updated local dependencies and fixed conflict in Diag.re
facundoy Sep 16, 2024
8a05827
Added relevant update actions
facundoy Sep 22, 2024
bb11475
Added functionality to toggle between editing and finalized states
facundoy Sep 22, 2024
c44374d
Adding code that got deleted during the merge
facundoy Sep 22, 2024
bf68618
Adding code that got deleted during the merge
facundoy Sep 22, 2024
49d91b4
Solved bug where editing mode persisted between exercises
facundoy Sep 22, 2024
a938192
PersistentState type made into record field, now also storing hidden …
russell-rozenbaum Sep 27, 2024
5514fc5
Implemented the storing/exporting of new changes
facundoy Sep 28, 2024
824969a
Changed actions from edited data to edited section
facundoy Sep 28, 2024
ddd2b87
Implemented text-box and icons for editing the test validation report…
facundoy Sep 29, 2024
869917f
Implemented editable 'provided tests' in the Test Validation Report
facundoy Oct 6, 2024
746a54b
Fixed a bug where the pencil icon appeared outside of instructor mode
facundoy Oct 6, 2024
e47f631
Implemented editable point distribution for the Mutation Testing Report
facundoy Oct 6, 2024
1b89fd3
commiting before merge with dev
russell-rozenbaum Oct 11, 2024
fa62a34
fixed bugs with deleting last/first editors
russell-rozenbaum Oct 14, 2024
c762c91
style changes
facundoy Oct 20, 2024
d26947c
Added relevant update actions and implemented the storing/exporting o…
facundoy Oct 27, 2024
84849fb
Implemented the UI for the module_name and the textbox for the editing
facundoy Oct 27, 2024
89a360e
Merge branch 'description-editor' into test-editor
facundoy Nov 9, 2024
34bede5
Changes to solve merge conflicts
facundoy Nov 9, 2024
45e6143
Solved a conflict I missed
facundoy Nov 9, 2024
c1f984d
Fixed a spelling error
facundoy Nov 9, 2024
ae33a8b
Style changes to the module name cell
facundoy Nov 9, 2024
a09ceb2
Changed implementation of provided tests so that it detects how many …
facundoy Nov 11, 2024
4dae0f6
Prevented caret scrolling (through switch in main.apply function) whe…
russell-rozenbaum Nov 17, 2024
81e0286
fixed problems with attempting to place caret on recently deleted editor
russell-rozenbaum Nov 17, 2024
02f21d4
Provided number of tests for test validation changes based on the num…
facundoy Nov 24, 2024
95a7593
Fixed caret scrolling following title-editor branch changes
facundoy Nov 25, 2024
0b040a5
Prevented caret scrolling for all editing modes and prevented caret s…
facundoy Nov 25, 2024
9e7900d
Fixed problems with attempting to place caret on recently deleted edi…
facundoy Nov 25, 2024
b5fe793
Fixed bug where the number of provided tests only updated after the n…
facundoy Nov 29, 2024
038908e
Cleaned up code by eliminating old changes
facundoy Nov 29, 2024
648612a
Fixed merging conflicts
facundoy Dec 1, 2024
ceb3088
Fixed merging conflicts
facundoy Dec 2, 2024
5dd2f0f
Correctly merged dev-branch Main with PR Main
facundoy Dec 2, 2024
c2ab67e
added placeholders for title, module name, and prompt. Should be usef…
russell-rozenbaum Dec 9, 2024
2266895
added placeholders for title, module name, and prompt. Should be usef…
russell-rozenbaum Dec 9, 2024
5092383
changed the placeholders to more common placeholder names
russell-rozenbaum Dec 10, 2024
ec164a3
Merge branch 'dev' into title-editor-2
Negabinary Dec 17, 2024
cb07cf6
Fix focus
Negabinary Dec 17, 2024
5819ee8
Fix exception when adding buggy implementaiton
Negabinary Dec 17, 2024
d5a25ac
Fix styling
Negabinary Dec 18, 2024
0e7f3cf
Fix List.nth failures
Negabinary Dec 18, 2024
3b82603
Add back missing editable fields
Negabinary Dec 18, 2024
cd7b39f
Fixed a bug where double line breaks in the markdown translation was …
facundoy Dec 15, 2024
ccdd04d
Fixed styling issues
facundoy Dec 15, 2024
47a69c3
added default 'unnamed exercise module' for exercise modules that are…
russell-rozenbaum Dec 18, 2024
c571a82
fix indexing out of bounds bug when switching exercises
russell-rozenbaum Dec 20, 2024
ad783c5
added ability to edit mutation hints
russell-rozenbaum Dec 20, 2024
2298c78
adds ability to edit implementation grading hints
russell-rozenbaum Dec 20, 2024
385da45
adds safeguards to prevent negative point distributions, maybe too ma…
russell-rozenbaum Dec 20, 2024
b767108
fixes bug with not disabling code editors when editing prompt
russell-rozenbaum Dec 20, 2024
6b082cd
fixes confirm/cancel display bugs on some test panels. Also adds safe…
russell-rozenbaum Dec 20, 2024
aced072
fixes bug in impl grading test panel of displaying new point max rath…
russell-rozenbaum Dec 20, 2024
976f67e
changes default hint to be capitalized
russell-rozenbaum Dec 20, 2024
dec734e
fixed bug with exercise indexing
russell-rozenbaum Dec 21, 2024
c19228b
fixes .ml export prompt bug; added blank exercise spec
russell-rozenbaum Dec 21, 2024
4a24b21
fixes double hole bug in BlankExercise.ml
russell-rozenbaum Dec 21, 2024
e4626cd
puts captions and subcaptions from perspective of instructor when in …
russell-rozenbaum Dec 21, 2024
7912ff8
Merge branch 'dev' into title-editor-2
cyrus- Feb 15, 2025
8072c5b
Eliminated bold font for prompt and changed 'new points max' to 'points'
facundoy Feb 23, 2025
263040a
Fixed padding for module-name and prompt to reduce empty space, instr…
facundoy Feb 23, 2025
cfd27ea
Solved merge conflicts
facundoy Apr 20, 2025
39bd39f
Deleted unused variable
facundoy Apr 20, 2025
f7699d4
Deleted unused module
facundoy Apr 20, 2025
283e54b
Add type annotation to handle_key_event function in ExerciseMode
7h3kk1d Apr 21, 2025
bc53f9f
Refmt
7h3kk1d Apr 21, 2025
a83fab2
allows for copy/cut/paste in exercise mode input fields
russell-rozenbaum Apr 23, 2025
babb7c6
fixes bug where refreshing page while cursor not placed in an edtior …
russell-rozenbaum Apr 23, 2025
0f6b435
Merge branch 'dev' into title-editor-2
cyrus- May 12, 2025
af0f4ef
Merge remote-tracking branch 'origin/dev' into clean-copy-paste
russell-rozenbaum Jun 9, 2025
71c5dd7
resolved merge conflict (I think? I did not change much)
russell-rozenbaum Jun 9, 2025
e34bbcd
few minor css changes
russell-rozenbaum Jun 9, 2025
cdaba5e
Merge title-editor-2 into clean-copy-paste
russell-rozenbaum Jun 9, 2025
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
7 changes: 1 addition & 6 deletions src/haz3lweb/Export.re
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ let import_all = (~import_log: string => unit, data, ~specs) => {
ExplainThisModel.Store.import(all.explainThisModel);
let instructor_mode = settings.instructor_mode;
ScratchMode.Store.import(all.scratch);
ExercisesMode.Store.import(
~settings=settings.core,
all.exercise,
~specs,
~instructor_mode,
);
ExercisesMode.Store.import(all.exercise, ~specs, ~instructor_mode);
import_log(all.log);
};

Expand Down
2 changes: 1 addition & 1 deletion src/haz3lweb/Settings.re
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module Model = {
},
async_evaluation: false,
context_inspector: false,
instructor_mode: true,
instructor_mode: false,
benchmark: false,
explainThis: {
show: true,
Expand Down
4 changes: 2 additions & 2 deletions src/haz3lweb/Store.re
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type key =
| Scratch
| Documentation
| CurrentExercise
| Exercise(Exercise.key);
| Exercise(Haz3lcore.Id.t);

let key_to_string =
fun
Expand All @@ -19,7 +19,7 @@ let key_to_string =
| Scratch => "SAVE_SCRATCH"
| Documentation => "SAVE_DOCUMENTATION"
| CurrentExercise => "CUR_EXERCISE"
| Exercise(key) => key |> Exercise.sexp_of_key |> Sexplib.Sexp.to_string;
| Exercise(id) => Haz3lcore.Id.to_string(id);

module F =
(
Expand Down
113 changes: 79 additions & 34 deletions src/haz3lweb/app/Page.re
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,21 @@ module Selection = {
};

module View = {
let is_input_field = (elId: option(string)) => {
switch (elId) {
| Some("title-input-box")
| Some("module-name-input")
| Some("prompt-input-box")
| Some("test-required-input")
| Some("point-max-input") => true
| Some(id) when String.starts_with(~prefix="hint-input", id) => true
| Some(id) when String.starts_with(~prefix="syntax-hint-input", id) =>
true
| Some(id) when String.starts_with(~prefix="impl-hint-input", id) => true
| _ => false
};
};

let handlers =
(
~inject: Update.t => Ui_effect.t(unit),
Expand Down Expand Up @@ -380,47 +395,77 @@ module View = {
JsUtil.focus_clipboard_shim();
Effect.Ignore;
}),
Attr.on_copy(_ => {
let str = (cursor.selected_text |> Option.value(~default=() => ""))();
/* Note that we cannot use the ClipboardCache system here unless
* we refine it further to replace unique ids on paste */
Haz3lcore.ClipboardCache.set(cursor.selection, str);
JsUtil.copy(str);
Attr.on_copy(evt => {
let target = Js.Opt.to_option(evt##.target);
switch (target) {
| Some(el) =>
let elId = Js.Opt.to_option(Js.Unsafe.coerce(el)##.id);
if (is_input_field(elId)) {
();
} else {
let str =
(cursor.selected_text |> Option.value(~default=() => ""))();
/* Note that we cannot use the ClipboardCache system here unless
* we refine it further to replace unique ids on paste */
Haz3lcore.ClipboardCache.set(cursor.selection, str);
JsUtil.copy(str);
};
| None => ()
};
Effect.Ignore;
}),
Attr.on_cut(_ => {
let str = (cursor.selected_text |> Option.value(~default=() => ""))();
Haz3lcore.ClipboardCache.set(cursor.selection, str);
JsUtil.copy(str);
Option.map(
inject,
Selection.handle_key_event(
~selection=Some(model.selection),
~event=
Key.{
key: D("Delete"),
sys: Os.is_mac^ ? Mac : PC,
shift: Up,
meta: Up,
ctrl: Up,
alt: Up,
},
model,
),
)
|> Option.value(~default=Effect.Ignore);
Attr.on_cut(evt => {
let target = Js.Opt.to_option(evt##.target);
switch (target) {
| Some(el) =>
let elId = Js.Opt.to_option(Js.Unsafe.coerce(el)##.id);
if (is_input_field(elId)) {
Effect.Ignore;
} else {
JsUtil.copy(
(cursor.selected_text |> Option.value(~default=() => ""))(),
);
Option.map(
inject,
Selection.handle_key_event(
~selection=Some(model.selection),
~event=
Key.{
key: D("Delete"),
sys: Os.is_mac^ ? Mac : PC,
shift: Up,
meta: Up,
ctrl: Up,
alt: Up,
},
model,
),
)
|> Option.value(~default=Effect.Ignore);
};
| None => Effect.Ignore
};
}),
]
@ [
Attr.on_paste(evt => {
Dom.preventDefault(evt);
let action =
Js.to_string(evt##.clipboardData##getData(Js.string("text")))
|> Haz3lcore.ClipboardCache.get
|> cursor.editor_action;
switch (action) {
let target = Js.Opt.to_option(evt##.target);
switch (target) {
| Some(el) =>
let elId = Js.Opt.to_option(Js.Unsafe.coerce(el)##.id);
if (is_input_field(elId)) {
Effect.Ignore;
} else {
let pasted_text =
Js.to_string(evt##.clipboardData##getData(Js.string("text")))
|> Str.global_replace(Str.regexp("\n[ ]*"), "\n");
Dom.preventDefault(evt);
switch (cursor.editor_action(Paste(String(pasted_text)))) {
| None => Effect.Ignore
| Some(action) => inject(Editors(action))
};
};
| None => Effect.Ignore
| Some(action) => inject(Editors(action))
};
}),
];
Expand Down
45 changes: 45 additions & 0 deletions src/haz3lweb/app/common/Icons.re
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,30 @@ let backpack =
],
);

let pencil =
simple_icon(
~view="0 0 512 512",
[
"M403.914,0L54.044,349.871L0,512l162.128-54.044L512,108.086L403.914,0z M295.829,151.319l21.617,21.617L110.638,379.745 l-21.617-21.617L295.829,151.319z M71.532,455.932l-15.463-15.463l18.015-54.043l51.491,51.491L71.532,455.932z M153.871,422.979 l-21.617-21.617l206.809-206.809l21.617,21.617L153.871,422.979z M382.297,194.555l-64.852-64.852l21.617-21.617l64.852,64.852 L382.297,194.555z M360.679,86.468l43.234-43.235l64.853,64.853l-43.235,43.234L360.679,86.468z",
],
);

let confirm =
simple_icon(
~view="0 0 32 32",
[
"m16 0c8.836556 0 16 7.163444 16 16s-7.163444 16-16 16-16-7.163444-16-16 7.163444-16 16-16zm0 2c-7.7319865 0-14 6.2680135-14 14s6.2680135 14 14 14 14-6.2680135 14-14-6.2680135-14-14-14zm6.6208153 9.8786797c.3905243.3905242.3905243 1.0236892 0 1.4142135l-7.0710678 7.0710678c-.3626297.3626297-.9344751.3885319-1.3269928.0777064l-.0872208-.0777064-4.24264068-4.2426407c-.39052429-.3905242-.39052429-1.0236892 0-1.4142135.39052428-.3905243 1.02368928-.3905243 1.41421358 0l3.5348268 3.5348268 6.3646681-6.3632539c.3905243-.3905243 1.0236893-.3905243 1.4142136 0z",
],
);

let cancel =
simple_icon(
~view="0 0 32 32",
[
"m16 0c8.836556 0 16 7.163444 16 16s-7.163444 16-16 16-16-7.163444-16-16 7.163444-16 16-16zm0 2c-7.7319865 0-14 6.2680135-14 14s6.2680135 14 14 14 14-6.2680135 14-14-6.2680135-14-14-14zm4.2426407 9.7573593c.3905243.3905243.3905243 1.0236893 0 1.4142136l-2.8284271 2.8284271 2.8284271 2.8284271c.3905243.3905243.3905243 1.0236893 0 1.4142136s-1.0236893.3905243-1.4142136 0l-2.8284271-2.8284271-2.8284271 2.8284271c-.3905243.3905243-1.0236893.3905243-1.4142136 0s-.3905243-1.0236893 0-1.4142136l2.8284271-2.8284271-2.8284271-2.8284271c-.3905243-.3905243-.3905243-1.0236893 0-1.4142136s1.0236893-.3905243 1.4142136 0l2.8284271 2.8284271 2.8284271-2.8284271c.3905243-.3905243 1.0236893-.3905243 1.4142136 0z",
],
);

let command_palette_sparkle =
simple_icon(
~view="400 400 400 400",
Expand All @@ -231,3 +255,24 @@ let command_palette_sparkle =
"m554.76 426.6c6.5195-23.285 24.715-41.48 48-48-23.297-6.5-41.5-24.707-48-48-6.5 23.293-24.707 41.5-48 48 23.281 6.5195 41.477 24.715 48 48z",
],
);

let add =
simple_icon(
~view="0 0 24 24",
[
"M12.75 9C12.75 8.58579 12.4142 8.25 12 8.25C11.5858 8.25 11.25 8.58579 11.25 9L11.25 11.25H9C8.58579 11.25 8.25 11.5858 8.25 12C8.25 12.4142 8.58579 12.75 9 12.75H11.25V15C11.25 15.4142 11.5858 15.75 12 15.75C12.4142 15.75 12.75 15.4142 12.75 15L12.75 12.75H15C15.4142 12.75 15.75 12.4142 15.75 12C15.75 11.5858 15.4142 11.25 15 11.25H12.75V9Z",
"M12 1.25C6.06294 1.25 1.25 6.06294 1.25 12C1.25 17.9371 6.06294 22.75 12 22.75C17.9371 22.75 22.75 17.9371 22.75 12C22.75 6.06294 17.9371 1.25 12 1.25ZM2.75 12C2.75 6.89137 6.89137 2.75 12 2.75C17.1086 2.75 21.25 6.89137 21.25 12C21.25 17.1086 17.1086 21.25 12 21.25C6.89137 21.25 2.75 17.1086 2.75 12Z",
],
);

let delete =
simple_icon(
~view="0 0 24 24",
[
"M12 2.75C11.0215 2.75 10.1871 3.37503 9.87787 4.24993C9.73983 4.64047 9.31134 4.84517 8.9208 4.70713C8.53026 4.56909 8.32557 4.1406 8.46361 3.75007C8.97804 2.29459 10.3661 1.25 12 1.25C13.634 1.25 15.022 2.29459 15.5365 3.75007C15.6745 4.1406 15.4698 4.56909 15.0793 4.70713C14.6887 4.84517 14.2602 4.64047 14.1222 4.24993C13.813 3.37503 12.9785 2.75 12 2.75Z",
"M2.75 6C2.75 5.58579 3.08579 5.25 3.5 5.25H20.5001C20.9143 5.25 21.2501 5.58579 21.2501 6C21.2501 6.41421 20.9143 6.75 20.5001 6.75H3.5C3.08579 6.75 2.75 6.41421 2.75 6Z",
"M5.91508 8.45011C5.88753 8.03681 5.53015 7.72411 5.11686 7.75166C4.70356 7.77921 4.39085 8.13659 4.41841 8.54989L4.88186 15.5016C4.96735 16.7844 5.03641 17.8205 5.19838 18.6336C5.36678 19.4789 5.6532 20.185 6.2448 20.7384C6.83639 21.2919 7.55994 21.5307 8.41459 21.6425C9.23663 21.75 10.2751 21.75 11.5607 21.75H12.4395C13.7251 21.75 14.7635 21.75 15.5856 21.6425C16.4402 21.5307 17.1638 21.2919 17.7554 20.7384C18.347 20.185 18.6334 19.4789 18.8018 18.6336C18.9637 17.8205 19.0328 16.7844 19.1183 15.5016L19.5818 8.54989C19.6093 8.13659 19.2966 7.77921 18.8833 7.75166C18.47 7.72411 18.1126 8.03681 18.0851 8.45011L17.6251 15.3492C17.5353 16.6971 17.4712 17.6349 17.3307 18.3405C17.1943 19.025 17.004 19.3873 16.7306 19.6431C16.4572 19.8988 16.083 20.0647 15.391 20.1552C14.6776 20.2485 13.7376 20.25 12.3868 20.25H11.6134C10.2626 20.25 9.32255 20.2485 8.60915 20.1552C7.91715 20.0647 7.54299 19.8988 7.26957 19.6431C6.99616 19.3873 6.80583 19.025 6.66948 18.3405C6.52891 17.6349 6.46488 16.6971 6.37503 15.3492L5.91508 8.45011Z",
"M9.42546 10.2537C9.83762 10.2125 10.2051 10.5132 10.2464 10.9254L10.7464 15.9254C10.7876 16.3375 10.4869 16.7051 10.0747 16.7463C9.66256 16.7875 9.29502 16.4868 9.25381 16.0746L8.75381 11.0746C8.71259 10.6625 9.0133 10.2949 9.42546 10.2537Z",
"M15.2464 11.0746C15.2876 10.6625 14.9869 10.2949 14.5747 10.2537C14.1626 10.2125 13.795 10.5132 13.7538 10.9254L13.2538 15.9254C13.2126 16.3375 13.5133 16.7051 13.9255 16.7463C14.3376 16.7875 14.7051 16.4868 14.7464 16.0746L15.2464 11.0746Z",
],
);
5 changes: 2 additions & 3 deletions src/haz3lweb/app/editors/Editors.re
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Store = {
| Exercises =>
Model.Exercises(
ExercisesMode.Store.load(~settings, ~instructor_mode)
|> ExercisesMode.Model.unpersist(~settings, ~instructor_mode),
|> ExercisesMode.Model.unpersist(~instructor_mode),
)
};
};
Expand Down Expand Up @@ -143,7 +143,6 @@ module Update = {
~instructor_mode=globals.settings.instructor_mode,
)
|> ExercisesMode.Model.unpersist(
~settings=globals.settings.core,
~instructor_mode=globals.settings.instructor_mode,
),
)
Expand Down Expand Up @@ -245,7 +244,7 @@ module Selection = {
fun
| Model.Scratch(_) => Scratch(MainEditor)
| Model.Documentation(_) => Scratch(MainEditor)
| Model.Exercises(_) => Exercises((Exercise.Prelude, MainEditor));
| Model.Exercises(_) => Exercises(Cell(Exercise.Prelude, MainEditor));
};

module View = {
Expand Down
26 changes: 26 additions & 0 deletions src/haz3lweb/app/editors/cell/CellCommon.re
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,29 @@ let title_cell = title => {
),
]);
};

let wrong_impl_caption = (~inject_delete, sub: string, n: int) => {
div(
~attrs=[Attr.class_("wrong-impl-cell-caption")],
[
caption("", ~rest=sub),
div(
~attrs=[
Attr.class_("instructor-edit-icon"),
Attr.on_mousedown(_ =>
Virtual_dom.Vdom.Effect.(
Many([Prevent_default, Stop_propagation])
)
),
],
[
Widgets.button(
Icons.delete,
_ => inject_delete(n),
~tooltip="Delete Buggy Implementation",
),
],
),
],
);
};
Loading
Loading