From 21e85fe90045a09e15f70e19886084a486df90f0 Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Mon, 21 Aug 2017 01:58:36 +0530 Subject: [PATCH 1/8] Only show feedback threads opened by the learner. --- core/domain/feedback_services.py | 113 +++++++++--------- .../learner_dashboard/LearnerDashboard.js | 2 +- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/core/domain/feedback_services.py b/core/domain/feedback_services.py index ec7196ec08a9..5b8c432f8526 100644 --- a/core/domain/feedback_services.py +++ b/core/domain/feedback_services.py @@ -510,66 +510,67 @@ def get_thread_summaries(user_id, full_thread_ids): thread_summaries = [] number_of_unread_threads = 0 for index, thread in enumerate(threads): - feedback_thread_user_model_exists = ( - feedback_thread_user_models[index] is not None) - if feedback_thread_user_model_exists: - last_message_read = ( - last_two_messages[index][0].message_id - in feedback_thread_user_models[index].message_ids_read_by_user) - else: - last_message_read = False - - if last_two_messages[index][0].author_id is None: - author_last_message = None - else: - author_last_message = user_services.get_username( - last_two_messages[index][0].author_id) - - second_last_message_read = None - author_second_last_message = None - - does_second_message_exist = (last_two_messages[index][1] is not None) - if does_second_message_exist: + if thread.original_author_id == user_id: + feedback_thread_user_model_exists = ( + feedback_thread_user_models[index] is not None) if feedback_thread_user_model_exists: - second_last_message_read = ( - last_two_messages[index][1].message_id - in feedback_thread_user_models[index].message_ids_read_by_user) # pylint: disable=line-too-long + last_message_read = ( + last_two_messages[index][0].message_id + in feedback_thread_user_models[index].message_ids_read_by_user) else: - second_last_message_read = False + last_message_read = False - if last_two_messages[index][1].author_id is None: - author_second_last_message = None + if last_two_messages[index][0].author_id is None: + author_last_message = None else: - author_second_last_message = user_services.get_username( - last_two_messages[index][1].author_id) - if not last_message_read: - number_of_unread_threads += 1 - - if thread.message_count: - total_message_count = thread.message_count - # TODO(Arunabh): Remove else clause after each thread has a message - # count. - else: - total_message_count = ( - feedback_models.FeedbackMessageModel.get_message_count( - thread.exploration_id, thread.get_thread_id())) - - thread_summary = { - 'status': thread.status, - 'original_author_id': thread.original_author_id, - 'last_updated': utils.get_time_in_millisecs(thread.last_updated), - 'last_message_text': last_two_messages[index][0].text, - 'total_message_count': total_message_count, - 'last_message_read': last_message_read, - 'second_last_message_read': second_last_message_read, - 'author_last_message': author_last_message, - 'author_second_last_message': author_second_last_message, - 'exploration_title': explorations[index].title, - 'exploration_id': exploration_ids[index], - 'thread_id': thread_ids[index] - } - - thread_summaries.append(thread_summary) + author_last_message = user_services.get_username( + last_two_messages[index][0].author_id) + + second_last_message_read = None + author_second_last_message = None + + does_second_message_exist = (last_two_messages[index][1] is not None) + if does_second_message_exist: + if feedback_thread_user_model_exists: + second_last_message_read = ( + last_two_messages[index][1].message_id + in feedback_thread_user_models[index].message_ids_read_by_user) # pylint: disable=line-too-long + else: + second_last_message_read = False + + if last_two_messages[index][1].author_id is None: + author_second_last_message = None + else: + author_second_last_message = user_services.get_username( + last_two_messages[index][1].author_id) + if not last_message_read: + number_of_unread_threads += 1 + + if thread.message_count: + total_message_count = thread.message_count + # TODO(Arunabh): Remove else clause after each thread has a message + # count. + else: + total_message_count = ( + feedback_models.FeedbackMessageModel.get_message_count( + thread.exploration_id, thread.get_thread_id())) + + thread_summary = { + 'status': thread.status, + 'original_author_id': thread.original_author_id, + 'last_updated': utils.get_time_in_millisecs(thread.last_updated), + 'last_message_text': last_two_messages[index][0].text, + 'total_message_count': total_message_count, + 'last_message_read': last_message_read, + 'second_last_message_read': second_last_message_read, + 'author_last_message': author_last_message, + 'author_second_last_message': author_second_last_message, + 'exploration_title': explorations[index].title, + 'exploration_id': exploration_ids[index], + 'thread_id': thread_ids[index] + } + + thread_summaries.append(thread_summary) return thread_summaries, number_of_unread_threads diff --git a/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js b/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js index 37246e1a8d37..c8a452c315f7 100644 --- a/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js +++ b/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js @@ -268,10 +268,10 @@ oppia.controller('LearnerDashboard', [ $scope.threadSummaries[index].threadId === threadId) { threadIndex = index; var threadSummary = $scope.threadSummaries[index]; - threadSummary.markTheLastTwoMessagesAsRead(); if (!threadSummary.lastMessageRead) { $scope.numberOfUnreadThreads -= 1; } + threadSummary.markTheLastTwoMessagesAsRead(); } } From 0b0f98ee5f2c110d68c520f25abfec65136f5e4d Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Mon, 21 Aug 2017 02:49:22 +0530 Subject: [PATCH 2/8] Fix bugs. --- core/domain/feedback_services.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/domain/feedback_services.py b/core/domain/feedback_services.py index 5b8c432f8526..883e10d97993 100644 --- a/core/domain/feedback_services.py +++ b/core/domain/feedback_services.py @@ -515,8 +515,8 @@ def get_thread_summaries(user_id, full_thread_ids): feedback_thread_user_models[index] is not None) if feedback_thread_user_model_exists: last_message_read = ( - last_two_messages[index][0].message_id - in feedback_thread_user_models[index].message_ids_read_by_user) + last_two_messages[index][0].message_id in + feedback_thread_user_models[index].message_ids_read_by_user) else: last_message_read = False @@ -529,7 +529,8 @@ def get_thread_summaries(user_id, full_thread_ids): second_last_message_read = None author_second_last_message = None - does_second_message_exist = (last_two_messages[index][1] is not None) + does_second_message_exist = ( + last_two_messages[index][1] is not None) if does_second_message_exist: if feedback_thread_user_model_exists: second_last_message_read = ( @@ -558,7 +559,8 @@ def get_thread_summaries(user_id, full_thread_ids): thread_summary = { 'status': thread.status, 'original_author_id': thread.original_author_id, - 'last_updated': utils.get_time_in_millisecs(thread.last_updated), + 'last_updated': ( + utils.get_time_in_millisecs(thread.last_updated)), 'last_message_text': last_two_messages[index][0].text, 'total_message_count': total_message_count, 'last_message_read': last_message_read, From d812a95ae4b18f0b9d129f33327c357c65348256 Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Mon, 21 Aug 2017 07:56:18 +0530 Subject: [PATCH 3/8] Set default dashboard for new creators and fix bug. --- core/controllers/profile.py | 8 ++++++++ .../templates/dev/head/pages/preferences/preferences.html | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/controllers/profile.py b/core/controllers/profile.py index 2889ebfc37a9..468c28ff31f9 100644 --- a/core/controllers/profile.py +++ b/core/controllers/profile.py @@ -14,6 +14,8 @@ """Controllers for the profile page.""" +from constants import constants + from core.controllers import base from core.domain import acl_decorators from core.domain import email_manager @@ -243,6 +245,12 @@ def get(self): """Handles GET requests.""" return_url = str(self.request.get('return_url', self.request.uri)) + # Check if the return url is the creator dashboard. If it is, we should + # set the default dashboard of the user as the creator dashboard. + if feconf.CREATOR_DASHBOARD_URL in return_url: + user_services.update_user_default_dashboard( + self.user_id, constants.DASHBOARD_TYPE_CREATOR) + if user_services.has_fully_registered(self.user_id): self.redirect(return_url) return diff --git a/core/templates/dev/head/pages/preferences/preferences.html b/core/templates/dev/head/pages/preferences/preferences.html index 8aab3d78cefd..fc7aec1e6d47 100644 --- a/core/templates/dev/head/pages/preferences/preferences.html +++ b/core/templates/dev/head/pages/preferences/preferences.html @@ -72,13 +72,13 @@
From 4965b359d7691434b4e2f42db52736c490fb0f15 Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Mon, 21 Aug 2017 08:14:14 +0530 Subject: [PATCH 4/8] Remove unnesscary changes. --- core/domain/feedback_services.py | 115 +++++++++--------- .../learner_dashboard/LearnerDashboard.js | 2 +- 2 files changed, 57 insertions(+), 60 deletions(-) diff --git a/core/domain/feedback_services.py b/core/domain/feedback_services.py index 883e10d97993..ec7196ec08a9 100644 --- a/core/domain/feedback_services.py +++ b/core/domain/feedback_services.py @@ -510,69 +510,66 @@ def get_thread_summaries(user_id, full_thread_ids): thread_summaries = [] number_of_unread_threads = 0 for index, thread in enumerate(threads): - if thread.original_author_id == user_id: - feedback_thread_user_model_exists = ( - feedback_thread_user_models[index] is not None) + feedback_thread_user_model_exists = ( + feedback_thread_user_models[index] is not None) + if feedback_thread_user_model_exists: + last_message_read = ( + last_two_messages[index][0].message_id + in feedback_thread_user_models[index].message_ids_read_by_user) + else: + last_message_read = False + + if last_two_messages[index][0].author_id is None: + author_last_message = None + else: + author_last_message = user_services.get_username( + last_two_messages[index][0].author_id) + + second_last_message_read = None + author_second_last_message = None + + does_second_message_exist = (last_two_messages[index][1] is not None) + if does_second_message_exist: if feedback_thread_user_model_exists: - last_message_read = ( - last_two_messages[index][0].message_id in - feedback_thread_user_models[index].message_ids_read_by_user) + second_last_message_read = ( + last_two_messages[index][1].message_id + in feedback_thread_user_models[index].message_ids_read_by_user) # pylint: disable=line-too-long else: - last_message_read = False + second_last_message_read = False - if last_two_messages[index][0].author_id is None: - author_last_message = None - else: - author_last_message = user_services.get_username( - last_two_messages[index][0].author_id) - - second_last_message_read = None - author_second_last_message = None - - does_second_message_exist = ( - last_two_messages[index][1] is not None) - if does_second_message_exist: - if feedback_thread_user_model_exists: - second_last_message_read = ( - last_two_messages[index][1].message_id - in feedback_thread_user_models[index].message_ids_read_by_user) # pylint: disable=line-too-long - else: - second_last_message_read = False - - if last_two_messages[index][1].author_id is None: - author_second_last_message = None - else: - author_second_last_message = user_services.get_username( - last_two_messages[index][1].author_id) - if not last_message_read: - number_of_unread_threads += 1 - - if thread.message_count: - total_message_count = thread.message_count - # TODO(Arunabh): Remove else clause after each thread has a message - # count. + if last_two_messages[index][1].author_id is None: + author_second_last_message = None else: - total_message_count = ( - feedback_models.FeedbackMessageModel.get_message_count( - thread.exploration_id, thread.get_thread_id())) - - thread_summary = { - 'status': thread.status, - 'original_author_id': thread.original_author_id, - 'last_updated': ( - utils.get_time_in_millisecs(thread.last_updated)), - 'last_message_text': last_two_messages[index][0].text, - 'total_message_count': total_message_count, - 'last_message_read': last_message_read, - 'second_last_message_read': second_last_message_read, - 'author_last_message': author_last_message, - 'author_second_last_message': author_second_last_message, - 'exploration_title': explorations[index].title, - 'exploration_id': exploration_ids[index], - 'thread_id': thread_ids[index] - } - - thread_summaries.append(thread_summary) + author_second_last_message = user_services.get_username( + last_two_messages[index][1].author_id) + if not last_message_read: + number_of_unread_threads += 1 + + if thread.message_count: + total_message_count = thread.message_count + # TODO(Arunabh): Remove else clause after each thread has a message + # count. + else: + total_message_count = ( + feedback_models.FeedbackMessageModel.get_message_count( + thread.exploration_id, thread.get_thread_id())) + + thread_summary = { + 'status': thread.status, + 'original_author_id': thread.original_author_id, + 'last_updated': utils.get_time_in_millisecs(thread.last_updated), + 'last_message_text': last_two_messages[index][0].text, + 'total_message_count': total_message_count, + 'last_message_read': last_message_read, + 'second_last_message_read': second_last_message_read, + 'author_last_message': author_last_message, + 'author_second_last_message': author_second_last_message, + 'exploration_title': explorations[index].title, + 'exploration_id': exploration_ids[index], + 'thread_id': thread_ids[index] + } + + thread_summaries.append(thread_summary) return thread_summaries, number_of_unread_threads diff --git a/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js b/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js index c8a452c315f7..37246e1a8d37 100644 --- a/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js +++ b/core/templates/dev/head/pages/learner_dashboard/LearnerDashboard.js @@ -268,10 +268,10 @@ oppia.controller('LearnerDashboard', [ $scope.threadSummaries[index].threadId === threadId) { threadIndex = index; var threadSummary = $scope.threadSummaries[index]; + threadSummary.markTheLastTwoMessagesAsRead(); if (!threadSummary.lastMessageRead) { $scope.numberOfUnreadThreads -= 1; } - threadSummary.markTheLastTwoMessagesAsRead(); } } From 9c927827eb73d4f1ab4d3e0bf0cefb86707ab217 Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Tue, 22 Aug 2017 02:53:25 +0530 Subject: [PATCH 5/8] Address review comments. --- core/controllers/profile.py | 8 -------- .../templates/dev/head/pages/signup/Signup.js | 19 ++++++++++++++++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/core/controllers/profile.py b/core/controllers/profile.py index 468c28ff31f9..2889ebfc37a9 100644 --- a/core/controllers/profile.py +++ b/core/controllers/profile.py @@ -14,8 +14,6 @@ """Controllers for the profile page.""" -from constants import constants - from core.controllers import base from core.domain import acl_decorators from core.domain import email_manager @@ -245,12 +243,6 @@ def get(self): """Handles GET requests.""" return_url = str(self.request.get('return_url', self.request.uri)) - # Check if the return url is the creator dashboard. If it is, we should - # set the default dashboard of the user as the creator dashboard. - if feconf.CREATOR_DASHBOARD_URL in return_url: - user_services.update_user_default_dashboard( - self.user_id, constants.DASHBOARD_TYPE_CREATOR) - if user_services.has_fully_registered(self.user_id): self.redirect(return_url) return diff --git a/core/templates/dev/head/pages/signup/Signup.js b/core/templates/dev/head/pages/signup/Signup.js index 7c6ad4537de3..e2d0a7a439c3 100644 --- a/core/templates/dev/head/pages/signup/Signup.js +++ b/core/templates/dev/head/pages/signup/Signup.js @@ -143,11 +143,28 @@ oppia.controller('Signup', [ 'Invalid value for email preferences: ' + canReceiveEmailUpdates); } } - siteAnalyticsService.registerNewSignupEvent(); $scope.submissionInProcess = true; $http.post(_SIGNUP_DATA_URL, requestParams).then(function() { + var returnUrl = window.decodeURIComponent( + urlService.getUrlParams().return_url); + + + // If the user has the return url as the creator dashboard, it is + // likely that he/she is a creator. Therfore we should set the + // default dashboard as the creator dashboard. + if (returnUrl.indexOf('creator_dashboard') !== -1) { + $http.put('/preferenceshandler/data', { + update_type: 'default_dashboard', + data: constants.DASHBOARD_TYPE_CREATOR + }); + } else { + $http.put('/preferenceshandler/data', { + update_type: 'default_dashboard', + data: constants.DASHBOARD_TYPE_LEARNER + }); + } window.location = window.decodeURIComponent( urlService.getUrlParams().return_url); }, function() { From 2a62863593311cac49f2fc606c35f774aab039e7 Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Tue, 22 Aug 2017 07:37:16 +0530 Subject: [PATCH 6/8] Address review comments. --- core/controllers/profile.py | 5 +++ .../templates/dev/head/pages/signup/Signup.js | 36 +++++++++---------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/core/controllers/profile.py b/core/controllers/profile.py index 2889ebfc37a9..488f77f0dc06 100644 --- a/core/controllers/profile.py +++ b/core/controllers/profile.py @@ -281,12 +281,17 @@ def post(self): """Handles POST requests.""" username = self.payload.get('username') agreed_to_terms = self.payload.get('agreed_to_terms') + default_dashboard = self.payload.get('default_dashboard') can_receive_email_updates = self.payload.get( 'can_receive_email_updates') has_ever_registered = user_services.has_ever_registered(self.user_id) has_fully_registered = user_services.has_fully_registered(self.user_id) + # Set the default dashboard for new users. + user_services.update_user_default_dashboard( + self.user_id, default_dashboard) + if has_fully_registered: self.render_json({}) return diff --git a/core/templates/dev/head/pages/signup/Signup.js b/core/templates/dev/head/pages/signup/Signup.js index e2d0a7a439c3..b51591aa3233 100644 --- a/core/templates/dev/head/pages/signup/Signup.js +++ b/core/templates/dev/head/pages/signup/Signup.js @@ -124,6 +124,23 @@ oppia.controller('Signup', [ agreed_to_terms: agreedToTerms, can_receive_email_updates: null }; + + var defaultDashboard = ''; + var returnUrl = window.decodeURIComponent( + urlService.getUrlParams().return_url); + + if (returnUrl.indexOf('creator_dashboard') !== -1) { + defaultDashboard = constants.DASHBOARD_TYPE_CREATOR; + } else { + defaultDashboard = constants.DASHBOARD_TYPE_LEARNER; + } + + var requestParams = { + agreed_to_terms: agreedToTerms, + can_receive_email_updates: null, + default_dashboard: defaultDashboard + }; + if (!$scope.hasUsername) { requestParams.username = username; } @@ -143,28 +160,11 @@ oppia.controller('Signup', [ 'Invalid value for email preferences: ' + canReceiveEmailUpdates); } } + siteAnalyticsService.registerNewSignupEvent(); $scope.submissionInProcess = true; $http.post(_SIGNUP_DATA_URL, requestParams).then(function() { - var returnUrl = window.decodeURIComponent( - urlService.getUrlParams().return_url); - - - // If the user has the return url as the creator dashboard, it is - // likely that he/she is a creator. Therfore we should set the - // default dashboard as the creator dashboard. - if (returnUrl.indexOf('creator_dashboard') !== -1) { - $http.put('/preferenceshandler/data', { - update_type: 'default_dashboard', - data: constants.DASHBOARD_TYPE_CREATOR - }); - } else { - $http.put('/preferenceshandler/data', { - update_type: 'default_dashboard', - data: constants.DASHBOARD_TYPE_LEARNER - }); - } window.location = window.decodeURIComponent( urlService.getUrlParams().return_url); }, function() { From 7854aa53f6d7833bb2ba4eedf17832a58ca49d40 Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Tue, 22 Aug 2017 09:29:28 +0530 Subject: [PATCH 7/8] Add tests. --- core/controllers/profile_test.py | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/core/controllers/profile_test.py b/core/controllers/profile_test.py index cbd11996581f..35cc98a422b5 100644 --- a/core/controllers/profile_test.py +++ b/core/controllers/profile_test.py @@ -14,6 +14,8 @@ """Tests for the profile page.""" +from constants import constants + from core.domain import exp_services from core.domain import rights_manager from core.domain import subscription_services @@ -113,6 +115,45 @@ def test_username_is_handled_correctly(self): self.logout() + def test_default_dashboard_for_new_users(self): + self.login(self.EDITOR_EMAIL) + response = self.testapp.get(feconf.SIGNUP_URL) + csrf_token = self.get_csrf_token_from_response(response) + + # This user should have the creator dashboard as default. + self.post_json( + feconf.SIGNUP_DATA_URL, + {'agreed_to_terms': True, 'username': 'creatoruser', + 'default_dashboard': constants.DASHBOARD_TYPE_CREATOR, + 'can_receive_email_updates': None}, + csrf_token) + + user_id = user_services.get_user_id_from_username('creatoruser') + user_settings = user_services.get_user_settings(user_id) + self.assertEqual( + user_settings.default_dashboard, constants.DASHBOARD_TYPE_CREATOR) + + self.logout() + + self.login(self.VIEWER_EMAIL) + response = self.testapp.get(feconf.SIGNUP_URL) + csrf_token = self.get_csrf_token_from_response(response) + + # This user should have the learner dashboard as default. + self.post_json( + feconf.SIGNUP_DATA_URL, + {'agreed_to_terms': True, 'username': 'learneruser', + 'default_dashboard': constants.DASHBOARD_TYPE_LEARNER, + 'can_receive_email_updates': None}, + csrf_token) + + user_id = user_services.get_user_id_from_username('learneruser') + user_settings = user_services.get_user_settings(user_id) + self.assertEqual( + user_settings.default_dashboard, constants.DASHBOARD_TYPE_LEARNER) + + self.logout() + class UsernameCheckHandlerTests(test_utils.GenericTestBase): From 109392aab534aecf2ec037c285ea55373afc9276 Mon Sep 17 00:00:00 2001 From: Arunabh98 Date: Tue, 22 Aug 2017 09:46:18 +0530 Subject: [PATCH 8/8] Address review comments. --- core/controllers/profile.py | 9 +++++---- core/storage/user/gae_models.py | 6 +++++- core/templates/dev/head/pages/signup/Signup.js | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/controllers/profile.py b/core/controllers/profile.py index 488f77f0dc06..45b53c8865bd 100644 --- a/core/controllers/profile.py +++ b/core/controllers/profile.py @@ -288,10 +288,6 @@ def post(self): has_ever_registered = user_services.has_ever_registered(self.user_id) has_fully_registered = user_services.has_fully_registered(self.user_id) - # Set the default dashboard for new users. - user_services.update_user_default_dashboard( - self.user_id, default_dashboard) - if has_fully_registered: self.render_json({}) return @@ -323,6 +319,11 @@ def post(self): user_services.generate_initial_profile_picture(self.user_id) + if not has_ever_registered: + # Set the default dashboard for new users. + user_services.update_user_default_dashboard( + self.user_id, default_dashboard) + self.render_json({}) diff --git a/core/storage/user/gae_models.py b/core/storage/user/gae_models.py index 558b17c7ba92..c6ee7f6f15ec 100644 --- a/core/storage/user/gae_models.py +++ b/core/storage/user/gae_models.py @@ -58,7 +58,11 @@ class UserSettingsModel(base_models.BaseModel): profile_picture_data_url = ndb.TextProperty(default=None, indexed=False) # The preferred dashboard of the user. default_dashboard = ndb.StringProperty( - default=constants.DASHBOARD_TYPE_LEARNER, indexed=False) + default=constants.DASHBOARD_TYPE_LEARNER, + indexed=False, + choices=[ + constants.DASHBOARD_TYPE_LEARNER, + constants.DASHBOARD_TYPE_CREATOR]) # User specified biography (to be shown on their profile page). user_bio = ndb.TextProperty(indexed=False) # Subject interests specified by the user. diff --git a/core/templates/dev/head/pages/signup/Signup.js b/core/templates/dev/head/pages/signup/Signup.js index b51591aa3233..93e741298d93 100644 --- a/core/templates/dev/head/pages/signup/Signup.js +++ b/core/templates/dev/head/pages/signup/Signup.js @@ -125,7 +125,7 @@ oppia.controller('Signup', [ can_receive_email_updates: null }; - var defaultDashboard = ''; + var defaultDashboard = constants.DASHBOARD_TYPE_LEARNER; var returnUrl = window.decodeURIComponent( urlService.getUrlParams().return_url);