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

Vignettes #737

Open
wants to merge 40 commits into
base: feature/vignettes-longterm
Choose a base branch
from
Open

Vignettes #737

wants to merge 40 commits into from

Conversation

f-buerckel
Copy link
Collaborator

@f-buerckel f-buerckel commented Jan 25, 2025

Vignettes

This pull request is the first of multiple requests to merge vignettes into mampf. While most major features have been implemented, they still lack quality of life and a usable let alone pretty user interface.


Usage

Note

All created questionnaires are found under .../vignettes/questionnaires/

The edit view of a questionnaire lists all slides (by position) and info slides (by title). One can edit a certain slide by clicking on the link, as well as create slides.

A normal slide is part of the linear progression of the questionnaire and can optionally include a question. Question types include text answers, multiple choice answers and a Likert scale. A slide can reference multiple info slides. To select multiple info slides hold ctrl.

An info slide can be referenced by a slide and contains additional information about the slide. This information can be accessed by a user filling out the questionnaire. Each info slide has an icon used as an image for the button that displays the info slide. If this icon is not set, then the title is used.

Note

To fill out a questionnaire navigate to /vignettes/questionnaire/:id/take

Tip

Each user can only fill out a questionnaire once. However this is annoying for testing purposes. Therefore one can currently delete his answer by navigating to /vignettes/questionnaire/:id/take?position=-1 (this is of course only for testing and will be removed)


Additional Features

Statistics

One major feature of questionnaires is the tracking of additional statistics. For each answer the following stats are tracked:

  • Time spent on the main slide
  • Time spent on each info slide (in json format)
  • Times each info slide was accessed (in json format)
  • Answers given

To access these statistics, one can download them in the edit view of a questionnaire as a .csv file.

Unfinished answers

If a user starts filling out a questionnaire but does not finish, their progress is saved. When they return to the questionnaire, they will resume from their last position. This is also used to check that a user can't "cheat" by just setting the position value in the url (e.g /take?position=4)


Known bugs

  • A video is not properly displayed in the edit view of a slide when accessed again.
  • Error messages are not displayed properly

For reviewers

This feature is limited to very few people for the beginning. Especially the creation of vignettes will be limited to 2 or 3 people. Also the code is for the most part completely disconnected from the codebase. Therefore we may afford some imperfection in the beginning of the release.
Goal for release is the start of the new semester in April 2025.


To-Do's

Essentials

  • Number question type
  • Make position of slide editable
  • UI Elements to delete slides and questionnaires
  • Think of better way of displaying all slides in edit view
  • Make questionnaires part of courses
  • Support for multiple languages
  • Make UI pretty (Support here is of course much appreciated)
  • Limit feature to create Questionnaire to certain users
  • Proper error messages

Nice to have

  • Tests
  • Make a chain of questionnaires (so user can only access one questionnaire after the previous was completed)
  • Add feature to scale images in trix editor
  • Replace trix editor with more powerful

Signed-off-by: Florian <[email protected]>
Signed-off-by: Florian <[email protected]>
Signed-off-by: Florian <[email protected]>
answer model for single answer to slide of questionnaire,

user_answer model to store all answers made by a user on a specific
questionnaire.
-Track how often each info slide was accessed

-minor bug fixes
-display error message if form submitting is unsuccessful
-validate content type

-fix weird bug with migration date

-change config to format error messages differently
-remove git accidents
Copy link
Member

@Splines Splines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Could you please provide an ERD diagram in order to better understand what is going on? See the wiki.
  • Please make sure that linting works correctly, otherwise reviewing is a nightmare as I don't want to write comments like: "Remove the whitespaces here after the semicolon". You can use the VSCode "Problems" tab to see all occurrences where ESLint or Rubocop are complaining.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's normal to add columns, rename them, later realize that a column would better fit in another table etc. during the development process. But at the end, we should just have as little migrations as possible. E.g. when you remove a column later on, we don't need a migration to add, then remove it, when we merge this PR. Please identify such things and manually condense them, such that most migrations will just create new tables/columns/indices or modify already existing columns, but not those that are only temporarily created on this branch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also useful in the case we need to revert migrations, since smaller migrations make very clear what was added (instead of added, removed, added again ...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully agree, commit a9726f1 should remove all unnecessary migrations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of ERB syntax going on in this file. This would probably be a good fit to outsource some of the logic to helper classes where Ruby is first-class citizen. With this, we reduce the "business code logic" from the html file.

This comment is also applicable to other of your .html.erb files.

@Splines Splines requested review from a team and removed request for fosterfarrell9 February 1, 2025 14:04
@f-buerckel f-buerckel changed the base branch from vignettes to feature/vignettes-longterm February 4, 2025 10:20
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.

2 participants