Allow learner to specify course goal

Description

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.

Mockups: https://projects.invisionapp.com/share/VYDBCP1NM#/screens/251575055

Acceptance Criteria

  • 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.

Design Proposal

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.
ex:

1 course_goals={'choices':['Earn a certificate', 'Complete the course', 'Explore the course'], 'dismissible_choice':'Not sure yet'}

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)

  • CourseGoal

    • 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

7) Testing

  • Python Unit Tests:

    • User that does not have goal set sees this message.

    • User that does have goal set does not see this message

  • Jasmine test:

    • 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.

    • course_experience.ENABLE_COURSE_GOALS

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Status

Assignee

Harry Rein

Reporter

Andy Armstrong

Labels

None

Reach

None

Impact

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Stakeholders

None

Story Points

5

Components

Sprint

None

Priority

Unset
Configure