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
Suggest "food for thought" prompts on submissions #3427
Conversation
Taken gratefully from https://cpratt.co/twitter-bootstrap-callout-css-styles/ who took it from the Bootstrap docuentation.
The location of the food for thought may be unnoticed depending on the size of the solution and what is included. At the moment, once the code is read, or once your comment text area is hit, it seems like the need to scroll further down would be unnecessary. The presentation should probably be directly above the "new comment" area, rather than to the left where the space is not guaranteed to be viewed. In a text only presentation, I would also expect the suggestions to be above my comment, not positioned near the code, above others comments. |
As I thought about this, the best location of its placement wasn't obvious to me. Above the comment is a reasonable suggestion. My rationale for placing it below the code, is because considering the prompt is the next logical thing to do after reading the code. Reading the prompt is what might inspire you to make a comment, where you otherwise might have nothing to say. With nothing to say, you're not likely to scroll past any existing comments to find the comment box where the prompt is located. When you read the code and do have thoughts to comment on, then when you go to the comment box, the prompt isn't useful—you already have something to say. |
This branch requires support for sample().
Since this optional feature is fully implemented in JS, hide it when JS is disabled, rather than showing something non-functional.
@kytrinyx This is working and is ready for review. |
target.fadeIn fadeDuration | ||
|
||
randomPrompt: -> | ||
_.sample(@prompts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is the only place that underscore is used. I'm going to merge it in, but I'd like to consider whether it's worth replacing this with an implementation using Math.random
@prompts[Math.floor(Math.random() * @prompts.length) + 1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's interesting since the library was already present. I wonder if it was previously used and the code was removed, or if it is a dependency of a dependency. Git blame is probably telling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, interesting. It is not a big deal. For the rewrite I'll be a lot more careful about dependencies.
This looks excellent. I'll get it into production in the next 30 minutes. |
Implement suggestion 1 in exercism/discussions#123 (comment).
Feature flag:
prompts
Todo:
Initial Prompt Questions