Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Title Editor, Exercise Keying with UUID, Mutant Editing, and New Persistent State Type #1316

Open
wants to merge 32 commits into
base: dev
Choose a base branch
from

Conversation

russell-rozenbaum
Copy link

@russell-rozenbaum russell-rozenbaum commented Jun 24, 2024

Goal
Implement the ability to make changes to the exercise title while in instructor mode. These changes should persist through page refreshes, switching between exercise slides, and in exercise exports.

Convert exercise mode's local storage keying system from (string, int) pairs to Uuidm types

Implementation Strategy

  1. Edit the title cell through which the title is currently rendered, giving it three different states to be in – student mode, instructor mode/editing, instructor mode/not editing
  2. Add update actions "UpdateTitle" which contains the string value to update the title with
  3. Add a UI pencil icon to give user ability to edit title string
  4. Add UI check and x icons for user to confirm or cancel title changes, respectively

Added Features

  1. Title box has a pencil next to it which user can click when in instructor mode to begin editing title
  2. User can then either click confirm or cancel icons to save or delete changes to title, respectively
  3. Saved title gets saved to the exercise state, leaving spec unmodified
  4. New titles are saved and loaded from local storage on page refresh and exported in exercise module exports
  5. Exercise's storage keying system now uses UUIDs rather than (string, int) pairs. *Note: this change removes the previous version field, represented by the int in the pair of the old keying system
  6. Made a mutant editing suite where instructors can add, delete, and edit mutants
  7. persistent_state type in exercise mode has been made into a record. Along with the zipper position and editors it stores the title and list of mutants. This allows for mutants to be persisted and unpersisted upon saving and loading to and form local storage.

Potential Pitfalls

  • Exercise modules must have a hardcoded UUID in their spec file to save and load properly. A potential solution can be to initialize a UUID and update the spec when first loading. This would require mutating the spec file however.
  • Future implementations requiring saving and loading mutable features to and from storage will need to be added in the record and persisted/unpersisted properly in their respective functions

…ser is editing title, also automated swapping between focus on title-box/editors
…es, this also solves issue of text-box with incorrect value persisting across exercise slides when switching while editing
…hen switching between exercise slides; added confirm and cancel edit buttons for finalizing title updates (or cancelling them), this also fixes a bug with pressing enter to confirm where it would also press enter in the respective code editor where the cursor was located
…to-do: allow editing of implementation hints as they default to "no hint available"
@cyrus-
Copy link
Member

cyrus- commented Jun 28, 2024

@russell-rozenbaum did you intend to close this issue?

@russell-rozenbaum
Copy link
Author

I've added more changes beyond just the title editor to this branch, to be exact I added some implementations to adding and deleting buggy implementations, so I wasn't sure whether to move those commits to a different branch or finish them out fully before opening this pull request

@russell-rozenbaum
Copy link
Author

Commit [968fe1c] is the one I'd like to merge. The last 2 commits add the ability to add/delete buggy implementations, which I'll start on another branch. The problem with the current version is a bug that occurs when adding a wrong implementation (which is itself an editor) and then I believe the program does not know where to put the cursor on page reload since the editors are reset (the one previously added, now deleted on page reload), and results in an infinite loading screen. Besides this, I still want to add the ability to edit the hints associated with buggy implementations, which right now defaults to "no hint available".

@cyrus- cyrus- marked this pull request as draft July 9, 2024 14:44
@cyrus- cyrus- linked an issue Jul 9, 2024 that may be closed by this pull request
…to-do: allow editing of implementation hints as they default to "no hint available
@russell-rozenbaum russell-rozenbaum changed the title Title Editor Title and Mutation Suite Editing Aug 3, 2024
@russell-rozenbaum russell-rozenbaum changed the title Title and Mutation Suite Editing Title Editor Aug 6, 2024
@russell-rozenbaum russell-rozenbaum changed the title Title Editor Title Editor and Exercise Keying with UUID Aug 6, 2024
@russell-rozenbaum russell-rozenbaum marked this pull request as ready for review August 6, 2024 15:49
@cyrus-
Copy link
Member

cyrus- commented Aug 9, 2024

@russell-rozenbaum there are some merge conflicts and a build failure here

@cyrus- cyrus- marked this pull request as draft August 9, 2024 00:04
@russell-rozenbaum russell-rozenbaum marked this pull request as ready for review August 17, 2024 19:31
@russell-rozenbaum russell-rozenbaum force-pushed the title-editor branch 3 times, most recently from bdfe77b to 229b969 Compare August 17, 2024 21:31
@russell-rozenbaum russell-rozenbaum marked this pull request as draft August 17, 2024 21:58
@russell-rozenbaum russell-rozenbaum marked this pull request as ready for review August 18, 2024 00:27
…bugs; persistent_state_of_state and unpersist_state updated to now save and load to and from local memory respectively
@russell-rozenbaum russell-rozenbaum changed the title Title Editor and Exercise Keying with UUID Title Editor, Exercise Keying with UUID, Mutant Editing, and new Persistent State Type Sep 27, 2024
@russell-rozenbaum russell-rozenbaum changed the title Title Editor, Exercise Keying with UUID, Mutant Editing, and new Persistent State Type Title Editor, Exercise Keying with UUID, Mutant Editing, and New Persistent State Type Sep 27, 2024
@russell-rozenbaum russell-rozenbaum changed the title Title Editor, Exercise Keying with UUID, Mutant Editing, and New Persistent State Type Title Editor and Exercise Keying with UUID Sep 27, 2024
@russell-rozenbaum russell-rozenbaum changed the title Title Editor and Exercise Keying with UUID Title Editor, Exercise Keying with UUID, Mutant Editing, and New Persistent State Type Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to edit exercise title
2 participants