On initial land within a course, above all other messages is a quick goal capture area with the options displayed in the mockup. Verify with the Docs team about the language of the options.
Only display this message if a waffle flag is turned on (create one for this feature)
Show course goal form if the user has yet to specify one
Note: this is only shown to users who are logged in
Only display the goal form if the course has a verified mode. (This isn't shown to professional or professional-no-id.)
Do not show the goal form if the user is already in the verified track.
Make sure the buttons behave responsively
Clicking on the goal should hide the form and persist the learner's choice
Clicking on an "not sure yet" will let the user dismiss the region without specifying a goal
Once an option is selected (including "not sure yet"), dismiss the message. Afterwards, the message will not appear again.
Create an API to interact with this data.
Analytics for learner actions (set goal or dismiss)
This will most likely be a research event with all of the work associated with it.
The only initial configurability will be enabling/disabling.
This is a section used to propose a design for the implementation and help us break down the large story into size-able chunks.
1) DONE: Settings variable in common.py that establishes main goals and dismiss goal.
2) DONE: UI that grabs those goals and sets them into the course message as buttons and a dismiss button.
sent in through register_course_home_messages
Example of html snippet in prototype
3) DONE: Model for a goal (in openedx/core/djangoapps/user_api/models.py)
ForeignKey to User
ForeignKey to Course
CharField for goal?
Create migration for this
4) DONE: Create goal and grab goal API
create_course_goal function in course_home_messages.py
Checks that goal not already set and creates object if not
grab_course_goal function in course_home_messages.py
Returns the goal object, None if not set
Optional: Add a delete_course_goal to make testing easier
Open Question: Do we want to create a new course_goals.py file to hold this functionality, as it may move from the home page to say, the profile.
5) Create goal on button click
Add js to CourseHome.js to dismiss course home message on course goal button click.
Add eventing to this
Open Question: What type of logging do we want
6) Only show user message if none exists
grabs course goal and shows message if not None
Code put in course_home_messages.py
Python Unit Tests:
User that does not have goal set sees this message.
User that does have goal set does not see this message
Logging works as expected
Click of button dismisses message
8) Waffle Flag
Add waffle flag to course_home_message.py to block showing this message unless set.