File tree 3 files changed +36
-29
lines changed
3 files changed +36
-29
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,8 @@ module Update = {
208
208
let update =
209
209
(~globals: Globals . t , ~schedule_action, action: t , model: Model . t ) => {
210
210
switch (action) {
211
+ | Tutorial (TutorialMode . Update . MoveToNextExercise ) =>
212
+ Model . {current: model. current + 1 , exercises: model. exercises} |> return
211
213
| Tutorial (action ) =>
212
214
let current = List . nth(model. exercises, model. current);
213
215
let * new_current =
Original file line number Diff line number Diff line change @@ -88,26 +88,16 @@ module Update = {
88
88
: Updated . t(Model . t) => {
89
89
let instructor_mode = settings. instructor_mode;
90
90
switch (action) {
91
+ // This MoveToNextExercise is only here so that Tutorial(TutorialMode.Update.MoveToNextExercise)
92
+ // is called in TutorialsMode. This is a dummy update because this function requires Updated(Model.t)
91
93
| MoveToNextExercise =>
92
- let total_exercises = List . length(TutorialSettings . exercises);
93
-
94
- /* Prevent division by zero */
95
- let next_index =
96
- if (total_exercises == 0 ) {
97
- 0 ;
98
- } else {
99
- (model. spec. version + 1 ) mod total_exercises;
100
- };
101
- let updated_spec = {... model.spec, version: next_index};
102
-
103
- /* Return the properly wrapped model */
104
- return(
105
- ~is_edit= true ,
106
- ~recalculate= true , /* Forces UI to refresh */
107
- ~scroll_active= true ,
108
- ~logged= true ,
109
- {... model, spec: updated_spec} /* Update spec with new version */
110
- );
94
+ Updated . return_quiet({
95
+ ... model,
96
+ editors: {
97
+ ... model.editors,
98
+ show_report: model. editors. show_report,
99
+ },
100
+ })
111
101
| Editor (pos , MainEditor (action ))
112
102
when Tutorial . visible_in(pos, ~instructor_mode) =>
113
103
// Redirect to editors
@@ -461,6 +451,14 @@ module View = {
461
451
),
462
452
] ,
463
453
),
454
+ div(
455
+ ~attrs= [ Attr . class_("next-button" )] ,
456
+ [
457
+ Widgets . button(Icons . forward, _ =>
458
+ inject(MoveToNextExercise )
459
+ ),
460
+ ] ,
461
+ ),
464
462
] ,
465
463
);
466
464
} else {
Original file line number Diff line number Diff line change 329
329
330
330
# main .Tutorial .title-cell {
331
331
display : flex;
332
- align-items : flex-start; /* Align to the left */
332
+ align-items : flex-start;
333
+ /* Align to the left */
333
334
justify-content : flex-start;
334
335
width : 100% ;
335
336
padding : 0 !important ;
363
364
margin-bottom : 2em !important ;
364
365
padding : 0 !important ;
365
366
}
367
+
366
368
# main .Tutorial .tutorial-content {
367
369
display : flex;
368
370
flex-direction : column;
369
- gap : 2em ;
371
+ gap : 2em ;
370
372
}
371
373
372
374
/* .cross {
382
384
width : 80px ;
383
385
height : 80px ;
384
386
color : black;
385
- background-color : # 838282 ;;
387
+ background-color : # 838282 ;
388
+ ;
386
389
bor der- radius: 50%;
387
390
dis play: flex;
388
391
justify- content: center;
426
429
}
427
430
428
431
.cross : hover ::after {
429
- opacity : 1 ; /* Show on hover */
432
+ opacity : 1 ;
433
+ /* Show on hover */
430
434
}
431
435
432
436
.cross {
433
- position : relative;
437
+ position : relative;
434
438
}
435
439
436
440
.your-impl-wrapper {
437
- margin-bottom : 1em ; /* or try 1.5em for bigger space */
441
+ margin-bottom : 1em ;
442
+ /* or try 1.5em for bigger space */
438
443
}
439
444
440
445
.hint-with-icon {
441
446
display : flex;
442
447
align-items : center;
443
- gap : 0.4em ; /* space between text and icon */
448
+ gap : 0.4em ;
449
+ /* space between text and icon */
444
450
font-size : 0.9em ;
445
451
color : # 333 ;
446
452
align-content : right;
447
453
/* margin-top: 0.5em; */
448
454
}
449
455
450
456
.highlight-icon svg {
451
- fill : var (--ci-icon-bkg ) !important ;
457
+ fill : var (--ci-icon-bkg ) !important ;
452
458
}
453
459
454
460
/* .highlight-icon {
458
464
} */
459
465
460
466
.hint-content code {
461
- font-size : 0.75em ; /* Smaller font for code blocks */
467
+ font-size : 0.75em ;
468
+ /* Smaller font for code blocks */
462
469
font-family : monospace;
463
470
background-color : # f5f5f5 ;
464
471
padding : 1px 1px ;
465
472
/* border-radius: 3px; */
466
- line-height : 0 ;
473
+ line-height : 0 ;
467
474
}
You can’t perform that action at this time.
0 commit comments